We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
check_inline_const
1 parent 24fa10f commit 4315b85Copy full SHA for 4315b85
compiler/rustc_parse/src/parser/mod.rs
@@ -552,6 +552,15 @@ impl<'a> Parser<'a> {
552
self.check_or_expected(self.token.can_begin_const_arg(), TokenType::Const)
553
}
554
555
+ fn check_inline_const(&self, dist: usize) -> bool {
556
+ self.is_keyword_ahead(dist, &[kw::Const])
557
+ && self.look_ahead(dist + 1, |t| match t.kind {
558
+ token::Interpolated(ref nt) => matches!(**nt, token::NtBlock(..)),
559
+ token::OpenDelim(DelimToken::Brace) => true,
560
+ _ => false,
561
+ })
562
+ }
563
+
564
/// Checks to see if the next token is either `+` or `+=`.
565
/// Otherwise returns `false`.
566
fn check_plus(&mut self) -> bool {
0 commit comments