]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_parse/src/parser/mod.rs
Rollup merge of #78118 - spastorino:inline-const-followups, r=petrochenkov
[rust.git] / compiler / rustc_parse / src / parser / mod.rs
index 1860f1238c4b5ab3206bf087edca2626f5d139b4..5176db82d3b410cf26827f85a1ab24aaa28ebc2d 100644 (file)
@@ -548,7 +548,11 @@ fn check_const_arg(&mut self) -> bool {
 
     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 `+=`.