Skip to content

Commit

Permalink
Rollup merge of rust-lang#56330 - estebank:cleanup-span, r=zackmdavis
Browse files Browse the repository at this point in the history
Clean up span in non-trailing `..` suggestion
  • Loading branch information
GuillaumeGomez authored Nov 29, 2018
2 parents 1fe2085 + 66a2c39 commit 3b64f86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3952,7 +3952,7 @@ impl<'a> Parser<'a> {
);
err.emit();
}
self.bump(); // `..` || `...`:w
self.bump(); // `..` || `...`

if self.token == token::CloseDelim(token::Brace) {
etc_span = Some(etc_sp);
Expand All @@ -3972,7 +3972,7 @@ impl<'a> Parser<'a> {
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 {
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/issues/issue-49257.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3b64f86

Please sign in to comment.