diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2023-11-06 21:00:13 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2023-11-29 18:47:31 +0000 |
| commit | 44fd3b4d4648c9ea2dfa052fe5d3dbb2dfb4f492 (patch) | |
| tree | 0959d6ed609e1c2ba652f7a25b4166e491bcf908 /tests/ui/parser | |
| parent | abe34e9ab14c0a194152b4f9acc3dcbb000f3e98 (diff) | |
| download | rust-44fd3b4d4648c9ea2dfa052fe5d3dbb2dfb4f492.tar.gz rust-44fd3b4d4648c9ea2dfa052fe5d3dbb2dfb4f492.zip | |
Make `parse_pat_ident` not recover bad name
Diffstat (limited to 'tests/ui/parser')
| -rw-r--r-- | tests/ui/parser/issues/issue-104088.stderr | 26 | ||||
| -rw-r--r-- | tests/ui/parser/mut-patterns.stderr | 40 | ||||
| -rw-r--r-- | tests/ui/parser/recover/recover-parens-around-match-arm-head.stderr | 45 |
3 files changed, 7 insertions, 104 deletions
diff --git a/tests/ui/parser/issues/issue-104088.stderr b/tests/ui/parser/issues/issue-104088.stderr index 8b751759d69..ff24b0057f6 100644 --- a/tests/ui/parser/issues/issue-104088.stderr +++ b/tests/ui/parser/issues/issue-104088.stderr @@ -22,30 +22,6 @@ help: identifiers cannot start with a number LL | let 23name = 123; | ^^ -error: expected identifier, found `2x` - --> $DIR/issue-104088.rs:12:9 - | -LL | let 2x: i32 = 123; - | ^^ expected identifier - | -help: identifiers cannot start with a number - --> $DIR/issue-104088.rs:12:9 - | -LL | let 2x: i32 = 123; - | ^ - -error: expected identifier, found `1x` - --> $DIR/issue-104088.rs:15:9 - | -LL | let 1x = 123; - | ^^ expected identifier - | -help: identifiers cannot start with a number - --> $DIR/issue-104088.rs:15:9 - | -LL | let 1x = 123; - | ^ - error[E0308]: mismatched types --> $DIR/issue-104088.rs:5:12 | @@ -54,6 +30,6 @@ LL | if let 2e1 = 123 { | | | expected integer, found floating-point number -error: aborting due to 5 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/parser/mut-patterns.stderr b/tests/ui/parser/mut-patterns.stderr index 66985c9f5e4..d91440d7859 100644 --- a/tests/ui/parser/mut-patterns.stderr +++ b/tests/ui/parser/mut-patterns.stderr @@ -72,43 +72,5 @@ help: escape `become` to use it as an identifier LL | let mut mut yield(r#become, await) = r#yield(0, 0); | ++ -error: expected identifier, found keyword `await` - --> $DIR/mut-patterns.rs:28:31 - | -LL | let mut mut yield(become, await) = r#yield(0, 0); - | ^^^^^ expected identifier, found keyword - | -help: escape `await` to use it as an identifier - | -LL | let mut mut yield(become, r#await) = r#yield(0, 0); - | ++ - -error: `mut` must be attached to each individual binding - --> $DIR/mut-patterns.rs:28:9 - | -LL | let mut mut yield(become, await) = r#yield(0, 0); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `mut` to each binding: `r#yield(mut r#become, mut r#await)` - | - = note: `mut` may be followed by `variable` and `variable @ pattern` - -error: `mut` must be attached to each individual binding - --> $DIR/mut-patterns.rs:37:9 - | -LL | let mut W(mut a, W(b, W(ref c, W(d, B { box f })))) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `mut` to each binding: `W(mut a, W(mut b, W(ref c, W(mut d, B { box mut f }))))` - | - = note: `mut` may be followed by `variable` and `variable @ pattern` - -error: expected identifier, found `x` - --> $DIR/mut-patterns.rs:44:21 - | -LL | let mut $p = 0; - | ^^ expected identifier -... -LL | foo!(x); - | ------- in this macro invocation - | - = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 13 previous errors +error: aborting due to 9 previous errors diff --git a/tests/ui/parser/recover/recover-parens-around-match-arm-head.stderr b/tests/ui/parser/recover/recover-parens-around-match-arm-head.stderr index 6542f440e4b..701e2cc41b6 100644 --- a/tests/ui/parser/recover/recover-parens-around-match-arm-head.stderr +++ b/tests/ui/parser/recover/recover-parens-around-match-arm-head.stderr @@ -1,49 +1,14 @@ -error: expected identifier, found keyword `if` - --> $DIR/recover-parens-around-match-arm-head.rs:4:12 - | -LL | (0 if true) => { - | ^^ expected identifier, found keyword - error: expected one of `)`, `,`, `...`, `..=`, `..`, or `|`, found keyword `if` --> $DIR/recover-parens-around-match-arm-head.rs:4:12 | LL | (0 if true) => { - | -^^ expected one of `)`, `,`, `...`, `..=`, `..`, or `|` - | | - | help: missing `,` - -error: expected one of `)`, `,`, `@`, or `|`, found keyword `true` - --> $DIR/recover-parens-around-match-arm-head.rs:4:15 - | -LL | (0 if true) => { - | -^^^^ expected one of `)`, `,`, `@`, or `|` - | | - | help: missing `,` + | ^^ expected one of `)`, `,`, `...`, `..=`, `..`, or `|` -error[E0308]: mismatched types - --> $DIR/recover-parens-around-match-arm-head.rs:4:9 +error: expected one of `.`, `=>`, `?`, or an operator, found `)` + --> $DIR/recover-parens-around-match-arm-head.rs:4:19 | -LL | let x = match val { - | --- this expression has type `{integer}` LL | (0 if true) => { - | ^^^^^^^^^^^ expected integer, found `(_, _, _)` - | - = note: expected type `{integer}` - found tuple `(_, _, _)` - -error[E0308]: mismatched types - --> $DIR/recover-parens-around-match-arm-head.rs:13:19 - | -LL | let _y: u32 = x; - | --- ^ expected `u32`, found `u8` - | | - | expected due to this - | -help: you can convert a `u8` to a `u32` - | -LL | let _y: u32 = x.into(); - | +++++++ + | ^ expected one of `.`, `=>`, `?`, or an operator -error: aborting due to 5 previous errors +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0308`. |
