Skip to content

outline unreachable! from Clause::kind - #163657

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
panstromek:next-solver-unreachable
Oct 4, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
panstromek:next-solver-unreachable

Conversation

@panstromek

Copy link
Copy Markdown
Contributor

Safe alternative to #163639. unreachable!() expands to panic("internal error: entered unreachable code"), which we've seen before to be worse than plain argument-less call in other hot places.

see https://rust-lang.zulipchat.com/#narrow/channel/247081-t-compiler.2Fperformance/topic/needs.20help.3A.20small.20perf.20improvement.20with.20non-local.20reasoning/with/628660586

@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 Oct 2, 2026
@panstromek

Copy link
Copy Markdown
Contributor 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 Oct 2, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 2, 2026
@rust-bors

rust-bors Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 2660fea (2660fea4cf8b7dcc478d2dc474f57411892974f5)
Base parent: c165834 (c1658342b0ea7eab61db1960082668c77f553522)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (2660fea): comparison URL.

Overall result: ✅ improvements - no action needed

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.

@bors rollup=never rustc-perf
@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.4% [-0.6%, -0.1%] 4
Improvements ✅
(secondary)
-0.4% [-0.7%, -0.2%] 34
All ❌✅ (primary) -0.4% [-0.6%, -0.1%] 4

Max RSS (memory usage)

Results (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)
- - 0
Regressions ❌
(secondary)
3.9% [3.9%, 3.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (primary 2.4%, secondary 3.0%)

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

mean range count
Regressions ❌
(primary)
2.4% [2.1%, 2.7%] 2
Regressions ❌
(secondary)
3.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.4% [2.1%, 2.7%] 2

Binary size

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

Bootstrap: 491.121s -> 490.2s (-0.19%)
Artifact size: 408.64 MiB -> 408.63 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 2, 2026
@panstromek
panstromek marked this pull request as ready for review October 2, 2026 16:53
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 2, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 2, 2026
@rustbot

rustbot commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

r? @oli-obk

rustbot has assigned @oli-obk.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, types
  • compiler, types expanded to 77 candidates
  • Random selection from 19 candidates

@panstromek

Copy link
Copy Markdown
Contributor Author

This is not as good as unreachable_unchecked but it's at least something.

}

pub fn kind(self) -> ty::Binder<'tcx, ClauseKind<'tcx>> {
#[cold]

@lcnr lcnr Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put a comment here referencing this perf run, r=me after

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks ;) but I don't have r+ rights to approve this

@panstromek
panstromek force-pushed the next-solver-unreachable branch from a5d2421 to 1a98b21 Compare October 3, 2026 04:47
@rust-bors

This comment has been minimized.

unreachable!() expands to panic("internal error: entered unreachable code"), which makes the happy path perform worse than plain argument-less call.
@panstromek
panstromek force-pushed the next-solver-unreachable branch from 1a98b21 to 22f30e6 Compare October 3, 2026 06:32
@rustbot

rustbot commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

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.

@lcnr

lcnr commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

@bors r+ rollup=never

@rust-bors

rust-bors Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 22f30e6 has been approved by lcnr

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 3, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 4, 2026
@rust-bors

rust-bors Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: lcnr
Duration: 3h 8m 16s
Pushing a639ea0 to main...

@rust-bors
rust-bors Bot merged commit a639ea0 into rust-lang:main Oct 4, 2026
15 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 4ddbc06 (parent) -> a639ea0 (this PR)

Test differences

Show 3 test diffs

3 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard a639ea0890c0977b1c45596fd6b5f9a70a1d67da --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. test-x86_64-gnu-llvm-22-1: 43m 46s -> 1h 16m (+75.7%)
  2. test-i686-gnu-1: 1h 23m -> 2h 23m (+72.8%)
  3. dist-x86_64-llvm-mingw: 1h 20m -> 2h 11m (+64.1%)
  4. test-x86_64-gnu-distcheck: 1h 31m -> 2h 25m (+59.6%)
  5. test-aarch64-apple-1: 1h 36m -> 2h 32m (+58.0%)
  6. test-x86_64-gnu-stdlib-semver-check: 11m 21s -> 17m 27s (+53.7%)
  7. dist-x86_64-netbsd: 1h 2m -> 1h 33m (+47.8%)
  8. test-x86_64-gnu-gcc: 58m 22s -> 1h 23m (+43.2%)
  9. dist-i686-msvc: 53m 1s -> 32m 25s (-38.9%)
  10. test-i686-gnu-2: 1h 12m -> 1h 40m (+38.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (a639ea0): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

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

Cycles

Results (secondary 3.5%)

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

Binary size

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

Bootstrap: 491.424s -> 489.631s (-0.36%)
Artifact size: 408.69 MiB -> 408.63 MiB (-0.01%)

@panstromek

Copy link
Copy Markdown
Contributor Author

huh, this is quite funny, there's no speedup anymore. I wonder what happened here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. 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.

5 participants