Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
boozook opened this issue Oct 30, 2024 · 1 comment
Labels
a-comments a-imports `use` syntax bug Panic, non-idempotency, invalid code, etc.

Comments

@boozook
Copy link

boozook commented Oct 30, 2024

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};
@ytmimi ytmimi added bug Panic, non-idempotency, invalid code, etc. a-comments a-imports `use` syntax labels Oct 30, 2024
@ytmimi
Copy link
Contributor

ytmimi commented Oct 30, 2024

Thanks for the report. Confirming I can reproduce this with rustfmt 1.8.0-nightly (96cc01b 2024-10-23)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments a-imports `use` syntax bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

No branches or pull requests

2 participants