]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/regions-infer-contravariance-due-to-ret.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / regions-infer-contravariance-due-to-ret.rs
index c45212eaa6264fb752056e8a6f30e939dbdbbeda..7e328f3bb0354ce453f80f52b913e0dfdb26acf1 100644 (file)
@@ -8,11 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct boxed_int {
-    f: &'self int,
+struct boxed_int<'a> {
+    f: &'a int,
 }
 
-fn max(bi: &'r boxed_int, f: &'r int) -> int {
+fn max<'r>(bi: &'r boxed_int, f: &'r int) -> int {
     if *bi.f > *f {*bi.f} else {*f}
 }
 
@@ -24,5 +24,5 @@ fn with(bi: &boxed_int) -> int {
 pub fn main() {
     let g = 21;
     let foo = boxed_int { f: &g };
-    fail_unless!(with(&foo) == 22);
+    assert_eq!(with(&foo), 22);
 }