]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr
Rollup merge of #98226 - ChrisDenton:doc-extern-options, r=ehuss
[rust.git] / src / test / ui / borrowck / unboxed-closures-move-upvar-from-non-once-ref-closure.stderr
1 error[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:11:9
3    |
4 LL |       let y = vec![format!("World")];
5    |           - captured outer variable
6 LL |       call(|| {
7    |  __________-
8 LL | |         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 LL | |
13 LL | |     });
14    | |_____- captured by this `Fn` closure
15    |
16 note: this function takes ownership of the receiver `self`, which moves `y`
17   --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
18    |
19 LL |     fn into_iter(self) -> Self::IntoIter;
20    |                  ^^^^
21
22 error: aborting due to previous error
23
24 For more information about this error, try `rustc --explain E0507`.