parser: Do not call bump recursively
Token normalization is merged directly into `bump`. Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
macro_rules! e {
|
||||
($inp:ident) => (
|
||||
$nonexistent
|
||||
//~^ ERROR unknown macro variable `nonexistent`
|
||||
//~^ ERROR expected expression, found `$`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
error: unknown macro variable `nonexistent`
|
||||
error: expected expression, found `$`
|
||||
--> $DIR/issue-6596-1.rs:3:9
|
||||
|
|
||||
LL | $nonexistent
|
||||
| ^^^^^^^^^^^^ unknown macro variable
|
||||
| ^^^^^^^^^^^^ expected expression
|
||||
...
|
||||
LL | e!(foo);
|
||||
| -------- in this macro invocation
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
macro_rules! g {
|
||||
($inp:ident) => (
|
||||
{ $inp $nonexistent }
|
||||
//~^ ERROR unknown macro variable `nonexistent`
|
||||
//~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `$`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
error: unknown macro variable `nonexistent`
|
||||
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `$`
|
||||
--> $DIR/issue-6596-2.rs:5:16
|
||||
|
|
||||
LL | { $inp $nonexistent }
|
||||
| ^^^^^^^^^^^^ unknown macro variable
|
||||
| ^^^^^^^^^^^^ expected one of 8 possible tokens
|
||||
...
|
||||
LL | g!(foo);
|
||||
| -------- in this macro invocation
|
||||
|
||||
Reference in New Issue
Block a user