Skip to content

Formatting adds erroneous comma at end of struct update syntax when missing comma before .. #5604

Open
@alice-i-cecile

Description

@alice-i-cecile

Following up on rust-lang/rust#104373, when using functional record update syntax, if a comma is missed before the ..Default::default(), rustfmt will then "helpfully" add a comma after the ..Default::default().

When you fix the error with the missing comma, you now have a different error ("no trailing commas after...") that the user did not make, as automatic formatting added a comma in its confusion.

I'm new to this project, but the new error enum variant proposed in rust-lang/rust#104504 may be helpful to identify these cases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions