1 error[E0507]: cannot move out of captured variable in an `Fn` closure
2 --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:28
5 | - captured outer variable
6 LL | let _f = to_fn(|| test(i)); //~ ERROR cannot move out
7 | ^ cannot move out of captured variable in an `Fn` closure
9 error[E0507]: cannot move out of `i`, as it is a captured variable in a `Fn` closure
10 --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:28
12 LL | let _f = to_fn(|| test(i)); //~ ERROR cannot move out
15 | cannot move out of `i`, as it is a captured variable in a `Fn` closure
18 help: consider changing this to accept closures that implement `FnMut`
19 --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:20
21 LL | let _f = to_fn(|| test(i)); //~ ERROR cannot move out
24 error: aborting due to 2 previous errors
26 For more information about this error, try `rustc --explain E0507`.