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#89257 - aDotInTheVoid:macro-error-2, r=este…
…bank Give better error for `macro_rules name` follow up to rust-lang#89221 r? ``@estebank`` ``@rustbot`` modify labels: +A-diagnostics +A-parser
- Loading branch information
Showing
4 changed files
with
92 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// run-rustfix | ||
|
||
#![allow(unused_macros)] | ||
|
||
macro_rules! foo { | ||
//~^ ERROR expected `!` after `macro_rules` | ||
() => {}; | ||
} | ||
|
||
macro_rules! bar { | ||
//~^ ERROR expected `!` after `macro_rules` | ||
//~^^ ERROR macro names aren't followed by a `!` | ||
() => {}; | ||
} | ||
|
||
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,16 @@ | ||
// run-rustfix | ||
|
||
#![allow(unused_macros)] | ||
|
||
macro_rules foo { | ||
//~^ ERROR expected `!` after `macro_rules` | ||
() => {}; | ||
} | ||
|
||
macro_rules bar! { | ||
//~^ ERROR expected `!` after `macro_rules` | ||
//~^^ ERROR macro names aren't followed by a `!` | ||
() => {}; | ||
} | ||
|
||
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,20 @@ | ||
error: expected `!` after `macro_rules` | ||
--> $DIR/missing-bang-in-decl.rs:5:1 | ||
| | ||
LL | macro_rules foo { | ||
| ^^^^^^^^^^^ help: add a `!`: `macro_rules!` | ||
|
||
error: expected `!` after `macro_rules` | ||
--> $DIR/missing-bang-in-decl.rs:10:1 | ||
| | ||
LL | macro_rules bar! { | ||
| ^^^^^^^^^^^ help: add a `!`: `macro_rules!` | ||
|
||
error: macro names aren't followed by a `!` | ||
--> $DIR/missing-bang-in-decl.rs:10:16 | ||
| | ||
LL | macro_rules bar! { | ||
| ^ help: remove the `!` | ||
|
||
error: aborting due to 3 previous errors | ||
|