]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/borrowck/borrowck-in-static.nll.stderr
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-in-static.nll.stderr
index 45fa1764f7027230af918979f7648d00e8a418cb..ba42dc2436377c3792f917f890c39e9ea9c8f43c 100644 (file)
@@ -6,6 +6,21 @@ LL |     let x = Box::new(0);
 LL |     Box::new(|| x) //~ ERROR cannot move out of captured outer variable
    |                 ^ cannot move out of captured variable in an `Fn` closure
 
-error: aborting due to previous error
+error[E0507]: cannot move out of `x`, as it is a captured variable in a `Fn` closure
+  --> $DIR/borrowck-in-static.rs:15:17
+   |
+LL |     Box::new(|| x) //~ ERROR cannot move out of captured outer variable
+   |                 ^
+   |                 |
+   |                 cannot move out of `x`, as it is a captured variable in a `Fn` closure
+   |                 cannot move
+   |
+help: consider changing this to accept closures that implement `FnMut`
+  --> $DIR/borrowck-in-static.rs:15:14
+   |
+LL |     Box::new(|| x) //~ ERROR cannot move out of captured outer variable
+   |              ^^^^
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0507`.