Closed
Description
Hello.
In the following code:
fn main() {
let mut vec = vec![1];
let vec2 = vec![1];
let vec3 = vec![1];
vec2.iter().map(move |_| {
vec3.iter().map(move |_| {
vec.iter();
0
});
0
});
}
we get the following error:
error[E0507]: cannot move out of captured outer variable in an `FnMut` closure
--> src/main.rs:6:25
|
6 | vec3.iter().map(move |_| {
| ^^^^^^^^ cannot move out of captured outer variable in an `FnMut` closure
which is not very helpful as it does not indicate which variable it is.
It would be nice to have a better hint in this case.
Thanks.