Skip to content

Split transmute check from HIR typeck #145469

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

Merged
merged 4 commits into from
Aug 23, 2025
Merged

Conversation

cjgillot
Copy link
Contributor

This resolves a FIXME in the implementation of check_transmute.

check_transmute needs to compute type layout, hence needing to see reveal opaques and all type aliases.
Having this inside typeck causes a cycle. For instance: tests/ui/impl-trait/transmute/in-defining-scope.rs.

This PR moves the transmute check outside of typeck, by putting the list of deferred transmute checks in typeck results.

@rustbot
Copy link
Collaborator

rustbot commented Aug 15, 2025

r? @nnethercote

rustbot has assigned @nnethercote.
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 15, 2025
@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

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

rust-bors bot commented Aug 16, 2025

☀️ Try build successful (CI)
Build commit: 531f732 (531f732ba93e69ac09e8bc77d95a54d701e72e84, parent: cd7cbe818e4a66d46fe2df993d1b8518eba8a5cd)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (531f732): 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.5% [0.2%, 3.3%] 16
Regressions ❌
(secondary)
0.6% [0.3%, 1.0%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-1.1%, -0.1%] 4
All ❌✅ (primary) 0.5% [0.2%, 3.3%] 16

Max RSS (memory usage)

Results (primary 2.1%, secondary 6.5%)

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

mean range count
Regressions ❌
(primary)
2.1% [0.4%, 6.8%] 4
Regressions ❌
(secondary)
9.4% [7.2%, 12.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) 2.1% [0.4%, 6.8%] 4

Cycles

Results (primary 2.7%, secondary 2.7%)

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

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
2.7% [2.2%, 3.6%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

Binary size

Results (primary 0.6%, secondary -1.5%)

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

mean range count
Regressions ❌
(primary)
0.6% [0.6%, 0.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.5% [-1.5%, -1.5%] 1
All ❌✅ (primary) 0.6% [0.6%, 0.6%] 1

Bootstrap: 469.562s -> 470.22s (0.14%)
Artifact size: 377.55 MiB -> 377.50 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 16, 2025
@nnethercote
Copy link
Contributor

Nothing wrong that I can see and some of the test outcomes are clearly better. Having said that I am very unfamiliar with this code and it's not an easy PR to review (awkward diffs) so my r+ has a heavy sprinkling of "I trust you know what you're doing".

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 18, 2025

📌 Commit f4137ad has been approved by nnethercote

It is now in the queue for this repository.

@bors bors 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 Aug 18, 2025
@Zalathar
Copy link
Contributor

Scheduling: Prefer a rollup=never PR over rollup=iffy ones that aren't rolled up.

@bors p=1

@bors
Copy link
Collaborator

bors commented Aug 22, 2025

⌛ Testing commit f4137ad with merge 3bf318c...

bors added a commit that referenced this pull request Aug 22, 2025
Split transmute check from HIR typeck

This resolves a FIXME in the implementation of `check_transmute`.

`check_transmute` needs to compute type layout, hence needing to see reveal opaques and all type aliases.
Having this inside typeck causes a cycle. For instance: `tests/ui/impl-trait/transmute/in-defining-scope.rs`.

This PR moves the transmute check outside of typeck, by putting the list of deferred transmute checks in typeck results.
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Aug 22, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2025

This PR was rebased onto a different master 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.

@cjgillot
Copy link
Contributor Author

@bors r=nnethercote

@bors
Copy link
Collaborator

bors commented Aug 22, 2025

📌 Commit 0327e2b has been approved by nnethercote

It is now in the queue for this repository.

@bors bors 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 Aug 22, 2025
@bors
Copy link
Collaborator

bors commented Aug 23, 2025

⌛ Testing commit 0327e2b with merge 78b89eb...

@bors
Copy link
Collaborator

bors commented Aug 23, 2025

☀️ Test successful - checks-actions
Approved by: nnethercote
Pushing 78b89eb to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 23, 2025
@bors bors merged commit 78b89eb into rust-lang:master Aug 23, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 23, 2025
@cjgillot cjgillot deleted the split-transmute branch August 23, 2025 05:06
Copy link
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 6545b05 (parent) -> 78b89eb (this PR)

Test differences

Show 49 test diffs

Stage 2

  • [ui] tests/rustdoc-ui/issues/issue-79494.rs: ignore (only executed when the target is x86_64-unknown-linux-gnu) -> ignore (only executed when the pointer width is 64bit) (J0)
  • [ui] tests/rustdoc-ui/issues/issue-79494.rs: ignore (only executed when the target is x86_64-unknown-linux-gnu) -> pass (J1)

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

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 78b89ebb6b20cf50370335e14c5357a4388ac760 --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. pr-check-1: 1726.9s -> 1325.2s (-23.3%)
  2. dist-aarch64-apple: 6212.9s -> 5285.9s (-14.9%)
  3. dist-x86_64-apple: 7615.1s -> 6651.6s (-12.7%)
  4. pr-check-2: 2413.5s -> 2191.0s (-9.2%)
  5. aarch64-apple: 6449.0s -> 5872.6s (-8.9%)
  6. dist-aarch64-msvc: 5570.1s -> 6056.2s (8.7%)
  7. x86_64-gnu-llvm-20-1: 3362.3s -> 3635.3s (8.1%)
  8. aarch64-gnu-llvm-19-1: 3867.4s -> 3561.2s (-7.9%)
  9. dist-powerpc64le-linux-gnu: 5145.3s -> 5496.9s (6.8%)
  10. x86_64-rust-for-linux: 2704.0s -> 2888.2s (6.8%)
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
Collaborator

Finished benchmarking commit (78b89eb): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.6% [0.6%, 0.6%] 1
Regressions ❌
(secondary)
0.8% [0.6%, 1.0%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [0.6%, 0.6%] 1

Max RSS (memory usage)

Results (primary 4.5%, secondary 7.7%)

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

mean range count
Regressions ❌
(primary)
4.5% [2.1%, 6.9%] 2
Regressions ❌
(secondary)
7.7% [2.3%, 12.2%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.5% [2.1%, 6.9%] 2

Cycles

Results (primary 2.3%)

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

Binary size

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

Bootstrap: 467.563s -> 467.345s (-0.05%)
Artifact size: 378.27 MiB -> 378.27 MiB (0.00%)

@panstromek
Copy link
Contributor

perf triage:

Are the regressions here justified? I see the PR was already a regression before merge (#145469 (comment)), but no other comment on that. The final regression is smaller and mostly affects a secondary stress test, but I'm asking to make sure it's not an oversight.

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. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

8 participants