about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/ui/parser/pat-lt-bracket-6.rs3
-rw-r--r--src/test/ui/parser/pat-lt-bracket-6.stderr25
-rw-r--r--src/test/ui/parser/pat-lt-bracket-7.rs2
-rw-r--r--src/test/ui/parser/pat-lt-bracket-7.stderr15
4 files changed, 43 insertions, 2 deletions
diff --git a/src/test/ui/parser/pat-lt-bracket-6.rs b/src/test/ui/parser/pat-lt-bracket-6.rs
index 9bad0cb25c1..69c4bfb23c2 100644
--- a/src/test/ui/parser/pat-lt-bracket-6.rs
+++ b/src/test/ui/parser/pat-lt-bracket-6.rs
@@ -1,3 +1,6 @@
 fn main() {
     let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
+    //~^ ERROR cannot find value `x` in this scope
+    //~| ERROR cannot find tuple struct/variant `Test` in this scope
+    //~| ERROR subslice patterns are unstable
 }
diff --git a/src/test/ui/parser/pat-lt-bracket-6.stderr b/src/test/ui/parser/pat-lt-bracket-6.stderr
index 2ee4bdb20fe..d526addeb79 100644
--- a/src/test/ui/parser/pat-lt-bracket-6.stderr
+++ b/src/test/ui/parser/pat-lt-bracket-6.stderr
@@ -4,5 +4,28 @@ error: expected one of `)`, `,`, or `@`, found `[`
 LL |     let Test(&desc[..]) = x;
    |                   ^ expected one of `)`, `,`, or `@` here
 
-error: aborting due to previous error
+error[E0425]: cannot find value `x` in this scope
+  --> $DIR/pat-lt-bracket-6.rs:2:27
+   |
+LL |     let Test(&desc[..]) = x;
+   |                           ^ not found in this scope
+
+error[E0531]: cannot find tuple struct/variant `Test` in this scope
+  --> $DIR/pat-lt-bracket-6.rs:2:9
+   |
+LL |     let Test(&desc[..]) = x;
+   |         ^^^^ not found in this scope
+
+error[E0658]: subslice patterns are unstable
+  --> $DIR/pat-lt-bracket-6.rs:2:20
+   |
+LL |     let Test(&desc[..]) = x;
+   |                    ^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/62254
+   = help: add #![feature(slice_patterns)] to the crate attributes to enable
+
+error: aborting due to 4 previous errors
 
+Some errors have detailed explanations: E0425, E0658.
+For more information about an error, try `rustc --explain E0425`.
diff --git a/src/test/ui/parser/pat-lt-bracket-7.rs b/src/test/ui/parser/pat-lt-bracket-7.rs
index 36c0d773373..1060d705e6e 100644
--- a/src/test/ui/parser/pat-lt-bracket-7.rs
+++ b/src/test/ui/parser/pat-lt-bracket-7.rs
@@ -1,3 +1,5 @@
 fn main() {
     for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
+    //~^ ERROR cannot find value `foo` in this scope
+    //~| ERROR cannot find tuple struct/variant `thing` in this scope
 }
diff --git a/src/test/ui/parser/pat-lt-bracket-7.stderr b/src/test/ui/parser/pat-lt-bracket-7.stderr
index 5552ea46d9b..3e4bff7cbd7 100644
--- a/src/test/ui/parser/pat-lt-bracket-7.stderr
+++ b/src/test/ui/parser/pat-lt-bracket-7.stderr
@@ -4,5 +4,18 @@ error: expected one of `)`, `,`, or `@`, found `[`
 LL |     for thing(x[]) in foo {}
    |                ^ expected one of `)`, `,`, or `@` here
 
-error: aborting due to previous error
+error[E0425]: cannot find value `foo` in this scope
+  --> $DIR/pat-lt-bracket-7.rs:2:23
+   |
+LL |     for thing(x[]) in foo {}
+   |                       ^^^ not found in this scope
+
+error[E0531]: cannot find tuple struct/variant `thing` in this scope
+  --> $DIR/pat-lt-bracket-7.rs:2:9
+   |
+LL |     for thing(x[]) in foo {}
+   |         ^^^^^ not found in this scope
+
+error: aborting due to 3 previous errors
 
+For more information about this error, try `rustc --explain E0425`.