Closed
Description
Code
Run cargo fix
on the following:
use std::time::Duration;
use std::time::Instant;
use std::time::SystemTime;
Current output
cargo fix will remove the unused use
statements but will leave an empty line behind for each one. In this case that is 3 empty lines:
Desired output
No empty lines left behind:
Rationale and extra context
Leaving those empty lines around means they need to be manually cleaned up and I dont think there is ever a scenario where someone would want the empty line left behind.
I'm not sure if this is a cargo bug or a rustc bug.
I know rustc emits some kind of span to tell cargo what change needs to occur?
But maybe its cargo not interpreting the span correctly?
Other cases
No response
Rust Version
It has been this way for as long as I can remember but:
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-unknown-linux-gnu
release: 1.75.0
LLVM version: 17.0.6
Anything else?
No response