1
Fork 0

rollup merge of #19413: P1start/more-trailing-commas

The only other place I know of that doesn’t allow trailing commas is closure types (#19414), and those are a bit tricky to fix (I suspect it might be impossible without infinite lookahead) so I didn’t implement that in this patch. There are other issues surrounding closure type parsing anyway, in particular #19410.
This commit is contained in:
Corey Richardson 2014-12-05 10:06:50 -08:00
commit 26f2867c2e
5 changed files with 26 additions and 7 deletions

View file

@ -3111,6 +3111,11 @@ impl<'a> Parser<'a> {
first = false;
} else {
self.expect(&token::Comma);
if self.token == token::CloseDelim(token::Bracket)
&& (before_slice || after.len() != 0) {
break
}
}
if before_slice {