This commit is contained in:
Michael Goulet 2022-11-05 19:33:12 -07:00 committed by GitHub
parent 4b77e730b5
commit 28d82ddfc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2880,7 +2880,7 @@ impl<'a> Parser<'a> {
}; };
while self.token != token::CloseDelim(close_delim) { while self.token != token::CloseDelim(close_delim) {
if self.eat(&token::DotDot) || self.recover_struct_fileds_dots(close_delim) { if self.eat(&token::DotDot) || self.recover_struct_field_dots(close_delim) {
let exp_span = self.prev_token.span; let exp_span = self.prev_token.span;
// We permit `.. }` on the left-hand side of a destructuring assignment. // We permit `.. }` on the left-hand side of a destructuring assignment.
if self.check(&token::CloseDelim(close_delim)) { if self.check(&token::CloseDelim(close_delim)) {
@ -3027,7 +3027,7 @@ impl<'a> Parser<'a> {
self.recover_stmt(); self.recover_stmt();
} }
fn recover_struct_fileds_dots(&mut self, close_delim: Delimiter) -> bool { fn recover_struct_field_dots(&mut self, close_delim: Delimiter) -> bool {
if !self.look_ahead(1, |t| *t == token::CloseDelim(close_delim)) if !self.look_ahead(1, |t| *t == token::CloseDelim(close_delim))
&& self.eat(&token::DotDotDot) && self.eat(&token::DotDotDot)
{ {