fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
905 B22 linesraw
1error[E0507]: cannot move out of `y`, a captured variable in an `Fn` closure
2  --> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:12:9
3   |
4LL |     let y = vec![format!("World")];
5   |         - captured outer variable
6LL |     call(|| {
7   |          -- captured by this `Fn` closure
8LL |         y.into_iter();
9   |         ^ ----------- `y` moved due to this method call
10   |         |
11   |         move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait
12   |
13note: `into_iter` takes ownership of the receiver `self`, which moves `y`
14  --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
15help: you can `clone` the value and consume it, but this might not be your desired behavior
16   |
17LL |         y.clone().into_iter();
18   |          ++++++++
19
20error: aborting due to previous error
21
22For more information about this error, try `rustc --explain E0507`.