]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/moves/move-3-unique.rs
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / ui / moves / move-3-unique.rs
index 55b10e057d88cce761e898320d3adc27d6d684d1..8e5df2c3ff9fd6e93a155707545df7e77608f091 100644 (file)
@@ -1,6 +1,6 @@
 // run-pass
 #![allow(unused_mut)]
-#![feature(box_syntax)]
+#![allow(dead_code)]
 
 #[derive(Clone)]
 struct Triple {
@@ -12,12 +12,12 @@ struct Triple {
 fn test(x: bool, foo: Box<Triple>) -> isize {
     let bar = foo;
     let mut y: Box<Triple>;
-    if x { y = bar; } else { y = box Triple {x: 4, y: 5, z: 6}; }
+    if x { y = bar; } else { y = Box::new(Triple {x: 4, y: 5, z: 6}); }
     return y.y;
 }
 
 pub fn main() {
-    let x: Box<_> = box Triple{x: 1, y: 2, z: 3};
+    let x: Box<_> = Box::new(Triple{x: 1, y: 2, z: 3});
     for _ in 0_usize..10000_usize {
         assert_eq!(test(true, x.clone()), 2);
     }