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:
commit
26f2867c2e
5 changed files with 26 additions and 7 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue