Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDiagnostic information does not include item attributes #54400
Comments
alexcrichton
added
the
A-edition-2018-lints
label
Sep 20, 2018
estebank
added
the
A-diagnostics
label
Sep 21, 2018
This comment has been minimized.
This comment has been minimized.
|
Here's where we issue the diagnostic: rust/src/librustc_typeck/check_unused.rs Lines 137 to 152 in 2fa1390 Assuming the cfg attribute is actually preserved by earlier passes, then correcting for this case should be easy (look for it in |
killercup
referenced this issue
Sep 21, 2018
Closed
Attributes applied to deleted items should also be deleted. #147
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Sep 22, 2018
zackmdavis
referenced this issue
Sep 22, 2018
Merged
in which we include attributes in unused `extern crate` suggestion spans #54488
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Oct 1, 2018
bors
closed this
in
#54488
Oct 1, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jrobsonchase commentedSep 20, 2018
Original rustfix issue: rust-lang-nursery/rustfix#147
When rustc outputs warnings like "you don't need this extern crate line anymore, delete it," it doesn't include accompanying attributes. This leads rustfix to apply its suggestion to delete the extern crate line, but leave the attribute, which then gets applied to the next item.
For example:
becomes
#[cfg(unix)] mod foo;which applies the
#[cfg(unix)]attribute tomod foo;which is definitely not what was desired.