From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/suggestions/for-i-in-vec.stderr | 55 +++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/test/ui/suggestions/for-i-in-vec.stderr (limited to 'src/test/ui/suggestions/for-i-in-vec.stderr') diff --git a/src/test/ui/suggestions/for-i-in-vec.stderr b/src/test/ui/suggestions/for-i-in-vec.stderr new file mode 100644 index 000000000..88be9e30a --- /dev/null +++ b/src/test/ui/suggestions/for-i-in-vec.stderr @@ -0,0 +1,55 @@ +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`, which does not implement the `Copy` trait + | +note: this function takes ownership of the receiver `self`, which moves `self.v` + --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL + | +LL | fn into_iter(self) -> Self::IntoIter; + | ^^^^ +help: consider iterating over a slice of the `Vec`'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`, which does not implement the `Copy` trait + | +help: consider iterating over a slice of the `HashMap`'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: this function takes ownership of the receiver `self`, which moves value + --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL + | +LL | fn into_iter(self) -> Self::IntoIter; + | ^^^^ +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`. -- cgit v1.2.3