mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 15:56:09 +03:00
Account for better recovery in two cases.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user