Skip to content

rustfmt can delete comments within an attribute #4115

Closed
@ahl

Description

@ahl

source:

#[derive(A,
    B,
    C,
    D,
    // E,
)]
fn foo() {
    bar(1,
        2,
        3,
        4,
        // 5,
    );
}

post-rustfmt:

#[derive(A, B, C, D)]
fn foo() {
    bar(
        1, 2, 3, 4,
        // 5,
    );
}

I would expect something like:

#[derive(
    A, B, C, D,
    // E,
)]
fn foo() {
    bar(
        1, 2, 3, 4,
        // 5,
    );
}

I'd be happy to submit a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentsbugPanic, non-idempotency, invalid code, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions