diff --git a/src/test/ui/parser/pat-lt-bracket-6.rs b/src/test/ui/parser/pat-lt-bracket-6.rs index 9bad0cb25c1e..69c4bfb23c2f 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 2ee4bdb20fe8..d526addeb796 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 36c0d7733733..1060d705e6e3 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 5552ea46d9b9..3e4bff7cbd75 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`.