forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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#66264 - guanqun:fix-mbe-missing-close-delim…
…, r=estebank fix an ICE in macro's diagnostic message This has two small fixes: 1. for the left brace, we don't need `<space>{`, simply `{` is enough. 2. for the right brace, it tries to peel off one character even when the close delim is missing. Without this fix, it would crash in some cases. (as shown in the new test case) r? @estebank
- Loading branch information
Showing
4 changed files
with
50 additions
and
5 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,3 @@ | ||
// ignore-tidy-trailing-newlines | ||
// error-pattern: aborting due to 3 previous errors | ||
macro_rules! abc(ؼ |
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,31 @@ | ||
error: this file contains an un-closed delimiter | ||
--> $DIR/mbe_missing_right_paren.rs:3:19 | ||
| | ||
LL | macro_rules! abc(ؼ | ||
| - ^ | ||
| | | ||
| un-closed delimiter | ||
|
||
error: macros that expand to items must be delimited with braces or followed by a semicolon | ||
--> $DIR/mbe_missing_right_paren.rs:3:17 | ||
| | ||
LL | macro_rules! abc(ؼ | ||
| ^^ | ||
| | ||
help: change the delimiters to curly braces | ||
| | ||
LL | macro_rules! abc{ؼ} | ||
| ^ ^ | ||
help: add a semicolon | ||
| | ||
LL | macro_rules! abc(ؼ; | ||
| ^ | ||
|
||
error: unexpected end of macro invocation | ||
--> $DIR/mbe_missing_right_paren.rs:3:1 | ||
| | ||
LL | macro_rules! abc(ؼ | ||
| ^^^^^^^^^^^^^^^^^^ missing tokens in macro arguments | ||
|
||
error: aborting due to 3 previous errors | ||
|