-
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.
Rollup merge of #118317 - bvanjoi:fix-118295, r=petrochenkov
tip for define macro name after `macro_rules!` Fixes #118295 ~Note that there are some bad case such as `macro_rules![]` or `macro_rules!()`. However, I think these are acceptable as they are likely to be seldom used (feel free to close this if you think its shortcomings outweigh its benefits)~ Edit: this problem was resolved by utilizing the `source_map.span_to_next_source`. r? `@petrochenkov`
- Loading branch information
Showing
5 changed files
with
37 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
macro_rules! {} | ||
//~^ ERROR cannot find macro `macro_rules` in this scope | ||
//~| NOTE maybe you have forgotten to define a name for this `macro_rules!` | ||
|
||
fn main() {} |
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: cannot find macro `macro_rules` in this scope | ||
--> $DIR/issue-118295.rs:1:1 | ||
| | ||
LL | macro_rules! {} | ||
| ^^^^^^^^^^^ | ||
| | ||
note: maybe you have forgotten to define a name for this `macro_rules!` | ||
--> $DIR/issue-118295.rs:1:1 | ||
| | ||
LL | macro_rules! {} | ||
| ^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|