diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-10-21 13:59:44 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-21 13:59:44 +0900 |
| commit | de24210ebf40b5700908d0a6613f82afe1995b52 (patch) | |
| tree | 7b4db815ca111d129ecda5f620695fff51563a2e /compiler/rustc_parse/src/parser | |
| parent | 83f126bedf227103463f6f505398d72d4efedd42 (diff) | |
| parent | dcd2d91a647c101c7226e594ecae23bc5fb3bb69 (diff) | |
| download | rust-de24210ebf40b5700908d0a6613f82afe1995b52.tar.gz rust-de24210ebf40b5700908d0a6613f82afe1995b52.zip | |
Rollup merge of #78118 - spastorino:inline-const-followups, r=petrochenkov
Inline const followups r? @petrochenkov Follow ups of #77124
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 1860f1238c4..5176db82d3b 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -548,7 +548,11 @@ impl<'a> Parser<'a> { fn check_inline_const(&mut self) -> bool { self.check_keyword(kw::Const) - && self.look_ahead(1, |t| t == &token::OpenDelim(DelimToken::Brace)) + && self.look_ahead(1, |t| match t.kind { + token::Interpolated(ref nt) => matches!(**nt, token::NtBlock(..)), + token::OpenDelim(DelimToken::Brace) => true, + _ => false, + }) } /// Checks to see if the next token is either `+` or `+=`. |
