Add a suggestion if macro_rules is misspelled

This commit is contained in:
Fabian Wolff 2021-11-28 23:10:37 +01:00
parent 5fd3a5c7c1
commit b9b4f549a4
4 changed files with 61 additions and 4 deletions

View 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() {}

View 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() {}

View 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