forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#63945 - Centril:recover-mut-pat, r=estebank
Recover `mut $pat` and other improvements - Recover on e.g. `mut Foo(x, y)` and suggest `Foo(mut x, mut y)`. Fixes rust-lang#63764. - Recover on e.g. `let mut mut x;` - Recover on e.g. `let keyword` and `let keyword(...)`. - Cleanups in `token.rs` with `fn is_non_raw_ident_where` and friends.
- Loading branch information
Showing
75 changed files
with
546 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fn main() { | ||
let extern = 0; //~ ERROR expected pattern, found keyword `extern` | ||
let extern = 0; //~ ERROR expected identifier, found keyword `extern` | ||
} |
8 changes: 6 additions & 2 deletions
8
src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
error: expected pattern, found keyword `extern` | ||
error: expected identifier, found keyword `extern` | ||
--> $DIR/keyword-extern-as-identifier-pat.rs:2:9 | ||
| | ||
LL | let extern = 0; | ||
| ^^^^^^ expected pattern | ||
| ^^^^^^ expected identifier, found keyword | ||
help: you can escape reserved keywords to use them as identifiers | ||
| | ||
LL | let r#extern = 0; | ||
| ^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
error: expected identifier, found reserved identifier `_` | ||
--> $DIR/issue-32501.rs:7:13 | ||
error: `mut` must be followed by a named binding | ||
--> $DIR/issue-32501.rs:7:9 | ||
| | ||
LL | let mut _ = 0; | ||
| ^ expected identifier, found reserved identifier | ||
| ^^^^^ help: remove the `mut` prefix: `_` | ||
| | ||
= note: `mut` may be followed by `variable` and `variable @ pattern` | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fn main() { | ||
let abstract = (); //~ ERROR expected pattern, found reserved keyword `abstract` | ||
let abstract = (); //~ ERROR expected identifier, found reserved keyword `abstract` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
error: expected pattern, found reserved keyword `abstract` | ||
error: expected identifier, found reserved keyword `abstract` | ||
--> $DIR/keyword-abstract.rs:2:9 | ||
| | ||
LL | let abstract = (); | ||
| ^^^^^^^^ expected pattern | ||
| ^^^^^^^^ expected identifier, found reserved keyword | ||
help: you can escape reserved keywords to use them as identifiers | ||
| | ||
LL | let r#abstract = (); | ||
| ^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
Oops, something went wrong.