diff options
| author | bors <bors@rust-lang.org> | 2016-01-07 04:44:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-01-07 04:44:14 +0000 |
| commit | 440671751e818dfb20525a16a00011b8227eeaa7 (patch) | |
| tree | 07eaf2e17e6001eb725b60ece34778ac1078a045 /src/libsyntax/parse/parser.rs | |
| parent | 3ed6e9e6f0213bec36b92fd8e8aa71f954fef99e (diff) | |
| parent | 535282bcf57f45e45cb3a01a570ab7b9ff38ee1d (diff) | |
| download | rust-440671751e818dfb20525a16a00011b8227eeaa7.tar.gz rust-440671751e818dfb20525a16a00011b8227eeaa7.zip | |
Auto merge of #30723 - nrc:macro-err-bug, r=Manishearth
Fixes #30715
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f8dd349e6cb..e089e630e57 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2798,8 +2798,15 @@ impl<'a> Parser<'a> { // We have 2 alternatives here: `x..y` and `x..` The other two variants are // handled with `parse_prefix_range_expr` call above. let rhs = if self.is_at_start_of_range_notation_rhs() { - self.parse_assoc_expr_with(op.precedence() + 1, - LhsExpr::NotYetParsed).ok() + let rhs = self.parse_assoc_expr_with(op.precedence() + 1, + LhsExpr::NotYetParsed); + match rhs { + Ok(e) => Some(e), + Err(mut e) => { + e.cancel(); + None + } + } } else { None }; |
