summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-01-07 04:44:14 +0000
committerbors <bors@rust-lang.org>2016-01-07 04:44:14 +0000
commit440671751e818dfb20525a16a00011b8227eeaa7 (patch)
tree07eaf2e17e6001eb725b60ece34778ac1078a045 /src/libsyntax/parse/parser.rs
parent3ed6e9e6f0213bec36b92fd8e8aa71f954fef99e (diff)
parent535282bcf57f45e45cb3a01a570ab7b9ff38ee1d (diff)
downloadrust-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.rs11
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
                     };