]> git.lizzy.rs Git - rust.git/blob - src/test/ui/loops/issue-82916.stderr
Merge commit 'fdb84cbfd25908df5683f8f62388f663d9260e39' into clippyup
[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    |              - `x` moved due to this implicit call to `.into_iter()`
8 ...
9 LL |     let z = x;
10    |             ^ value used here after move
11    |
12 note: this function takes ownership of the receiver `self`, which moves `x`
13   --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
14    |
15 LL |     fn into_iter(self) -> Self::IntoIter;
16    |                  ^^^^
17 help: consider iterating over a slice of the `Vec<S>`'s content to avoid moving into the `for` loop
18    |
19 LL |     for y in &x {
20    |              +
21
22 error: aborting due to previous error
23
24 For more information about this error, try `rustc --explain E0382`.