Skip to content

Formatting error: closing curly-brace placed to the last comment (using visual imports indent) #6379

Open
@boozook

Description

@boozook

Valid code example (just from some crate documentation):

use binrw::{
    binrw,    // #[binrw] attribute
    BinRead,  // trait for reading
    BinWrite, // trait for writing
};

My rustfmt.toml:

imports_indent = "Visual"

Version of rustfmt: rustfmt 1.8.0-nightly (4392847410 2024-10-21)


Expected result of formatting example code above: (something like this, not sure)

use binrw::{binrw,    // #[binrw] attribute
            BinRead,  // trait for reading
            BinWrite, // trait for writing
           };

Actual result that breaks the code - closing curly-brace placed to the last comment:

use binrw::{binrw,    // #[binrw] attribute
            BinRead,  // trait for reading
            BinWrite  // trait for writing};

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentsa-imports`use` syntaxbugPanic, non-idempotency, invalid code, etc.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions