-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better error cases with bad/missing identifiers in MBEs
- Loading branch information
1 parent
503e129
commit a51902a
Showing
11 changed files
with
88 additions
and
48 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Ensures MBEs with a missing ident produce a readable error | ||
|
||
macro_rules! { | ||
//~^ ERROR: expected identifier, found `{` | ||
//~| NOTE: expected identifier | ||
//~| NOTE: maybe you have forgotten to define a name for this `macro_rules!` | ||
() => {} | ||
} |
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,10 @@ | ||
error: expected identifier, found `{` | ||
--> $DIR/mbe-missing-ident-error.rs:3:14 | ||
| | ||
LL | macro_rules! { | ||
| ^ expected identifier | ||
| | ||
= note: maybe you have forgotten to define a name for this `macro_rules!` | ||
|
||
error: aborting due to 1 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Ensures MBEs with a invalid ident produce a readable error | ||
|
||
macro_rules! (meepmeep) { | ||
//~^ ERROR: expected identifier, found `(` | ||
//~| NOTE: expected identifier | ||
//~| NOTE: try removing the parenthesis around the name for this `macro_rules!` | ||
() => {} | ||
} |
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,14 @@ | ||
error: expected identifier, found `(` | ||
--> $DIR/mbe-parenthesis-ident-error.rs:3:14 | ||
| | ||
LL | macro_rules! (meepmeep) { | ||
| ^ expected identifier | ||
| | ||
note: try removing the parenthesis around the name for this `macro_rules!` | ||
--> $DIR/mbe-parenthesis-ident-error.rs:3:15 | ||
| | ||
LL | macro_rules! (meepmeep) { | ||
| ^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.