]> git.lizzy.rs Git - rust.git/blob - src/test/ui/loops/issue-82916.stderr
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
[rust.git] / src / test / ui / loops / issue-82916.stderr
1 error[E0382]: use of moved value: `x`
2   --> $DIR/issue-82916.rs:7:13
3    |
4 LL | fn foo(x: Vec<S>) {
5    |        - move occurs because `x` has type `Vec<S>`, which does not implement the `Copy` trait
6 LL |     for y in x {
7    |              -
8    |              |
9    |              `x` moved due to this implicit call to `.into_iter()`
10    |              help: consider borrowing to avoid moving into the for loop: `&x`
11 ...
12 LL |     let z = x;
13    |             ^ value used here after move
14    |
15 note: this function takes ownership of the receiver `self`, which moves `x`
16   --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
17    |
18 LL |     fn into_iter(self) -> Self::IntoIter;
19    |                  ^^^^
20
21 error: aborting due to previous error
22
23 For more information about this error, try `rustc --explain E0382`.