blob: a34a9efab6bce413f317a557d9da135e6b17c453 [file] [log] [blame]
error[E0507]: cannot move out of captured variable in an `Fn` closure
--> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:28
|
LL | let i = box 3;
| - captured outer variable
LL | let _f = to_fn(|| test(i)); //~ ERROR cannot move out
| ^ cannot move out of captured variable in an `Fn` closure
error[E0507]: cannot move out of `i`, as it is a captured variable in a `Fn` closure
--> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:28
|
LL | let _f = to_fn(|| test(i)); //~ ERROR cannot move out
| ^
| |
| cannot move out of `i`, as it is a captured variable in a `Fn` closure
| cannot move
|
help: consider changing this to accept closures that implement `FnMut`
--> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:20
|
LL | let _f = to_fn(|| test(i)); //~ ERROR cannot move out
| ^^^^^^^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0507`.