unused_imports
suggestion does not remove attributes
#87973
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
I tried this code:
I expected to see this happen: The suggestion should suggest removing
use std::fs;
and its attributes.Instead, this happened: The suggestion span does not encompass the attributes. This causes
cargo fix
to remove the item, and leave the attributes applying to whatever happens to be next.Meta
rustc 1.56.0-nightly (ccffcafd5 2021-08-11)
See also #56328 for a similar issue (although I think that one is subtly different).
The text was updated successfully, but these errors were encountered: