]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error[E0507]: cannot move out of captured variable in an `Fn` closure |
83c7162d XL |
2 | --> $DIR/borrowck-in-static.rs:15:17 |
3 | | | |
b7449926 XL |
4 | LL | let x = Box::new(0); |
5 | | - captured outer variable | |
83c7162d | 6 | LL | Box::new(|| x) //~ ERROR cannot move out of captured outer variable |
8faf50e0 | 7 | | ^ cannot move out of captured variable in an `Fn` closure |
83c7162d | 8 | |
0bf4aa26 XL |
9 | error[E0507]: cannot move out of `x`, as it is a captured variable in a `Fn` closure |
10 | --> $DIR/borrowck-in-static.rs:15:17 | |
11 | | | |
12 | LL | Box::new(|| x) //~ ERROR cannot move out of captured outer variable | |
13 | | ^ | |
14 | | | | |
15 | | cannot move out of `x`, as it is a captured variable in a `Fn` closure | |
16 | | cannot move | |
17 | | | |
18 | help: consider changing this to accept closures that implement `FnMut` | |
19 | --> $DIR/borrowck-in-static.rs:15:14 | |
20 | | | |
21 | LL | Box::new(|| x) //~ ERROR cannot move out of captured outer variable | |
22 | | ^^^^ | |
23 | ||
24 | error: aborting due to 2 previous errors | |
83c7162d XL |
25 | |
26 | For more information about this error, try `rustc --explain E0507`. |