]> git.lizzy.rs Git - rust.git/blob - src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr
Update output for borrowck=migrate compare mode.
[rust.git] / src / test / ui / moves / moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr
1 error[E0507]: cannot move out of captured variable in an `Fn` closure
2   --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:28
3    |
4 LL |     let i = box 3;
5    |         - captured outer variable
6 LL |     let _f = to_fn(|| test(i)); //~ ERROR cannot move out
7    |                            ^ cannot move out of captured variable in an `Fn` closure
8
9 error[E0507]: cannot move out of `i`, as it is a captured variable in a `Fn` closure
10   --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:28
11    |
12 LL |     let _f = to_fn(|| test(i)); //~ ERROR cannot move out
13    |                            ^
14    |                            |
15    |                            cannot move out of `i`, as it is a captured variable in a `Fn` closure
16    |                            cannot move
17    |
18 help: consider changing this to accept closures that implement `FnMut`
19   --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:20
20    |
21 LL |     let _f = to_fn(|| test(i)); //~ ERROR cannot move out
22    |                    ^^^^^^^^^^
23
24 error: aborting due to 2 previous errors
25
26 For more information about this error, try `rustc --explain E0507`.