about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-06-29 08:40:39 +0000
committerbors <bors@rust-lang.org>2017-06-29 08:40:39 +0000
commit7acce3724d6ba5cb84d6eef6d6847f8573a1fe5a (patch)
tree1cdd6109e4d61790d67fb50fa25a88a8da01fdee /src/libsyntax/parse
parentdc2003b7cc1af7d7beee0b1ceec3d811c28cb35e (diff)
parentd3329d7102db78a408bc059600c48fc7f99a0e67 (diff)
downloadrust-7acce3724d6ba5cb84d6eef6d6847f8573a1fe5a.tar.gz
rust-7acce3724d6ba5cb84d6eef6d6847f8573a1fe5a.zip
Auto merge of #42964 - arielb1:rollup, r=arielb1
Rollup of 12 pull requests

- Successful merges: #42219, #42831, #42832, #42884, #42886, #42901, #42919, #42920, #42946, #42953, #42955, #42958
- Failed merges:
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 851a638e148..5b0031b2f17 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1659,8 +1659,10 @@ impl<'a> Parser<'a> {
         Ok(codemap::Spanned { node: lit, span: lo.to(self.prev_span) })
     }
 
-    /// matches '-' lit | lit
+    /// matches '-' lit | lit (cf. ast_validation::AstValidator::check_expr_within_pat)
     pub fn parse_pat_literal_maybe_minus(&mut self) -> PResult<'a, P<Expr>> {
+        maybe_whole_expr!(self);
+
         let minus_lo = self.span;
         let minus_present = self.eat(&token::BinOp(token::Minus));
         let lo = self.span;