diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2020-10-20 19:14:17 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2020-10-22 13:21:18 -0300 |
| commit | 954b5a81b46f60df640f36cfc83f04cd2a965051 (patch) | |
| tree | 88e13d0128ffe41695384a10f67e71ee2e06738f /compiler/rustc_parse/src/parser | |
| parent | 500ddc5efda9d4b0c8f90b654d220ffc9e24ecb5 (diff) | |
| download | rust-954b5a81b46f60df640f36cfc83f04cd2a965051.tar.gz rust-954b5a81b46f60df640f36cfc83f04cd2a965051.zip | |
Rename parse_const_expr to parse_const_block
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/pat.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 698a7e7d9cd..51ecc53ca26 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1063,7 +1063,7 @@ impl<'a> Parser<'a> { } else if self.eat_keyword(kw::Unsafe) { self.parse_block_expr(None, lo, BlockCheckMode::Unsafe(ast::UserProvided), attrs) } else if self.check_inline_const() { - self.parse_const_expr(lo.to(self.token.span)) + self.parse_const_block(lo.to(self.token.span)) } else if self.is_do_catch_block() { self.recover_do_catch(attrs) } else if self.is_try_block() { diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index fb825256d92..4999498e4f7 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -864,7 +864,7 @@ impl<'a> Parser<'a> { } /// Parses inline const expressions. - fn parse_const_expr(&mut self, span: Span) -> PResult<'a, P<Expr>> { + fn parse_const_block(&mut self, span: Span) -> PResult<'a, P<Expr>> { self.sess.gated_spans.gate(sym::inline_const, span); self.eat_keyword(kw::Const); let blk = self.parse_block()?; diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs index 15db2066a30..356743f2071 100644 --- a/compiler/rustc_parse/src/parser/pat.rs +++ b/compiler/rustc_parse/src/parser/pat.rs @@ -315,7 +315,7 @@ impl<'a> Parser<'a> { PatKind::Box(pat) } else if self.check_inline_const() { // Parse `const pat` - PatKind::Lit(self.parse_const_expr(lo.to(self.token.span))?) + PatKind::Lit(self.parse_const_block(lo.to(self.token.span))?) } else if self.can_be_ident_pat() { // Parse `ident @ pat` // This can give false positives and parse nullary enums, |
