Skip to content

rustfmt report "rewriting static" #6213

@Sherlock-Holo

Description

@Sherlock-Holo
static A: i32 = 10;
static B: i32 = 10;

this codes has 2 static variables, then rustfmt --edition 2021 /tmp/ttt/aaa/src/lib.rs report

rewriting static
rewriting static

it looks like it reports rewriting static as many times as I have static variables

the rustfmt version is rustfmt 1.7.1-nightly (bcf94de 2024-06-23)

that didn't happen in previous version, such as rustfmt 1.7.0-nightly (c1b336c 2024-06-21)

also, use cargo fmt to format also has this problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions