Skip to content

Commit

Permalink
Allow NtBlock to parse on check inline const next token
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Oct 19, 2020
1 parent 9dd0bb6 commit d641cb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_parse/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 `+=`.
Expand Down

0 comments on commit d641cb8

Please sign in to comment.