summaryrefslogtreecommitdiffstats
path: root/tests/ui/or-patterns/already-bound-name.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/or-patterns/already-bound-name.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/or-patterns/already-bound-name.stderr')
-rw-r--r--tests/ui/or-patterns/already-bound-name.stderr101
1 files changed, 101 insertions, 0 deletions
diff --git a/tests/ui/or-patterns/already-bound-name.stderr b/tests/ui/or-patterns/already-bound-name.stderr
new file mode 100644
index 000000000..368782c1e
--- /dev/null
+++ b/tests/ui/or-patterns/already-bound-name.stderr
@@ -0,0 +1,101 @@
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:9:13
+ |
+LL | let (a, a) = (0, 1); // Standard duplication without an or-pattern.
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:12:15
+ |
+LL | let (a, A(a, _) | B(a)) = (0, A(1, 2));
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:12:25
+ |
+LL | let (a, A(a, _) | B(a)) = (0, A(1, 2));
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:16:26
+ |
+LL | let (A(a, _) | B(a), a) = (A(0, 1), 2);
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:19:15
+ |
+LL | let (A(a, a) | B(a)) = A(0, 1);
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:22:22
+ |
+LL | let (B(a) | A(a, a)) = A(0, 1);
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:26:21
+ |
+LL | B(a) | A(a, a) => {} // Let's ensure `match` has no funny business.
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:30:37
+ |
+LL | let (B(A(a, _) | B(a)) | A(a, A(a, _) | B(a))) = B(B(1));
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:30:47
+ |
+LL | let (B(A(a, _) | B(a)) | A(a, A(a, _) | B(a))) = B(B(1));
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:35:37
+ |
+LL | let (B(_) | A(A(a, _) | B(a), A(a, _) | B(a))) = B(B(1));
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:35:47
+ |
+LL | let (B(_) | A(A(a, _) | B(a), A(a, _) | B(a))) = B(B(1));
+ | ^ used in a pattern more than once
+
+error[E0408]: variable `a` is not bound in all patterns
+ --> $DIR/already-bound-name.rs:35:10
+ |
+LL | let (B(_) | A(A(a, _) | B(a), A(a, _) | B(a))) = B(B(1));
+ | ^^^^ pattern doesn't bind `a` - variable not in all patterns
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:40:50
+ |
+LL | let (B(A(a, _) | B(a)) | A(A(a, _) | B(a), A(a, _) | B(a))) = B(B(1));
+ | ^ used in a pattern more than once
+
+error[E0416]: identifier `a` is bound more than once in the same pattern
+ --> $DIR/already-bound-name.rs:40:60
+ |
+LL | let (B(A(a, _) | B(a)) | A(A(a, _) | B(a), A(a, _) | B(a))) = B(B(1));
+ | ^ used in a pattern more than once
+
+error[E0308]: mismatched types
+ --> $DIR/already-bound-name.rs:30:32
+ |
+LL | let (B(A(a, _) | B(a)) | A(a, A(a, _) | B(a))) = B(B(1));
+ | - ^ ------- this expression has type `E<E<{integer}>>`
+ | | |
+ | | expected integer, found enum `E`
+ | first introduced with type `{integer}` here
+ |
+ = note: expected type `{integer}`
+ found enum `E<{integer}>`
+ = note: a binding must have the same type in all alternatives
+
+error: aborting due to 15 previous errors
+
+Some errors have detailed explanations: E0308, E0408, E0416.
+For more information about an error, try `rustc --explain E0308`.