]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closure-illegal-move.nll.stderr
Update output for borrowck=migrate compare mode.
[rust.git] / src / test / ui / unboxed-closures / unboxed-closure-illegal-move.nll.stderr
1 error[E0507]: cannot move out of captured variable in an `Fn` closure
2   --> $DIR/unboxed-closure-illegal-move.rs:25:31
3    |
4 LL |         let x = Box::new(0);
5    |             - captured outer variable
6 LL |         let f = to_fn(|| drop(x)); //~ ERROR cannot move
7    |                               ^ cannot move out of captured variable in an `Fn` closure
8
9 error[E0507]: cannot move out of `x`, as it is a captured variable in a `Fn` closure
10   --> $DIR/unboxed-closure-illegal-move.rs:25:31
11    |
12 LL |         let f = to_fn(|| drop(x)); //~ ERROR cannot move
13    |                               ^
14    |                               |
15    |                               cannot move out of `x`, 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/unboxed-closure-illegal-move.rs:25:23
20    |
21 LL |         let f = to_fn(|| drop(x)); //~ ERROR cannot move
22    |                       ^^^^^^^^^^
23
24 error[E0507]: cannot move out of captured variable in an `FnMut` closure
25   --> $DIR/unboxed-closure-illegal-move.rs:29:35
26    |
27 LL |         let x = Box::new(0);
28    |             - captured outer variable
29 LL |         let f = to_fn_mut(|| drop(x)); //~ ERROR cannot move
30    |                                   ^ cannot move out of captured variable in an `FnMut` closure
31
32 error[E0507]: cannot move out of captured variable in an `Fn` closure
33   --> $DIR/unboxed-closure-illegal-move.rs:38:36
34    |
35 LL |         let x = Box::new(0);
36    |             - captured outer variable
37 LL |         let f = to_fn(move || drop(x)); //~ ERROR cannot move
38    |                                    ^ cannot move out of captured variable in an `Fn` closure
39
40 error[E0507]: cannot move out of `x`, as it is a captured variable in a `Fn` closure
41   --> $DIR/unboxed-closure-illegal-move.rs:38:36
42    |
43 LL |         let f = to_fn(move || drop(x)); //~ ERROR cannot move
44    |                                    ^
45    |                                    |
46    |                                    cannot move out of `x`, as it is a captured variable in a `Fn` closure
47    |                                    cannot move
48    |
49 help: consider changing this to accept closures that implement `FnMut`
50   --> $DIR/unboxed-closure-illegal-move.rs:38:23
51    |
52 LL |         let f = to_fn(move || drop(x)); //~ ERROR cannot move
53    |                       ^^^^^^^^^^^^^^^
54
55 error[E0507]: cannot move out of captured variable in an `FnMut` closure
56   --> $DIR/unboxed-closure-illegal-move.rs:42:40
57    |
58 LL |         let x = Box::new(0);
59    |             - captured outer variable
60 LL |         let f = to_fn_mut(move || drop(x)); //~ ERROR cannot move
61    |                                        ^ cannot move out of captured variable in an `FnMut` closure
62
63 error: aborting due to 6 previous errors
64
65 For more information about this error, try `rustc --explain E0507`.