Closed
Description
Code
fn main() {
struct Foo {
x: i32,
}
let foo = Foo { x: 1 };
match foo {
Foo { .., x, .. } => (),
_ => (),
}
}
Current output
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, , .. } => (),
|
Desired output
The part in help
:
8 - Foo { .., x, .. } => (),
8 + Foo { x, .. } => (),
Rationale and extra context
A suggestion that can be compiled is better than the one that can't be compiled.
Other cases
No response
Anything else?
No response