]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/for-i-in-vec.stderr
Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt
[rust.git] / tests / 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: `into_iter` takes ownership of the receiver `self`, which moves `self.v`
11   --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
12 help: consider iterating over a slice of the `Vec<u32>`'s content to avoid moving into the `for` loop
13    |
14 LL |         for _ in &self.v {
15    |                  +
16
17 error[E0507]: cannot move out of `self.h` which is behind a shared reference
18   --> $DIR/for-i-in-vec.rs:13:18
19    |
20 LL |         for _ in self.h {
21    |                  ^^^^^^
22    |                  |
23    |                  `self.h` moved due to this implicit call to `.into_iter()`
24    |                  move occurs because `self.h` has type `HashMap<i32, i32>`, which does not implement the `Copy` trait
25    |
26 help: consider iterating over a slice of the `HashMap<i32, i32>`'s content to avoid moving into the `for` loop
27    |
28 LL |         for _ in &self.h {
29    |                  +
30
31 error[E0507]: cannot move out of a shared reference
32   --> $DIR/for-i-in-vec.rs:21:19
33    |
34 LL |     for loader in *LOADERS {
35    |                   ^^^^^^^^
36    |                   |
37    |                   value moved due to this implicit call to `.into_iter()`
38    |                   move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait
39    |
40 note: `into_iter` takes ownership of the receiver `self`, which moves value
41   --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
42 help: consider iterating over a slice of the `Vec<&u8>`'s content to avoid moving into the `for` loop
43    |
44 LL |     for loader in &*LOADERS {
45    |                   +
46
47 error: aborting due to 3 previous errors
48
49 For more information about this error, try `rustc --explain E0507`.