File tree 2 files changed +18
-2
lines changed 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2383,7 +2383,13 @@ pub impl Parser {
2383
2383
can_be_enum_or_struct = false
2384
2384
}
2385
2385
2386
- if is_plain_ident ( & * self . token ) && !can_be_enum_or_struct {
2386
+ if self . look_ahead ( 1 ) == token:: DOTDOT {
2387
+ let start = self . parse_expr_res ( RESTRICT_NO_BAR_OP ) ;
2388
+ self . eat ( & token:: DOTDOT ) ;
2389
+ let end = self . parse_expr_res ( RESTRICT_NO_BAR_OP ) ;
2390
+ pat = pat_range ( start, end) ;
2391
+ }
2392
+ else if is_plain_ident ( & * self . token ) && !can_be_enum_or_struct {
2387
2393
let name = self . parse_path_without_tps ( ) ;
2388
2394
let sub;
2389
2395
if self . eat ( & token:: AT ) {
@@ -2392,7 +2398,7 @@ pub impl Parser {
2392
2398
} else {
2393
2399
// or just foo
2394
2400
sub = None ;
2395
- } ;
2401
+ }
2396
2402
pat = pat_ident ( binding_mode, name, sub) ;
2397
2403
} else {
2398
2404
// parse an enum pat
Original file line number Diff line number Diff line change
1
+ static s: int = 1 ;
2
+ static e: int = 42 ;
3
+
4
+ fn main ( ) {
5
+ match 7 {
6
+ s..e => ( ) ,
7
+ _ => ( ) ,
8
+ }
9
+ }
10
+
You can’t perform that action at this time.
0 commit comments