Skip to content

Propagate #[allow(dead_code)] on adts to their inherent impls#157885

Draft
mu001999 wants to merge 1 commit into
rust-lang:mainfrom
mu001999-contrib:dead-code/improve
Draft

Propagate #[allow(dead_code)] on adts to their inherent impls#157885
mu001999 wants to merge 1 commit into
rust-lang:mainfrom
mu001999-contrib:dead-code/improve

Conversation

@mu001999

Copy link
Copy Markdown
Member

This PR does:

  1. propagate #[allow(dead_code)] on adts to their inherent impls and impl items
  2. refactor the previous implementation in Impls and impl items inherit dead_code lint level of the corresponding traits and trait items #144113

Fixes #149142

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 14, 2026
Comment thread compiler/rustc_passes/src/dead.rs Outdated
Comment thread compiler/rustc_passes/src/dead.rs Outdated
@mu001999 mu001999 force-pushed the dead-code/improve branch from 0ff50d6 to 93cdd71 Compare June 14, 2026 14:43
@mu001999

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 15, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 15, 2026
Propagate `#[allow(dead_code)]` on adts to their inherent impls
@rust-bors

rust-bors Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 25aedf1 (25aedf1c569cd8fb010ed559082eacf12d56aaa2, parent: 3daae5e42ec9ba435212987331af1b7b8634fa90)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

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 @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.5% [0.1%, 0.9%] 52
Regressions ❌
(secondary)
0.4% [0.2%, 0.7%] 16
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [-0.2%, 0.9%] 53

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.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.9% [-6.9%, -0.9%] 3
Improvements ✅
(secondary)
-1.0% [-1.0%, -1.0%] 1
All ❌✅ (primary) -2.3% [-6.9%, 2.3%] 4

Cycles

Results (secondary 21.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
21.3% [20.3%, 22.4%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 519.503s -> 518.599s (-0.17%)
Artifact size: 401.51 MiB -> 401.51 MiB (-0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress warnings on dead inherent methods when allowing dead types

4 participants