-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Impls and impl items inherit dead_code
lint level of the corresponding traits and trait items
#144113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This behavior seems really non-local and pretty broad. #[allow(dead_code)]
on a trait definition suppresses all dead code warnings in all impls with this change?
7eba1f1
to
7a9e2e2
Compare
@compiler-errors yes, and I think this makes sense. We would have only one trait definition but many impls, letting |
I tried reassigning, but rustbot didn’t respond after waiting a while, so I deleted the comment. 😂 |
☔ The latest upstream changes (presumably #144863) made this pull request unmergeable. Please resolve the merge conflicts. |
7a9e2e2
to
c1be949
Compare
@rustbot ready |
@cjgillot gentle ping for a review here |
Nominated the issue for lang team discussion, let's see what they think before merging. |
oh, I missed the and if the trait is non-local, the dead-code lint level won't spread to the local impls. cc @wesleywiser we only care about local traits, see https://github.com/rust-lang/rust/pull/144113/files#diff-719b4f36bbbf3b3bf48683429408f5d27e5633f70c1144a93554bd536d5bf655R786 |
Temporarily removing T-compiler so we can do a lang FCP on this. (Note that this is fixing something perceived as a stable-to-stable regression.) |
@rfcbot merge |
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
dead_code
lint level of the corresponding traits and trait items
@rfcbot reviewed |
https://github.com/rust-lang/rust/blob/master/compiler/rustc_passes/src/dead.rs#L360-L361 won't insert assoc items into the live set, so that impl items cannot be marked live.
This PR lets impls and impl items can inherit lint levels of the corresponding traits and trait items.
Fixes #144060
r? @petrochenkov