-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #101293 - compiler-errors:lt-is-actually-char, r=este…
…bank Recover when unclosed char literal is parsed as a lifetime in some positions Fixes #101278
- Loading branch information
Showing
11 changed files
with
209 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ fn foo() { | |
let x = 1; | ||
bar('y, x); | ||
//~^ ERROR expected | ||
//~| ERROR mismatched types | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
fn main() { | ||
let c = 'a; | ||
//~^ ERROR expected `while`, `for`, `loop` or `{` after a label | ||
//~| HELP add `'` to close the char literal | ||
match c { | ||
'a'..='b => {} | ||
//~^ ERROR unexpected token: `'b` | ||
//~| HELP add `'` to close the char literal | ||
_ => {} | ||
} | ||
let x = ['a, 'b]; | ||
//~^ ERROR expected `while`, `for`, `loop` or `{` after a label | ||
//~| ERROR expected `while`, `for`, `loop` or `{` after a label | ||
//~| HELP add `'` to close the char literal | ||
//~| HELP add `'` to close the char literal | ||
} |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
error: expected `while`, `for`, `loop` or `{` after a label | ||
--> $DIR/label-is-actually-char.rs:2:15 | ||
| | ||
LL | let c = 'a; | ||
| ^ expected `while`, `for`, `loop` or `{` after a label | ||
| | ||
help: add `'` to close the char literal | ||
| | ||
LL | let c = 'a'; | ||
| + | ||
|
||
error: unexpected token: `'b` | ||
--> $DIR/label-is-actually-char.rs:6:15 | ||
| | ||
LL | 'a'..='b => {} | ||
| ^^ | ||
| | ||
help: add `'` to close the char literal | ||
| | ||
LL | 'a'..='b' => {} | ||
| + | ||
|
||
error: expected `while`, `for`, `loop` or `{` after a label | ||
--> $DIR/label-is-actually-char.rs:11:16 | ||
| | ||
LL | let x = ['a, 'b]; | ||
| ^ expected `while`, `for`, `loop` or `{` after a label | ||
| | ||
help: add `'` to close the char literal | ||
| | ||
LL | let x = ['a', 'b]; | ||
| + | ||
|
||
error: expected `while`, `for`, `loop` or `{` after a label | ||
--> $DIR/label-is-actually-char.rs:11:20 | ||
| | ||
LL | let x = ['a, 'b]; | ||
| ^ expected `while`, `for`, `loop` or `{` after a label | ||
| | ||
help: add `'` to close the char literal | ||
| | ||
LL | let x = ['a, 'b']; | ||
| + | ||
|
||
error: aborting due to 4 previous errors | ||
|
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