Skip to content

Simplify dead code lint #144863

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Aug 3, 2025

This PR scratches a few itches I had when looking at that code.

The perf improvement comes from keeping the scanned set through several marking phases. This pretty much divides by 2 the number of HIR traversals.

@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 Aug 3, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 3, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

⌛ Trying commit fdb0651 with merge 2d9299b

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Aug 3, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 3, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

☀️ Try build successful (CI)
Build commit: 2d9299b (2d9299bf7e56a5bbe4eb425be9beb136afa85ac2, parent: f34ba774c78ea32b7c40598b8ad23e75cdac42a6)

@rust-timer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 4, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

⌛ Trying commit effc509 with merge be8ce86

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Aug 4, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

☀️ Try build successful (CI)
Build commit: be8ce86 (be8ce86c3741a46b0e888e7a4f5d7b4dbe5da9a2, parent: f34ba774c78ea32b7c40598b8ad23e75cdac42a6)

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2d9299b): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking 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 @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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
Regressions ❌
(secondary)
0.3% [0.1%, 0.4%] 16
Improvements ✅
(primary)
-0.4% [-1.2%, -0.1%] 77
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.1%] 9
All ❌✅ (primary) -0.4% [-1.2%, -0.1%] 77

Max RSS (memory usage)

Results (primary 1.6%, secondary 3.9%)

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

mean range count
Regressions ❌
(primary)
1.6% [1.6%, 1.6%] 1
Regressions ❌
(secondary)
3.9% [2.5%, 5.2%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [1.6%, 1.6%] 1

Cycles

Results (primary -2.4%, secondary 4.9%)

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)
4.9% [2.1%, 7.8%] 2
Improvements ✅
(primary)
-2.4% [-2.8%, -2.1%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.4% [-2.8%, -2.1%] 4

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 467.629s -> 467.986s (0.08%)
Artifact size: 376.97 MiB -> 376.92 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 4, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 4, 2025

While keeping original scanned:
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 4, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

⌛ Trying commit effc509 with merge af77cf0

To cancel the try build, run the command @bors try cancel.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 4, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

☀️ Try build successful (CI)
Build commit: af77cf0 (af77cf03e48d4f51f9a9ad3e985759a19ead7043, parent: e1b9081e699065badfc1a9419ec9566e5c8615c4)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (af77cf0): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking 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.

@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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-1.5%, -0.1%] 79
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.1%] 13
All ❌✅ (primary) -0.5% [-1.5%, -0.1%] 79

Max RSS (memory usage)

Results (primary 1.7%, secondary -4.2%)

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

mean range count
Regressions ❌
(primary)
1.7% [1.2%, 2.2%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.2% [-4.2%, -4.2%] 1
All ❌✅ (primary) 1.7% [1.2%, 2.2%] 2

Cycles

Results (primary -3.1%)

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)
- - 0
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.1% [-3.1%, -3.1%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 468.82s -> 468.751s (-0.01%)
Artifact size: 376.96 MiB -> 376.89 MiB (-0.02%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Aug 4, 2025
@cjgillot cjgillot marked this pull request as ready for review August 4, 2025 16:52
@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

4 participants