about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2014-12-30 19:55:06 +1300
committerNick Cameron <ncameron@mozilla.com>2015-01-02 10:28:19 +1300
commitd45b5d2ed9b43b3ad573482fb8820a382f20289e (patch)
tree22734f013bd1ebf3245c685cb51a12b21916f98c /src/libsyntax/parse
parent39d74026663597a8d4ad0ab04e6d117bf9fd6ad4 (diff)
downloadrust-d45b5d2ed9b43b3ad573482fb8820a382f20289e.tar.gz
rust-d45b5d2ed9b43b3ad573482fb8820a382f20289e.zip
Disallow [_, ..n] syntax for fixed length arrays and repeating array constructors
Closes #19999

[breaking-change]

Use [_; n] instead.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index e88aabb044c..a58ed4811bf 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1716,12 +1716,7 @@ impl<'a> Parser<'a> {
     }
 
     pub fn maybe_parse_fixed_length_of_vec(&mut self) -> Option<P<ast::Expr>> {
-        if self.check(&token::Comma) &&
-                self.look_ahead(1, |t| *t == token::DotDot) {
-            self.bump();
-            self.bump();
-            Some(self.parse_expr_res(RESTRICTION_NO_DOTS))
-        } else if self.check(&token::Semi) {
+        if self.check(&token::Semi) {
             self.bump();
             Some(self.parse_expr())
         } else {
@@ -2277,15 +2272,7 @@ impl<'a> Parser<'a> {
                 } else {
                     // Nonempty vector.
                     let first_expr = self.parse_expr();
-                    if self.check(&token::Comma) &&
-                        self.look_ahead(1, |t| *t == token::DotDot) {
-                        // Repeating vector syntax: [ 0, ..512 ]
-                        self.bump();
-                        self.bump();
-                        let count = self.parse_expr();
-                        self.expect(&token::CloseDelim(token::Bracket));
-                        ex = ExprRepeat(first_expr, count);
-                    } else if self.check(&token::Semi) {
+                    if self.check(&token::Semi) {
                         // Repeating vector syntax: [ 0; 512 ]
                         self.bump();
                         let count = self.parse_expr();