Formatting deletes the import if all of the items are commented out. Reproducible using `rustfmt 1.6.0-nightly (16db2a4b 2023-08-18)` and `rustfmt 1.5.3-nightly (f4b80cac 2023-06-30)`. Likely other versions as well. **input** ```rust use std::fs::{ // File }; ``` **output** ```rust ``` **expect** ```rust use std::fs::{ // File }; ``` _Originally posted by @okaneco in https://github.com/rust-lang/rustfmt/issues/5852#issuecomment-1667540118_