summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/or-patterns.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:25 +0000
commit5363f350887b1e5b5dd21a86f88c8af9d7fea6da (patch)
tree35ca005eb6e0e9a1ba3bb5dbc033209ad445dc17 /src/test/ui/borrowck/or-patterns.stderr
parentAdding debian version 1.66.0+dfsg1-1. (diff)
downloadrustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.tar.xz
rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/borrowck/or-patterns.stderr')
-rw-r--r--src/test/ui/borrowck/or-patterns.stderr16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/borrowck/or-patterns.stderr b/src/test/ui/borrowck/or-patterns.stderr
index dd5797c3f..9501798bb 100644
--- a/src/test/ui/borrowck/or-patterns.stderr
+++ b/src/test/ui/borrowck/or-patterns.stderr
@@ -8,6 +8,10 @@ LL | &x.0 .0;
| ^^^^^^^ value borrowed here after move
|
= note: move occurs because `x.0.0` has type `String`, which does not implement the `Copy` trait
+help: borrow this binding in the pattern to avoid moving the value
+ |
+LL | ((ref y, _) | (_, y),) => (),
+ | +++
error[E0382]: borrow of moved value: `x.0.1`
--> $DIR/or-patterns.rs:10:5
@@ -19,6 +23,10 @@ LL | &x.0 .1;
| ^^^^^^^ value borrowed here after move
|
= note: move occurs because `x.0.1` has type `String`, which does not implement the `Copy` trait
+help: borrow this binding in the pattern to avoid moving the value
+ |
+LL | ((y, _) | (_, ref y),) => (),
+ | +++
error[E0502]: cannot borrow `x.0.0` as mutable because it is also borrowed as immutable
--> $DIR/or-patterns.rs:18:5
@@ -77,6 +85,10 @@ LL | &x.0 .0;
| ^^^^^^^ value borrowed here after move
|
= note: move occurs because `x.0.0` has type `String`, which does not implement the `Copy` trait
+help: borrow this binding in the pattern to avoid moving the value
+ |
+LL | let ((ref y, _) | (_, y),) = x;
+ | +++
error[E0382]: borrow of moved value: `x.0.1`
--> $DIR/or-patterns.rs:40:5
@@ -88,6 +100,10 @@ LL | &x.0 .1;
| ^^^^^^^ value borrowed here after move
|
= note: move occurs because `x.0.1` has type `String`, which does not implement the `Copy` trait
+help: borrow this binding in the pattern to avoid moving the value
+ |
+LL | let ((y, _) | (_, ref y),) = x;
+ | +++
error[E0502]: cannot borrow `x.0.0` as mutable because it is also borrowed as immutable
--> $DIR/or-patterns.rs:46:5