diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2020-09-23 18:34:44 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2020-10-16 15:15:34 -0300 |
| commit | 59d07c3ae5a1f53924c7580fa302c397c362f1a2 (patch) | |
| tree | 2fd317439ffb2b8dd16d45a2c472d9fe3e655d8d /compiler/rustc_parse/src/parser | |
| parent | c3e8d7965ccef7fe47db591ae0064af0034e3f25 (diff) | |
| download | rust-59d07c3ae5a1f53924c7580fa302c397c362f1a2.tar.gz rust-59d07c3ae5a1f53924c7580fa302c397c362f1a2.zip | |
Parse inline const patterns
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/pat.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs index 5aced9dc37c..15db2066a30 100644 --- a/compiler/rustc_parse/src/parser/pat.rs +++ b/compiler/rustc_parse/src/parser/pat.rs @@ -313,6 +313,9 @@ impl<'a> Parser<'a> { let pat = self.parse_pat_with_range_pat(false, None)?; self.sess.gated_spans.gate(sym::box_patterns, lo.to(self.prev_token.span)); PatKind::Box(pat) + } else if self.check_inline_const() { + // Parse `const pat` + PatKind::Lit(self.parse_const_expr(lo.to(self.token.span))?) } else if self.can_be_ident_pat() { // Parse `ident @ pat` // This can give false positives and parse nullary enums, |
