diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-21 19:49:54 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-24 00:32:03 +0200 |
| commit | 2aff6b36d7ed5c25700669a92b4a43200ee0fe6b (patch) | |
| tree | fbb55f5b4abf4983da47d266412712d1d70439c9 /src/libsyntax/parse/parser | |
| parent | 1f470ceac2202ecffe8a15acc1139edb9ad4a03b (diff) | |
| download | rust-2aff6b36d7ed5c25700669a92b4a43200ee0fe6b.tar.gz rust-2aff6b36d7ed5c25700669a92b4a43200ee0fe6b.zip | |
pre-expansion gate box_patterns
Diffstat (limited to 'src/libsyntax/parse/parser')
| -rw-r--r-- | src/libsyntax/parse/parser/pat.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser/pat.rs b/src/libsyntax/parse/parser/pat.rs index af795e51792..5374671d4b8 100644 --- a/src/libsyntax/parse/parser/pat.rs +++ b/src/libsyntax/parse/parser/pat.rs @@ -324,7 +324,9 @@ impl<'a> Parser<'a> { self.parse_pat_ident(BindingMode::ByRef(mutbl))? } else if self.eat_keyword(kw::Box) { // Parse `box pat` - PatKind::Box(self.parse_pat_with_range_pat(false, None)?) + let pat = self.parse_pat_with_range_pat(false, None)?; + self.sess.gated_spans.box_patterns.borrow_mut().push(lo.to(self.prev_span)); + PatKind::Box(pat) } else if self.can_be_ident_pat() { // Parse `ident @ pat` // This can give false positives and parse nullary enums, |
