Skip to content

Commit d641cb8

Browse files
committed
Allow NtBlock to parse on check inline const next token
1 parent 9dd0bb6 commit d641cb8

File tree

1 file changed

+5
-1
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+5
-1
lines changed

compiler/rustc_parse/src/parser/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,11 @@ impl<'a> Parser<'a> {
548548

549549
fn check_inline_const(&mut self) -> bool {
550550
self.check_keyword(kw::Const)
551-
&& self.look_ahead(1, |t| t == &token::OpenDelim(DelimToken::Brace))
551+
&& self.look_ahead(1, |t| match t.kind {
552+
token::Interpolated(ref nt) => matches!(**nt, token::NtBlock(..)),
553+
token::OpenDelim(DelimToken::Brace) => true,
554+
_ => false,
555+
})
552556
}
553557

554558
/// Checks to see if the next token is either `+` or `+=`.

0 commit comments

Comments
 (0)