about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 6b8411a9ead..810efd39177 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2383,7 +2383,13 @@ pub impl Parser {
                         can_be_enum_or_struct = false
                 }
 
-                if is_plain_ident(&*self.token) && !can_be_enum_or_struct {
+                if self.look_ahead(1) == token::DOTDOT {
+                    let start = self.parse_expr_res(RESTRICT_NO_BAR_OP);
+                    self.eat(&token::DOTDOT);
+                    let end = self.parse_expr_res(RESTRICT_NO_BAR_OP);
+                    pat = pat_range(start, end);
+                }
+                else if is_plain_ident(&*self.token) && !can_be_enum_or_struct {
                     let name = self.parse_path_without_tps();
                     let sub;
                     if self.eat(&token::AT) {
@@ -2392,7 +2398,7 @@ pub impl Parser {
                     } else {
                         // or just foo
                         sub = None;
-                    };
+                    }
                     pat = pat_ident(binding_mode, name, sub);
                 } else {
                     // parse an enum pat