]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/for-i-in-vec.stderr
Rollup merge of #94440 - compiler-errors:issue-94282, r=lcnr
[rust.git] / src / test / ui / suggestions / for-i-in-vec.stderr
1 error[E0507]: cannot move out of `self.v` which is behind a shared reference
2   --> $DIR/for-i-in-vec.rs:11:18
3    |
4 LL |         for _ in self.v {
5    |                  ^^^^^^
6    |                  |
7    |                  `self.v` moved due to this implicit call to `.into_iter()`
8    |                  move occurs because `self.v` has type `Vec<u32>`, which does not implement the `Copy` trait
9    |
10 note: this function takes ownership of the receiver `self`, which moves `self.v`
11   --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
12    |
13 LL |     fn into_iter(self) -> Self::IntoIter;
14    |                  ^^^^
15 help: consider iterating over a slice of the `Vec<u32>`'s content to avoid moving into the `for` loop
16    |
17 LL |         for _ in &self.v {
18    |                  +
19
20 error[E0507]: cannot move out of `self.h` which is behind a shared reference
21   --> $DIR/for-i-in-vec.rs:13:18
22    |
23 LL |         for _ in self.h {
24    |                  ^^^^^^
25    |                  |
26    |                  `self.h` moved due to this implicit call to `.into_iter()`
27    |                  move occurs because `self.h` has type `HashMap<i32, i32>`, which does not implement the `Copy` trait
28    |
29 help: consider iterating over a slice of the `HashMap<i32, i32>`'s content to avoid moving into the `for` loop
30    |
31 LL |         for _ in &self.h {
32    |                  +
33
34 error[E0507]: cannot move out of a shared reference
35   --> $DIR/for-i-in-vec.rs:21:19
36    |
37 LL |     for loader in *LOADERS {
38    |                   ^^^^^^^^
39    |                   |
40    |                   value moved due to this implicit call to `.into_iter()`
41    |                   move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait
42    |
43 note: this function takes ownership of the receiver `self`, which moves value
44   --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
45    |
46 LL |     fn into_iter(self) -> Self::IntoIter;
47    |                  ^^^^
48 help: consider iterating over a slice of the `Vec<&u8>`'s content to avoid moving into the `for` loop
49    |
50 LL |     for loader in &*LOADERS {
51    |                   +
52
53 error: aborting due to 3 previous errors
54
55 For more information about this error, try `rustc --explain E0507`.