Skip to content

Formatting removes comments within braces of imports #5319

@clarfonthey

Description

@clarfonthey

Minimal example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=942d0b7867cbdf3c09ff7d639a41719c

pub use std::collections::{
    // HashMap,
    HashSet,
};

Rustfmt will turn this into:

pub use std::collections::HashSet;

And completely discard the commented-out HashMap. Similarly, this will also remove all comments within the braces for imports, regardless of whether they include valid imports.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions