diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-11-29 13:10:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-29 13:10:54 +0100 |
| commit | 3b64f86beb82b78496a5d5fe3c43944ef7ebd95d (patch) | |
| tree | 2a1c29c05f2b36c1b7f7d0a9d4e9d4df759ac583 | |
| parent | 1fe2085441c5c9afc1523c19c1c1ddbf86bae462 (diff) | |
| parent | 66a2c39290daddf8cc32284fe635591b9dde4b0a (diff) | |
| download | rust-3b64f86beb82b78496a5d5fe3c43944ef7ebd95d.tar.gz rust-3b64f86beb82b78496a5d5fe3c43944ef7ebd95d.zip | |
Rollup merge of #56330 - estebank:cleanup-span, r=zackmdavis
Clean up span in non-trailing `..` suggestion
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-49257.stderr | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index e0436cc7380..506199b60ad 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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); @@ -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 { diff --git a/src/test/ui/issues/issue-49257.stderr b/src/test/ui/issues/issue-49257.stderr index 40179832b49..644df1f56b4 100644 --- a/src/test/ui/issues/issue-49257.stderr +++ b/src/test/ui/issues/issue-49257.stderr @@ -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 |
