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:
Matthias Krüger 2021-12-08 23:18:04 +01:00 committed by GitHub
commit d26fc45e5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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