Allow NtBlock to parse on check inline const next token

This commit is contained in:
Santiago Pastorino 2020-10-19 16:57:04 -03:00
parent 9dd0bb6fbc
commit d641cb82c1
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF

View file

@ -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 `+=`.