diff options
| author | Ralf Jung <post@ralfj.de> | 2020-12-18 16:22:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-18 16:22:09 +0100 |
| commit | 926999513e7d3f2cf62421e7a50b2bdf8d5ced9e (patch) | |
| tree | 1c5b1caa910f9a02b1138734b72cd6b214740c89 /compiler/rustc_parse/src/parser | |
| parent | 5eb15267ae30b617d6fb2555d33e79eca78ad156 (diff) | |
| parent | d6f1787447e1132d929efbb5b772be232e336c23 (diff) | |
| download | rust-926999513e7d3f2cf62421e7a50b2bdf8d5ced9e.tar.gz rust-926999513e7d3f2cf62421e7a50b2bdf8d5ced9e.zip | |
Rollup merge of #80135 - camelid:const-macro-nt, r=petrochenkov
Don't allow `const` to begin a nonterminal Fixes #79908. 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 r? ``@petrochenkov``
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/nonterminal.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/nonterminal.rs b/compiler/rustc_parse/src/parser/nonterminal.rs index c007f96a798..76ad5acd530 100644 --- a/compiler/rustc_parse/src/parser/nonterminal.rs +++ b/compiler/rustc_parse/src/parser/nonterminal.rs @@ -27,6 +27,8 @@ impl<'a> Parser<'a> { token.can_begin_expr() // This exception is here for backwards compatibility. && !token.is_keyword(kw::Let) + // This exception is here for backwards compatibility. + && !token.is_keyword(kw::Const) } NonterminalKind::Ty => token.can_begin_type(), NonterminalKind::Ident => get_macro_ident(token).is_some(), |
