1
Fork 0

Rollup merge of #78118 - spastorino:inline-const-followups, r=petrochenkov

Inline const followups

r? @petrochenkov

Follow ups of #77124
This commit is contained in:
Yuki Okushi 2020-10-21 13:59:44 +09:00 committed by GitHub
commit de24210ebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 3 deletions

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