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