]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closure-illegal-move.stderr
Rollup merge of #58998 - xTibor:doc_from_bytes, r=scottmcm
[rust.git] / src / test / ui / unboxed-closures / unboxed-closure-illegal-move.stderr
1 error[E0507]: cannot move out of captured outer variable in an `Fn` closure
2   --> $DIR/unboxed-closure-illegal-move.rs:15:31
3    |
4 LL |         let x = Box::new(0);
5    |             - captured outer variable
6 LL |         let f = to_fn(|| drop(x));
7    |                               ^ cannot move out of captured outer variable in an `Fn` closure
8
9 error[E0507]: cannot move out of captured outer variable in an `FnMut` closure
10   --> $DIR/unboxed-closure-illegal-move.rs:19:35
11    |
12 LL |         let x = Box::new(0);
13    |             - captured outer variable
14 LL |         let f = to_fn_mut(|| drop(x));
15    |                                   ^ cannot move out of captured outer variable in an `FnMut` closure
16
17 error[E0507]: cannot move out of captured outer variable in an `Fn` closure
18   --> $DIR/unboxed-closure-illegal-move.rs:28:36
19    |
20 LL |         let x = Box::new(0);
21    |             - captured outer variable
22 LL |         let f = to_fn(move || drop(x));
23    |                                    ^ cannot move out of captured outer variable in an `Fn` closure
24
25 error[E0507]: cannot move out of captured outer variable in an `FnMut` closure
26   --> $DIR/unboxed-closure-illegal-move.rs:32:40
27    |
28 LL |         let x = Box::new(0);
29    |             - captured outer variable
30 LL |         let f = to_fn_mut(move || drop(x));
31    |                                        ^ cannot move out of captured outer variable in an `FnMut` closure
32
33 error: aborting due to 4 previous errors
34
35 For more information about this error, try `rustc --explain E0507`.