]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/move-4-unique.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / move-4-unique.rs
index 7b7b816aeb2ab6fb5e42ae87579d651d27cf7177..9e5eeef75527c1595ba1a601c4988a5d4e852ac0 100644 (file)
@@ -8,16 +8,21 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern mod std;
+#![allow(unknown_features)]
+#![feature(box_syntax)]
 
 struct Triple {a: int, b: int, c: int}
 
-fn test(foo: ~Triple) -> ~Triple {
+fn test(foo: Box<Triple>) -> Box<Triple> {
     let foo = foo;
-    let bar = move foo;
-    let baz = move bar;
-    let quux = move baz;
+    let bar = foo;
+    let baz = bar;
+    let quux = baz;
     return quux;
 }
 
-pub fn main() { let x = ~Triple{a: 1, b: 2, c: 3}; let y = test(x); assert (y.c == 3); }
+pub fn main() {
+    let x = box Triple{a: 1, b: 2, c: 3};
+    let y = test(x);
+    assert!((y.c == 3));
+}