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 `x`, as it is a captured variable in a `Fn` closure
10 --> $DIR/unboxed-closure-illegal-move.rs:25:31
12 LL | let f = to_fn(|| drop(x)); //~ ERROR cannot move
15 | cannot move out of `x`, as it is a captured variable in a `Fn` closure
18 help: consider changing this to accept closures that implement `FnMut`
19 --> $DIR/unboxed-closure-illegal-move.rs:25:23
21 LL | let f = to_fn(|| drop(x)); //~ ERROR cannot move
24 error[E0507]: cannot move out of captured variable in an `FnMut` closure
25 --> $DIR/unboxed-closure-illegal-move.rs:29:35
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
32 error[E0507]: cannot move out of captured variable in an `Fn` closure
33 --> $DIR/unboxed-closure-illegal-move.rs:38:36
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
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
43 LL | let f = to_fn(move || drop(x)); //~ ERROR cannot move
46 | cannot move out of `x`, as it is a captured variable in a `Fn` closure
49 help: consider changing this to accept closures that implement `FnMut`
50 --> $DIR/unboxed-closure-illegal-move.rs:38:23
52 LL | let f = to_fn(move || drop(x)); //~ ERROR cannot move
55 error[E0507]: cannot move out of captured variable in an `FnMut` closure
56 --> $DIR/unboxed-closure-illegal-move.rs:42:40
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
63 error: aborting due to 6 previous errors
65 For more information about this error, try `rustc --explain E0507`.