File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2383,7 +2383,13 @@ pub impl Parser {
23832383 can_be_enum_or_struct = false
23842384 }
23852385
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 {
23872393 let name = self . parse_path_without_tps ( ) ;
23882394 let sub;
23892395 if self . eat ( & token:: AT ) {
@@ -2392,7 +2398,7 @@ pub impl Parser {
23922398 } else {
23932399 // or just foo
23942400 sub = None ;
2395- } ;
2401+ }
23962402 pat = pat_ident ( binding_mode, name, sub) ;
23972403 } else {
23982404 // 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