diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2020-10-19 16:57:04 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2020-10-19 18:50:58 -0300 |
| commit | d641cb82c1e69f1a864b1b04c9bb1ae97686024d (patch) | |
| tree | 6de1eb13606e25bf8c98a534bfd9c2754fe303e1 /compiler/rustc_parse/src | |
| parent | 9dd0bb6fbc4d14bf5d6bc930b79a6989bbfca8f8 (diff) | |
| download | rust-d641cb82c1e69f1a864b1b04c9bb1ae97686024d.tar.gz rust-d641cb82c1e69f1a864b1b04c9bb1ae97686024d.zip | |
Allow NtBlock to parse on check inline const next token
Diffstat (limited to 'compiler/rustc_parse/src')
| -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 7970ad36456..5a3789d1aae 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 `+=`. |
