1 error[E0507]: cannot move out of `x`, a captured variable in an `Fn` closure
2 --> $DIR/unboxed-closure-illegal-move.rs:15:31
4 LL | let x = Box::new(0);
5 | - captured outer variable
6 LL | let f = to_fn(|| drop(x));
7 | -- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait
9 | captured by this `Fn` closure
11 error[E0507]: cannot move out of `x`, a captured variable in an `FnMut` closure
12 --> $DIR/unboxed-closure-illegal-move.rs:19:35
14 LL | let x = Box::new(0);
15 | - captured outer variable
16 LL | let f = to_fn_mut(|| drop(x));
17 | -- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait
19 | captured by this `FnMut` closure
21 error[E0507]: cannot move out of `x`, a captured variable in an `Fn` closure
22 --> $DIR/unboxed-closure-illegal-move.rs:28:36
24 LL | let x = Box::new(0);
25 | - captured outer variable
26 LL | let f = to_fn(move || drop(x));
27 | ------- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait
29 | captured by this `Fn` closure
31 error[E0507]: cannot move out of `x`, a captured variable in an `FnMut` closure
32 --> $DIR/unboxed-closure-illegal-move.rs:32:40
34 LL | let x = Box::new(0);
35 | - captured outer variable
36 LL | let f = to_fn_mut(move || drop(x));
37 | ------- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait
39 | captured by this `FnMut` closure
41 error: aborting due to 4 previous errors
43 For more information about this error, try `rustc --explain E0507`.