Propagate #[allow(dead_code)] on adts to their inherent impls - #157885
Propagate #[allow(dead_code)] on adts to their inherent impls#157885mu001999 wants to merge 2 commits into
#[allow(dead_code)] on adts to their inherent impls#157885Conversation
0ff50d6 to
93cdd71
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Propagate `#[allow(dead_code)]` on adts to their inherent impls
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (25aedf1): comparison URL. Overall result: ❌ regressions - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in 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 -2.3%, secondary -1.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 21.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 519.503s -> 518.599s (-0.17%) |
93cdd71 to
cbc2406
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Propagate `#[allow(dead_code)]` on adts to their inherent impls
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (848b0fa): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in 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 -5.4%, secondary 1.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 1.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 522.035s -> 522.314s (0.05%) |
cbc2406 to
f1229af
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (ac3f172): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in 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 -1.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.9%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 522.822s -> 523.673s (0.16%) |
|
rustbot has assigned @dingxiangfei2009. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@dingxiangfei2009 friendly ping |
|
Seems @dingxiangfei2009 has no time to review this, so @rustbot reroll |
#[allow(dead_code)]
struct Foo;
impl Foo {
fn foo(&self) {}
}Do we think this should actually make @rustbot nominate lang |
|
Error: The feature Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
37270c7 to
985dc42
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
…kang Refactor the `#[allow(dead_code)]` propagation for impl items of traits Extracted from #157885. This PR does the refactor and corrects the previous implementation. The following will fail currently ([play](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=3279902b2d2e6b0fe75c5af565b1cddd)): ```rust #![deny(dead_code)] #![deny(unfulfilled_lint_expectations)] #[allow(dead_code)] pub trait Tr { fn foo(&self); } struct Foo; impl Tr for Foo { fn foo(&self) { bar(); } } #[expect(dead_code)] fn bar() {} fn main() {} ``` After this PR, we could handle the `#[allow(dead_code)]` propagation correctly, and should get perf improvement.
…kang Refactor the `#[allow(dead_code)]` propagation for impl items of traits Extracted from #157885. This PR does the refactor and corrects the previous implementation. The following will fail currently ([play](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=3279902b2d2e6b0fe75c5af565b1cddd)): ```rust #![deny(dead_code)] #![deny(unfulfilled_lint_expectations)] #[allow(dead_code)] pub trait Tr { fn foo(&self); } struct Foo; impl Tr for Foo { fn foo(&self) { bar(); } } #[expect(dead_code)] fn bar() {} fn main() {} ``` After this PR, we could handle the `#[allow(dead_code)]` propagation correctly, and should get perf improvement.
|
☔ The latest upstream changes (presumably #161571) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
View all comments
This PR does:
#[allow(dead_code)]on adts to their inherent impls and impl items#[allow(dead_code)]propagation for impl items of traits #161571 and Only check#[allow(dead_code)]on the trait #161932)After the above, there is still some slight perf regressions because we indeed do more things (for inherent impls).
Fixes #149142