]> git.lizzy.rs Git - rust.git/blob - tests/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
[rust.git] / tests / ui / moves / moves-based-on-type-move-out-of-closure-env-issue-1965.stderr
1 error[E0507]: cannot move out of `i`, a captured variable in an `Fn` closure
2   --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:9:28
3    |
4 LL |     let i = Box::new(3);
5    |         - captured outer variable
6 LL |     let _f = to_fn(|| test(i));
7    |                    --      ^ move occurs because `i` has type `Box<usize>`, which does not implement the `Copy` trait
8    |                    |
9    |                    captured by this `Fn` closure
10
11 error: aborting due to previous error
12
13 For more information about this error, try `rustc --explain E0507`.