File tree 2 files changed +35
-2
lines changed
2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -2793,8 +2793,15 @@ impl<'a> Parser<'a> {
2793
2793
// We have 2 alternatives here: `x..y` and `x..` The other two variants are
2794
2794
// handled with `parse_prefix_range_expr` call above.
2795
2795
let rhs = if self . is_at_start_of_range_notation_rhs ( ) {
2796
- self . parse_assoc_expr_with ( op. precedence ( ) + 1 ,
2797
- LhsExpr :: NotYetParsed ) . ok ( )
2796
+ let rhs = self . parse_assoc_expr_with ( op. precedence ( ) + 1 ,
2797
+ LhsExpr :: NotYetParsed ) ;
2798
+ match rhs {
2799
+ Ok ( e) => Some ( e) ,
2800
+ Err ( mut e) => {
2801
+ e. cancel ( ) ;
2802
+ None
2803
+ }
2804
+ }
2798
2805
} else {
2799
2806
None
2800
2807
} ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ macro_rules! parallel {
12
+ (
13
+ for $id: ident in $iter: expr {
14
+ $( $inner: expr; ) *
15
+ }
16
+ ) => { } ;
17
+ }
18
+
19
+
20
+ fn main ( ) {
21
+ parallel ! {
22
+ for i in 0 ..n {
23
+ x += i; //~ ERROR no rules expected the token `+=`
24
+ }
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments