Skip to content

Line indented again each time rustfmt is run until it's 100 columns wide #5044

Open
@autumnontape

Description

@autumnontape

The line containing ::uninit() in the following code is repeatedly indented if rustfmt is run on the file repeatedly. This also causes cargo fmt -- --check to fail, even when cargo fmt was just run, unless the line is as long as permissible.

macro_rules! space_uninit {
    ($capacity:expr) => {
        unsafe {
            core::mem::MaybeUninit::<[core::mem::MaybeUninit<core::primitive::u8>; $capacity]>
                ::uninit()
        }
    };
}

rustfmt version:

$ rustfmt -V
rustfmt 1.4.37-stable (09c42c4 2021-10-18)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-macrosbugPanic, non-idempotency, invalid code, etc.p-medium

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions