]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/borrowck/borrowck-bad-nested-calls-free.rs
Rollup merge of #89235 - yaahc:junit-formatting, r=kennytm
[rust.git] / src / test / ui / borrowck / borrowck-bad-nested-calls-free.rs
index 3abc56153b78a96726fed2b239f0f3b6881ac8ab..b0bb9a0351b4900722ef88a6b881ca66d3090431 100644 (file)
@@ -1,10 +1,10 @@
 // Test that we detect nested calls that could free pointers evaluated
 // for earlier arguments.
 
-#![feature(box_syntax)]
+
 
 fn rewrite(v: &mut Box<usize>) -> usize {
-    *v = box 22;
+    *v = Box::new(22);
     **v
 }
 
@@ -13,7 +13,7 @@ fn add(v: &usize, w: usize) -> usize {
 }
 
 fn implicit() {
-    let mut a: Box<_> = box 1;
+    let mut a: Box<_> = Box::new(1);
 
     // Note the danger here:
     //
@@ -26,7 +26,7 @@ fn implicit() {
 }
 
 fn explicit() {
-    let mut a: Box<_> = box 1;
+    let mut a: Box<_> = Box::new(1);
     add(
         &*a,
         rewrite(&mut a)); //~ ERROR cannot borrow