diff options
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, |
