summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/match-guards-partially-borrow.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/ui/nll/match-guards-partially-borrow.stderr
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/nll/match-guards-partially-borrow.stderr')
-rw-r--r--tests/ui/nll/match-guards-partially-borrow.stderr170
1 files changed, 170 insertions, 0 deletions
diff --git a/tests/ui/nll/match-guards-partially-borrow.stderr b/tests/ui/nll/match-guards-partially-borrow.stderr
new file mode 100644
index 000000000..60b8dee71
--- /dev/null
+++ b/tests/ui/nll/match-guards-partially-borrow.stderr
@@ -0,0 +1,170 @@
+error[E0510]: cannot assign `q` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:100:13
+ |
+LL | match q {
+ | - value is immutable in match guard
+...
+LL | q = true;
+ | ^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `q` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:111:13
+ |
+LL | match q {
+ | - value is immutable in match guard
+...
+LL | q = true;
+ | ^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `r` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:123:13
+ |
+LL | match r {
+ | - value is immutable in match guard
+...
+LL | r = true;
+ | ^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `r` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:135:13
+ |
+LL | match r {
+ | - value is immutable in match guard
+...
+LL | r = true;
+ | ^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `t` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:172:13
+ |
+LL | match t {
+ | - value is immutable in match guard
+...
+LL | t = true;
+ | ^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `t` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:183:13
+ |
+LL | match t {
+ | - value is immutable in match guard
+...
+LL | t = true;
+ | ^^^^^^^^ cannot assign
+
+error[E0510]: cannot mutably borrow `x.0` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:197:22
+ |
+LL | match x {
+ | - value is immutable in match guard
+...
+LL | Some(ref mut r) => *r = None,
+ | ^^^^^^^^^ cannot mutably borrow
+
+error[E0510]: cannot mutably borrow `x.0` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:213:22
+ |
+LL | match x {
+ | - value is immutable in match guard
+...
+LL | Some(ref mut r) => *r = None,
+ | ^^^^^^^^^ cannot mutably borrow
+
+error[E0506]: cannot assign to `t` because it is borrowed
+ --> $DIR/match-guards-partially-borrow.rs:225:13
+ |
+LL | s if {
+ | - borrow of `t` occurs here
+LL | t = !t;
+ | ^^^^^^ assignment to borrowed `t` occurs here
+LL | false
+LL | } => (), // What value should `s` have in the arm?
+ | - borrow later used here
+
+error[E0506]: cannot assign to `t` because it is borrowed
+ --> $DIR/match-guards-partially-borrow.rs:235:13
+ |
+LL | s if let Some(()) = {
+ | - borrow of `t` occurs here
+LL | t = !t;
+ | ^^^^^^ assignment to borrowed `t` occurs here
+LL | None
+LL | } => (), // What value should `s` have in the arm?
+ | - borrow later used here
+
+error[E0510]: cannot assign `y` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:246:13
+ |
+LL | match *y {
+ | -- value is immutable in match guard
+...
+LL | y = &true;
+ | ^^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `y` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:257:13
+ |
+LL | match *y {
+ | -- value is immutable in match guard
+...
+LL | y = &true;
+ | ^^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `z` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:268:13
+ |
+LL | match z {
+ | - value is immutable in match guard
+...
+LL | z = &true;
+ | ^^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `z` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:279:13
+ |
+LL | match z {
+ | - value is immutable in match guard
+...
+LL | z = &true;
+ | ^^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `a` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:291:13
+ |
+LL | match a {
+ | - value is immutable in match guard
+...
+LL | a = &true;
+ | ^^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `a` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:303:13
+ |
+LL | match a {
+ | - value is immutable in match guard
+...
+LL | a = &true;
+ | ^^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `b` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:314:13
+ |
+LL | match b {
+ | - value is immutable in match guard
+...
+LL | b = &true;
+ | ^^^^^^^^^ cannot assign
+
+error[E0510]: cannot assign `b` in match guard
+ --> $DIR/match-guards-partially-borrow.rs:325:13
+ |
+LL | match b {
+ | - value is immutable in match guard
+...
+LL | b = &true;
+ | ^^^^^^^^^ cannot assign
+
+error: aborting due to 18 previous errors
+
+Some errors have detailed explanations: E0506, E0510.
+For more information about an error, try `rustc --explain E0506`.