Rollup merge of #91337 - FabianWolff:issue-91227-misspelled-macro, r=nagisa
Add a suggestion if `macro_rules` is misspelled Fixes #91227.
This commit is contained in:
commit
d26fc45e5b
4 changed files with 61 additions and 4 deletions
13
src/test/ui/parser/misspelled-macro-rules.fixed
Normal file
13
src/test/ui/parser/misspelled-macro-rules.fixed
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Regression test for issue #91227.
|
||||
|
||||
// run-rustfix
|
||||
|
||||
#![allow(unused_macros)]
|
||||
|
||||
macro_rules! thing {
|
||||
//~^ ERROR: expected one of
|
||||
//~| HELP: perhaps you meant to define a macro
|
||||
() => {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
13
src/test/ui/parser/misspelled-macro-rules.rs
Normal file
13
src/test/ui/parser/misspelled-macro-rules.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Regression test for issue #91227.
|
||||
|
||||
// run-rustfix
|
||||
|
||||
#![allow(unused_macros)]
|
||||
|
||||
marco_rules! thing {
|
||||
//~^ ERROR: expected one of
|
||||
//~| HELP: perhaps you meant to define a macro
|
||||
() => {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
10
src/test/ui/parser/misspelled-macro-rules.stderr
Normal file
10
src/test/ui/parser/misspelled-macro-rules.stderr
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
error: expected one of `(`, `[`, or `{`, found `thing`
|
||||
--> $DIR/misspelled-macro-rules.rs:7:14
|
||||
|
|
||||
LL | marco_rules! thing {
|
||||
| ----------- ^^^^^ expected one of `(`, `[`, or `{`
|
||||
| |
|
||||
| help: perhaps you meant to define a macro: `macro_rules`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue