diff options
| author | Ariel Ben-Yehuda <arielb1@mail.tau.ac.il> | 2017-06-29 08:40:05 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-29 08:40:05 +0000 |
| commit | effd1e040ea34c02892209caf0b46d535d4940e8 (patch) | |
| tree | 4740f7cf4f21f712cb902e27360a64615556b968 /src/libsyntax | |
| parent | 4bae0d8b7fef1a5eb1027dcdc6a7b322b0dbc29c (diff) | |
| parent | 0dfd9c30f2c61458343e0816c66f448019e826d1 (diff) | |
| download | rust-effd1e040ea34c02892209caf0b46d535d4940e8.tar.gz rust-effd1e040ea34c02892209caf0b46d535d4940e8.zip | |
Rollup merge of #42886 - durka:pplmm-mwe, r=petrochenkov
syntax: allow negative integer literal expression to be interpolated as pattern Fixes #42820. r? @jseyfried
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
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; |
