syntax: fix use of "vector" for [x; n] literal and [x, y] patterns
This commit is contained in:
parent
1af31d4974
commit
29945d5db0
2 changed files with 3 additions and 3 deletions
|
@ -2075,7 +2075,7 @@ impl<'a> Parser<'a> {
|
|||
// Nonempty vector.
|
||||
let first_expr = try!(self.parse_expr_nopanic());
|
||||
if self.check(&token::Semi) {
|
||||
// Repeating vector syntax: [ 0; 512 ]
|
||||
// Repeating array syntax: [ 0; 512 ]
|
||||
try!(self.bump());
|
||||
let count = try!(self.parse_expr_nopanic());
|
||||
try!(self.expect(&token::CloseDelim(token::Bracket)));
|
||||
|
@ -3260,7 +3260,7 @@ impl<'a> Parser<'a> {
|
|||
pat = PatTup(fields);
|
||||
}
|
||||
token::OpenDelim(token::Bracket) => {
|
||||
// Parse [pat,pat,...] as vector pattern
|
||||
// Parse [pat,pat,...] as slice pattern
|
||||
try!(self.bump());
|
||||
let (before, slice, after) = try!(self.parse_pat_vec_elements());
|
||||
try!(self.expect(&token::CloseDelim(token::Bracket)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue