forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't allow
const
to begin a nonterminal
Thanks to Vadim Petrochenkov who [told me what the fix was][z]! [z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422
- Loading branch information
1 parent
cebeda3
commit acc2154
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// check-pass | ||
|
||
macro_rules! exp { | ||
(const $n:expr) => { | ||
$n | ||
}; | ||
} | ||
|
||
macro_rules! stmt { | ||
(exp $e:expr) => { | ||
$e | ||
}; | ||
(exp $($t:tt)+) => { | ||
exp!($($t)+) | ||
}; | ||
} | ||
|
||
fn main() { | ||
stmt!(exp const 1); | ||
} |