Skip to content

rustfmt duplicates rustfmt::skip #4282

Closed
@RalfJung

Description

@RalfJung

When formatting the following code with nightly rustfmt:

fn test(x: &str) {
    // Then handle terminating intrinsics.
    match intrinsic_name {
        // Raw memory accesses
        #[rustfmt::skip]
        | "copy"
        | "copy_nonoverlapping"
        => {
        }
    }
}

The result is that #[rustfmt::skip] gets duplicated.

(We had this problem before and it got fixed, but now it seems it came back: #3974.)

$ rustfmt --version
rustfmt 1.4.18-nightly (c1e9b7b 2020-06-13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions