-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Conversation
compiler-errors
left a comment
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 |
|
@bors r+ rollup |
…rait, r=jdonszelmann Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items 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 rust-lang#144060 r? `@petrochenkov`
Rollup of 8 pull requests Successful merges: - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items) - #149880 (rustc_codegen_llvm: update alignment for double on AIX) - #150668 (Unix implementation for stdio set/take/replace) - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`) - #150695 (MGCA: pretty printing for struct expressions and tuple calls ) - #150698 (Improve comment clarity in candidate_may_shadow) - #150706 (Update wasm-component-ld) - #150710 (Update libc dependency of std) r? `@ghost` `@rustbot` modify labels: rollup
…rait, r=jdonszelmann Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items 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 rust-lang#144060 r? ``@petrochenkov``
Rollup of 8 pull requests Successful merges: - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items) - #149880 (rustc_codegen_llvm: update alignment for double on AIX) - #150412 (use PIDFD_GET_INFO ioctl when available) - #150668 (Unix implementation for stdio set/take/replace) - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`) - #150695 (MGCA: pretty printing for struct expressions and tuple calls ) - #150698 (Improve comment clarity in candidate_may_shadow) - #150706 (Update wasm-component-ld) r? `@ghost` `@rustbot` modify labels: rollup
…rait, r=jdonszelmann Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items 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 rust-lang#144060 r? ```@petrochenkov```
…uwer Rollup of 11 pull requests Successful merges: - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items) - #148339 (naked functions: emit `.private_extern` on macos) - #149880 (rustc_codegen_llvm: update alignment for double on AIX) - #150122 (Refactor function names of `rustc_ast_lowering`) - #150412 (use PIDFD_GET_INFO ioctl when available) - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`) - #150695 (MGCA: pretty printing for struct expressions and tuple calls ) - #150698 (Improve comment clarity in candidate_may_shadow) - #150706 (Update wasm-component-ld) - #150707 (Fix ICE when transmute Assume field is invalid) - #150708 (Enable merge queue in new bors) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 11 pull requests Successful merges: - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items) - #148339 (naked functions: emit `.private_extern` on macos) - #149880 (rustc_codegen_llvm: update alignment for double on AIX) - #150122 (Refactor function names of `rustc_ast_lowering`) - #150412 (use PIDFD_GET_INFO ioctl when available) - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`) - #150695 (MGCA: pretty printing for struct expressions and tuple calls ) - #150698 (Improve comment clarity in candidate_may_shadow) - #150706 (Update wasm-component-ld) - #150707 (Fix ICE when transmute Assume field is invalid) - #150708 (Enable merge queue in new bors) r? `@ghost` `@rustbot` modify labels: rollup
…uwer Rollup of 10 pull requests Successful merges: - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items) - #149880 (rustc_codegen_llvm: update alignment for double on AIX) - #150122 (Refactor function names of `rustc_ast_lowering`) - #150412 (use PIDFD_GET_INFO ioctl when available) - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`) - #150695 (MGCA: pretty printing for struct expressions and tuple calls ) - #150698 (Improve comment clarity in candidate_may_shadow) - #150706 (Update wasm-component-ld) - #150707 (Fix ICE when transmute Assume field is invalid) - #150708 (Enable merge queue in new bors) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #144113 - mu001999-contrib:dead-code/allow-trait, r=jdonszelmann Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items 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````
|
Candidate for the perf regression in #150726 |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (bb5b182): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 4.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 473.921s -> 475.634s (0.36%) |
|
Yeah seems like this PR is the cause sadly, what action should we take to resolve this? |
|
I'm going to mark as triaged. This only significantly affected bitmaps in the non-incremental scenarios, and the change looks fairly minimal to me -- not clear that it could be made any better -- so I don't think there's much to be done here given this is effectively a new feature. |
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