]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.nll.stderr
Update output for borrowck=migrate compare mode.
[rust.git] / src / test / ui / borrowck / unboxed-closures-move-upvar-from-non-once-ref-closure.nll.stderr
index 0eb5fc8c324356ad358fa2438ac9bb1c992834a0..0844ac32b8b60a37edf562e5e167c22b23e3a31f 100644 (file)
@@ -7,6 +7,25 @@ LL |     call(|| {
 LL |         y.into_iter();
    |         ^ cannot move out of captured variable in an `Fn` closure
 
-error: aborting due to previous error
+error[E0507]: cannot move out of `y`, as it is a captured variable in a `Fn` closure
+  --> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:21:9
+   |
+LL |         y.into_iter();
+   |         ^
+   |         |
+   |         cannot move out of `y`, as it is a captured variable in a `Fn` closure
+   |         cannot move
+   |
+help: consider changing this to accept closures that implement `FnMut`
+  --> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:20:10
+   |
+LL |       call(|| {
+   |  __________^
+LL | |         y.into_iter();
+LL | |         //~^ ERROR cannot move out of captured outer variable in an `Fn` closure
+LL | |     });
+   | |_____^
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0507`.