Rollup merge of #56330 - estebank:cleanup-span, r=zackmdavis
Clean up span in non-trailing `..` suggestion
This commit is contained in:
commit
3b64f86beb
@ -3952,7 +3952,7 @@ fn parse_pat_fields(&mut self) -> PResult<'a, (Vec<source_map::Spanned<ast::Fiel
|
||||
);
|
||||
err.emit();
|
||||
}
|
||||
self.bump(); // `..` || `...`:w
|
||||
self.bump(); // `..` || `...`
|
||||
|
||||
if self.token == token::CloseDelim(token::Brace) {
|
||||
etc_span = Some(etc_sp);
|
||||
@ -3972,7 +3972,7 @@ fn parse_pat_fields(&mut self) -> PResult<'a, (Vec<source_map::Spanned<ast::Fiel
|
||||
ate_comma = true;
|
||||
}
|
||||
|
||||
etc_span = Some(etc_sp);
|
||||
etc_span = Some(etc_sp.until(self.span));
|
||||
if self.token == token::CloseDelim(token::Brace) {
|
||||
// If the struct looks otherwise well formed, recover and continue.
|
||||
if let Some(sp) = comma_sp {
|
||||
|
@ -8,8 +8,8 @@ LL | let Point { .., y, } = p; //~ ERROR expected `}`, found `,`
|
||||
| `..` must be at the end and cannot have a trailing comma
|
||||
help: move the `..` to the end of the field list
|
||||
|
|
||||
LL | let Point { y, .. } = p; //~ ERROR expected `}`, found `,`
|
||||
| -- ^^^^
|
||||
LL | let Point { y, .. } = p; //~ ERROR expected `}`, found `,`
|
||||
| -- ^^^^
|
||||
|
||||
error: expected `}`, found `,`
|
||||
--> $DIR/issue-49257.rs:21:19
|
||||
@ -21,8 +21,8 @@ LL | let Point { .., y } = p; //~ ERROR expected `}`, found `,`
|
||||
| `..` must be at the end and cannot have a trailing comma
|
||||
help: move the `..` to the end of the field list
|
||||
|
|
||||
LL | let Point { y , .. } = p; //~ ERROR expected `}`, found `,`
|
||||
| -- ^^^^^^
|
||||
LL | let Point { y , .. } = p; //~ ERROR expected `}`, found `,`
|
||||
| -- ^^^^^^
|
||||
|
||||
error: expected `}`, found `,`
|
||||
--> $DIR/issue-49257.rs:22:19
|
||||
|
Loading…
Reference in New Issue
Block a user