Skip to content

Commit 954b5a8

Browse files
committed
Rename parse_const_expr to parse_const_block
1 parent 500ddc5 commit 954b5a8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ impl<'a> Parser<'a> {
10631063
} else if self.eat_keyword(kw::Unsafe) {
10641064
self.parse_block_expr(None, lo, BlockCheckMode::Unsafe(ast::UserProvided), attrs)
10651065
} else if self.check_inline_const() {
1066-
self.parse_const_expr(lo.to(self.token.span))
1066+
self.parse_const_block(lo.to(self.token.span))
10671067
} else if self.is_do_catch_block() {
10681068
self.recover_do_catch(attrs)
10691069
} else if self.is_try_block() {

compiler/rustc_parse/src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ impl<'a> Parser<'a> {
864864
}
865865

866866
/// Parses inline const expressions.
867-
fn parse_const_expr(&mut self, span: Span) -> PResult<'a, P<Expr>> {
867+
fn parse_const_block(&mut self, span: Span) -> PResult<'a, P<Expr>> {
868868
self.sess.gated_spans.gate(sym::inline_const, span);
869869
self.eat_keyword(kw::Const);
870870
let blk = self.parse_block()?;

compiler/rustc_parse/src/parser/pat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ impl<'a> Parser<'a> {
315315
PatKind::Box(pat)
316316
} else if self.check_inline_const() {
317317
// Parse `const pat`
318-
PatKind::Lit(self.parse_const_expr(lo.to(self.token.span))?)
318+
PatKind::Lit(self.parse_const_block(lo.to(self.token.span))?)
319319
} else if self.can_be_ident_pat() {
320320
// Parse `ident @ pat`
321321
// This can give false positives and parse nullary enums,

0 commit comments

Comments
 (0)