unused imports should not be fixed from use foo;\n
to \n
#66560
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
E-help-wanted
Call for participation: Help is requested to fix this issue.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Right now rustfix fixes unused imports by removing but instead of replacing an unused import
use foo;\n
with ``, it inserts\n
. This gets really annoying when you have a single block of imports and it ends up looking "hole punched":On its own this wouldn't be that big of a deal but since these have now been split into separate import "blocks" rustfmt will no longer condense them.
The text was updated successfully, but these errors were encountered: