Closed
Description
Consider the following snippet:
marco_rules! thing {
() => {}
}
It might look completely fine at first, but then rustc spits out this error message:
error: expected one of `(`, `[`, or `{`, found `thing`
--> src/lib.rs:1:14
|
1 | marco_rules! thing {
| ^^^^^ expected one of `(`, `[`, or `{`
The actual problem is that macro_rules
is misspelled as ma*rc*o_rules
. It took me a while to see the problem myself when I encountered it.
Could there possibly be a lint that checks for this case and gives a proper error message? The current one is extra misleading since it even points away from the actual source of the error.