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