about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-06-06 12:00:33 +0200
committerGitHub <noreply@github.com>2023-06-06 12:00:33 +0200
commit71a72ee34a8a456c632c71dea53372cb343f495e (patch)
tree9fa404631854e7e4f81af2d35e9f9b86d11111bd /compiler/rustc_interface/src/errors.rs
parent21e7463bf8eb45cc8d9d9e4e111e64061da0d16a (diff)
parent2a7c6a99ef5c43311a430a07bd4eeab96a7c5d94 (diff)
downloadrust-71a72ee34a8a456c632c71dea53372cb343f495e.tar.gz
rust-71a72ee34a8a456c632c71dea53372cb343f495e.zip
Rollup merge of #112199 - jieyouxu:issue-112188, r=compiler-errors
Fix suggestion for matching struct with `..` on both ends

### Before This PR

```
error: expected `}`, found `,`
 --> src\main.rs:8:17
  |
8 |         Foo { .., x, .. } => (),
  |               --^
  |               | |
  |               | expected `}`
  |               `..` must be at the end and cannot have a trailing comma
  |
help: move the `..` to the end of the field list
  |
8 -         Foo { .., x, .. } => (),
8 +         Foo { .., x,  , .. } => (),
  |
```

### After This PR

```
error: expected `}`, found `,`
  --> tests/ui/parser/issue-112188.rs:11:17
   |
11 |     let Foo { .., x, .. } = f; //~ ERROR expected `}`, found `,`
   |               --^-
   |               | |
   |               | expected `}`
   |               `..` must be at the end and cannot have a trailing comma
   |               help: remove the starting `..`
```

Fixes #112188.
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions