]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/coerce-to-closure-and-proc.rs
rollup merge of #17355 : gamazeps/issue17210
[rust.git] / src / test / run-pass / coerce-to-closure-and-proc.rs
index 6f643ca0f41017f9a13c9c5d5dd64736552e2be7..44a3517cc758aab551c9f82259cf64b8cccb23e2 100644 (file)
@@ -12,12 +12,12 @@ fn id<T>(x: T) -> T {
     x
 }
 
-#[deriving(Eq)]
+#[deriving(PartialEq, Show)]
 struct Foo<T>(T);
 
-#[deriving(Eq)]
+#[deriving(PartialEq, Show)]
 enum Bar<T> {
-    Bar(T)
+    Baz(T)
 }
 
 pub fn main() {
@@ -33,11 +33,11 @@ pub fn main() {
     let f: proc(int) -> Foo<int> = Foo;
     assert_eq!(f(5), Foo(5));
 
-    let f: |int| -> Bar<int> = Bar;
-    assert_eq!(f(5), Bar(5));
+    let f: |int| -> Bar<int> = Baz;
+    assert_eq!(f(5), Baz(5));
 
-    let f: proc(int) -> Bar<int> = Bar;
-    assert_eq!(f(5), Bar(5));
+    let f: proc(int) -> Bar<int> = Baz;
+    assert_eq!(f(5), Baz(5));
 
     let f: |int| -> Option<int> = Some;
     assert_eq!(f(5), Some(5));