Skip to content

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

@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-macrosArea: macros (procedural macros, macro_rules! macros, etc.)C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEP-mediumMedium priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions