fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
826 B16 linesraw
1error[E0507]: cannot move out of `bar`, a captured variable in an `FnMut` closure
2  --> $DIR/borrowck-move-by-capture.rs:9:29
3   |
4LL |     let bar: Box<_> = box 3;
5   |         --- captured outer variable
6LL |     let _g = to_fn_mut(|| {
7LL |         let _h = to_fn_once(move || -> isize { *bar });
8   |                             ^^^^^^^^^^^^^^^^    ---
9   |                             |                   |
10   |                             |                   move occurs because `bar` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
11   |                             |                   move occurs due to use in closure
12   |                             move out of `bar` occurs here
13
14error: aborting due to previous error
15
16For more information about this error, try `rustc --explain E0507`.