Closed
Description
I tried this code:
#[deprecated]
#[allow(unsafe_code)]
#[cfg(not(foo))]
use std::fs;
fn main() {}
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).