Skip to content

Duplicate comma with trailing_comma = "Always" in struct pattern #5066

@dnbln

Description

@dnbln
// src/main.rs
fn main() {
    let Foo { a, .. } = b;
}
# rustfmt.toml
edition = "2021"

unstable_features = true
trailing_comma = "Always"

Reformat with rustfmt --config-path rustfmt.toml src/main.rs

// src/main.rs
fn main() {
    let Foo { a,, .. } = b;
}

rustfmt --version: rustfmt 1.4.38-nightly (4961b10 2021-11-04)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.only-with-optionrequires a non-default option value to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions