File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -2798,8 +2798,15 @@ impl<'a> Parser<'a> {
27982798 // We have 2 alternatives here: `x..y` and `x..` The other two variants are
27992799 // handled with `parse_prefix_range_expr` call above.
28002800 let rhs = if self . is_at_start_of_range_notation_rhs ( ) {
2801- self . parse_assoc_expr_with ( op. precedence ( ) + 1 ,
2802- LhsExpr :: NotYetParsed ) . ok ( )
2801+ let rhs = self . parse_assoc_expr_with ( op. precedence ( ) + 1 ,
2802+ LhsExpr :: NotYetParsed ) ;
2803+ match rhs {
2804+ Ok ( e) => Some ( e) ,
2805+ Err ( mut e) => {
2806+ e. cancel ( ) ;
2807+ None
2808+ }
2809+ }
28032810 } else {
28042811 None
28052812 } ;
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