summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/for-i-in-vec.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/suggestions/for-i-in-vec.stderr
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/suggestions/for-i-in-vec.stderr')
-rw-r--r--tests/ui/suggestions/for-i-in-vec.stderr49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/ui/suggestions/for-i-in-vec.stderr b/tests/ui/suggestions/for-i-in-vec.stderr
new file mode 100644
index 000000000..c5b81e6b8
--- /dev/null
+++ b/tests/ui/suggestions/for-i-in-vec.stderr
@@ -0,0 +1,49 @@
+error[E0507]: cannot move out of `self.v` which is behind a shared reference
+ --> $DIR/for-i-in-vec.rs:11:18
+ |
+LL | for _ in self.v {
+ | ^^^^^^
+ | |
+ | `self.v` moved due to this implicit call to `.into_iter()`
+ | move occurs because `self.v` has type `Vec<u32>`, which does not implement the `Copy` trait
+ |
+note: `into_iter` takes ownership of the receiver `self`, which moves `self.v`
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+help: consider iterating over a slice of the `Vec<u32>`'s content to avoid moving into the `for` loop
+ |
+LL | for _ in &self.v {
+ | +
+
+error[E0507]: cannot move out of `self.h` which is behind a shared reference
+ --> $DIR/for-i-in-vec.rs:13:18
+ |
+LL | for _ in self.h {
+ | ^^^^^^
+ | |
+ | `self.h` moved due to this implicit call to `.into_iter()`
+ | move occurs because `self.h` has type `HashMap<i32, i32>`, which does not implement the `Copy` trait
+ |
+help: consider iterating over a slice of the `HashMap<i32, i32>`'s content to avoid moving into the `for` loop
+ |
+LL | for _ in &self.h {
+ | +
+
+error[E0507]: cannot move out of a shared reference
+ --> $DIR/for-i-in-vec.rs:21:19
+ |
+LL | for loader in *LOADERS {
+ | ^^^^^^^^
+ | |
+ | value moved due to this implicit call to `.into_iter()`
+ | move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait
+ |
+note: `into_iter` takes ownership of the receiver `self`, which moves value
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+help: consider iterating over a slice of the `Vec<&u8>`'s content to avoid moving into the `for` loop
+ |
+LL | for loader in &*LOADERS {
+ | +
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0507`.