diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/nll/cannot-move-block-spans.stderr | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/nll/cannot-move-block-spans.stderr')
-rw-r--r-- | src/test/ui/nll/cannot-move-block-spans.stderr | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/test/ui/nll/cannot-move-block-spans.stderr b/src/test/ui/nll/cannot-move-block-spans.stderr new file mode 100644 index 000000000..56a5cdff0 --- /dev/null +++ b/src/test/ui/nll/cannot-move-block-spans.stderr @@ -0,0 +1,88 @@ +error[E0507]: cannot move out of `*r` which is behind a shared reference + --> $DIR/cannot-move-block-spans.rs:5:15 + | +LL | let x = { *r }; + | ^^ + | | + | move occurs because `*r` has type `String`, which does not implement the `Copy` trait + | help: consider borrowing here: `&*r` + +error[E0507]: cannot move out of `*r` which is behind a shared reference + --> $DIR/cannot-move-block-spans.rs:6:22 + | +LL | let y = unsafe { *r }; + | ^^ + | | + | move occurs because `*r` has type `String`, which does not implement the `Copy` trait + | help: consider borrowing here: `&*r` + +error[E0507]: cannot move out of `*r` which is behind a shared reference + --> $DIR/cannot-move-block-spans.rs:7:26 + | +LL | let z = loop { break *r; }; + | ^^ + | | + | move occurs because `*r` has type `String`, which does not implement the `Copy` trait + | help: consider borrowing here: `&*r` + +error[E0508]: cannot move out of type `[String; 2]`, a non-copy array + --> $DIR/cannot-move-block-spans.rs:11:15 + | +LL | let x = { arr[0] }; + | ^^^^^^ + | | + | cannot move out of here + | move occurs because `arr[_]` has type `String`, which does not implement the `Copy` trait + | help: consider borrowing here: `&arr[0]` + +error[E0508]: cannot move out of type `[String; 2]`, a non-copy array + --> $DIR/cannot-move-block-spans.rs:12:22 + | +LL | let y = unsafe { arr[0] }; + | ^^^^^^ + | | + | cannot move out of here + | move occurs because `arr[_]` has type `String`, which does not implement the `Copy` trait + | help: consider borrowing here: `&arr[0]` + +error[E0508]: cannot move out of type `[String; 2]`, a non-copy array + --> $DIR/cannot-move-block-spans.rs:13:26 + | +LL | let z = loop { break arr[0]; }; + | ^^^^^^ + | | + | cannot move out of here + | move occurs because `arr[_]` has type `String`, which does not implement the `Copy` trait + | help: consider borrowing here: `&arr[0]` + +error[E0507]: cannot move out of `*r` which is behind a shared reference + --> $DIR/cannot-move-block-spans.rs:17:38 + | +LL | let x = { let mut u = 0; u += 1; *r }; + | ^^ + | | + | move occurs because `*r` has type `String`, which does not implement the `Copy` trait + | help: consider borrowing here: `&*r` + +error[E0507]: cannot move out of `*r` which is behind a shared reference + --> $DIR/cannot-move-block-spans.rs:18:45 + | +LL | let y = unsafe { let mut u = 0; u += 1; *r }; + | ^^ + | | + | move occurs because `*r` has type `String`, which does not implement the `Copy` trait + | help: consider borrowing here: `&*r` + +error[E0507]: cannot move out of `*r` which is behind a shared reference + --> $DIR/cannot-move-block-spans.rs:19:49 + | +LL | let z = loop { let mut u = 0; u += 1; break *r; u += 2; }; + | ^^ + | | + | move occurs because `*r` has type `String`, which does not implement the `Copy` trait + | help: consider borrowing here: `&*r` + +error: aborting due to 9 previous errors + +Some errors have detailed explanations: E0507, E0508. +For more information about an error, try `rustc --explain E0507`. |