-
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.
Fix error recovery in format macro parsing
- Loading branch information
1 parent
497ee32
commit a8421ca
Showing
4 changed files
with
94 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Regression test for the ICE described in #88770. | ||
|
||
// error-pattern:this file contains an unclosed delimiter | ||
// error-pattern:expected one of | ||
// error-pattern:missing `in` in `for` loop | ||
// error-pattern:expected `;`, found `e` | ||
|
||
fn m(){print!("",(c for&g | ||
u | ||
e | ||
e |
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,66 @@ | ||
error: this file contains an unclosed delimiter | ||
--> $DIR/issue-88770.rs:11:3 | ||
| | ||
LL | fn m(){print!("",(c for&g | ||
| - - - unclosed delimiter | ||
| | | | ||
| | unclosed delimiter | ||
| unclosed delimiter | ||
... | ||
LL | e | ||
| ^ | ||
|
||
error: this file contains an unclosed delimiter | ||
--> $DIR/issue-88770.rs:11:3 | ||
| | ||
LL | fn m(){print!("",(c for&g | ||
| - - - unclosed delimiter | ||
| | | | ||
| | unclosed delimiter | ||
| unclosed delimiter | ||
... | ||
LL | e | ||
| ^ | ||
|
||
error: this file contains an unclosed delimiter | ||
--> $DIR/issue-88770.rs:11:3 | ||
| | ||
LL | fn m(){print!("",(c for&g | ||
| - - - unclosed delimiter | ||
| | | | ||
| | unclosed delimiter | ||
| unclosed delimiter | ||
... | ||
LL | e | ||
| ^ | ||
|
||
error: missing `in` in `for` loop | ||
--> $DIR/issue-88770.rs:8:26 | ||
| | ||
LL | fn m(){print!("",(c for&g | ||
| __________________________^ | ||
LL | | u | ||
| |_ help: try adding `in` here | ||
|
||
error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found keyword `for` | ||
--> $DIR/issue-88770.rs:8:21 | ||
| | ||
LL | fn m(){print!("",(c for&g | ||
| ^^^ expected one of 8 possible tokens | ||
|
||
error: expected `;`, found `e` | ||
--> $DIR/issue-88770.rs:10:2 | ||
| | ||
LL | e | ||
| ^ help: add `;` here | ||
LL | e | ||
| - unexpected token | ||
|
||
error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, or an operator, found `)` | ||
--> $DIR/issue-88770.rs:11:3 | ||
| | ||
LL | e | ||
| ^ expected one of 7 possible tokens | ||
|
||
error: aborting due to 7 previous errors | ||
|