1 error[E0507]: cannot move out of captured variable in an `Fn` closure
2 --> $DIR/unboxed-closure-illegal-move.rs:25:31
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
9 error[E0507]: cannot move out of captured variable in an `FnMut` closure
10 --> $DIR/unboxed-closure-illegal-move.rs:29:35
12 LL | let x = Box::new(0);
13 | - captured outer variable
14 LL | let f = to_fn_mut(|| drop(x)); //~ ERROR cannot move
15 | ^ cannot move out of captured variable in an `FnMut` closure
17 error[E0507]: cannot move out of captured variable in an `Fn` closure
18 --> $DIR/unboxed-closure-illegal-move.rs:38:36
20 LL | let x = Box::new(0);
21 | - captured outer variable
22 LL | let f = to_fn(move || drop(x)); //~ ERROR cannot move
23 | ^ cannot move out of captured variable in an `Fn` closure
25 error[E0507]: cannot move out of captured variable in an `FnMut` closure
26 --> $DIR/unboxed-closure-illegal-move.rs:42:40
28 LL | let x = Box::new(0);
29 | - captured outer variable
30 LL | let f = to_fn_mut(move || drop(x)); //~ ERROR cannot move
31 | ^ cannot move out of captured variable in an `FnMut` closure
33 error: aborting due to 4 previous errors
35 For more information about this error, try `rustc --explain E0507`.