fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.0 KiB49 linesraw
1error[E0507]: cannot move out of `self.v` which is behind a shared reference
2  --> $DIR/for-i-in-vec.rs:11:18
3   |
4LL |         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   |
10note: `into_iter` takes ownership of the receiver `self`, which moves `self.v`
11  --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
12help: consider iterating over a slice of the `Vec<u32>`'s content to avoid moving into the `for` loop
13   |
14LL |         for _ in &self.v {
15   |                  +
16
17error[E0507]: cannot move out of `self.h` which is behind a shared reference
18  --> $DIR/for-i-in-vec.rs:13:18
19   |
20LL |         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   |
26help: consider iterating over a slice of the `HashMap<i32, i32>`'s content to avoid moving into the `for` loop
27   |
28LL |         for _ in &self.h {
29   |                  +
30
31error[E0507]: cannot move out of a shared reference
32  --> $DIR/for-i-in-vec.rs:21:19
33   |
34LL |     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   |
40note: `into_iter` takes ownership of the receiver `self`, which moves value
41  --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
42help: consider iterating over a slice of the `Vec<&u8>`'s content to avoid moving into the `for` loop
43   |
44LL |     for loader in &*LOADERS {
45   |                   +
46
47error: aborting due to 3 previous errors
48
49For more information about this error, try `rustc --explain E0507`.