Skip to content

Comments in use-blocks may vanish #5697

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

Closed
SWW13 opened this issue Feb 21, 2023 · 1 comment
Closed

Comments in use-blocks may vanish #5697

SWW13 opened this issue Feb 21, 2023 · 1 comment

Comments

@SWW13
Copy link

SWW13 commented Feb 21, 2023

When cargo fmt is run with the default configuration, comments in use-blocks may be removed unexpectedly.

cargo fmt --version

rustfmt 1.5.1-stable (d5a82bb 2023-02-07)

cat src/main.rs

use std::{
    /*
    io::{Read, Seek, Write},
    */
    path::{Path, PathBuf},
    // important stuff
};

fn main() {
    println!("Hello, world!");
}

cargo fmt -- --emit stdout

./src/main.rs:

use std::path::{Path, PathBuf};

fn main() {
    println!("Hello, world!");
}
@SWW13 SWW13 changed the title Comments may in use-blocks vanish Comments in use-blocks may vanish Feb 21, 2023
@ytmimi
Copy link
Contributor

ytmimi commented Feb 21, 2023

Thanks for reaching out. Closing this as a duplicate of #4708

@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants