Skip to content

Fix typing mode handling in transmute checks and rustc_dump_layout - #160125

Open
bit-aloo wants to merge 3 commits into
rust-lang:mainfrom
bit-aloo:2026-07-29-next-solver-typing-bugs
Open

Fix typing mode handling in transmute checks and rustc_dump_layout#160125
bit-aloo wants to merge 3 commits into
rust-lang:mainfrom
bit-aloo:2026-07-29-next-solver-typing-bugs

Conversation

@bit-aloo

Copy link
Copy Markdown
Member

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 29, 2026
@rustbot

rustbot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

adwinwhite is currently at their maximum review capacity.
They may take a while to respond.

@rust-cloud-vms
rust-cloud-vms Bot force-pushed the 2026-07-29-next-solver-typing-bugs branch from d67cb2c to 6c348ec Compare July 29, 2026 08:56

@adwinwhite adwinwhite left a comment

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.

Thanks!

r=me after nits and squashing commits :>

View changes since this review

Comment thread compiler/rustc_hir_typeck/src/intrinsicck.rs Outdated
Comment thread tests/ui/traits/next-solver/opaques/transmute-async-fn-return-type.rs Outdated
Comment thread tests/ui/traits/next-solver/opaques/wrong-typing-mode-ice-3.rs Outdated
Comment thread tests/ui/traits/next-solver/opaques/wrong-typing-mode-ice-3.rs Outdated
@adwinwhite

Copy link
Copy Markdown
Contributor

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 29, 2026
Types obtained from typeck_results may contain aliases marked as rigid for
their original typing environment. Make these aliases non-rigid before
normalizing transmute types in TypingMode::Codegen.

Also use TypingMode::Codegen in rustc_dump_layout, since opaque types may
normalize to coroutines whose layouts cannot be computed in PostAnalysis mode.

Add regression coverage for both cases.
@rust-cloud-vms
rust-cloud-vms Bot force-pushed the 2026-07-29-next-solver-typing-bugs branch from 6c348ec to 9d94e8a Compare July 30, 2026 09:26
@bit-aloo bit-aloo changed the title Fix ICEs when checking layouts of opaque async return types Fix typing mode handling in transmute checks and rustc_dump_layout Jul 30, 2026
@bit-aloo

Copy link
Copy Markdown
Member Author

@adwinwhite I might need delegate to push to bors.

Comment thread tests/ui/traits/next-solver/opaques/dump-layout-opaque-coroutine.rs
@adwinwhite

This comment was marked as outdated.

@rust-bors

This comment was marked as outdated.

@adwinwhite

Copy link
Copy Markdown
Contributor

One last nit :>
@bors delegate+

@rust-bors

rust-bors Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

✌️ @bit-aloo, you can now approve this pull request!

If @adwinwhite told you to "r=me" after making some further change, then please make that change and post @bors r=adwinwhite.

View changes since this delegation.

@bit-aloo

Copy link
Copy Markdown
Member Author

@bors r=adwinwhite

@rust-bors

rust-bors Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a67d71d has been approved by adwinwhite

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 30, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 30, 2026
…ping-bugs, r=adwinwhite

Fix typing mode handling in transmute checks and rustc_dump_layout

closes: rust-lang/trait-system-refactor-initiative#283

r? @adwinwhite

cc: @lcnr
rust-bors Bot pushed a commit that referenced this pull request Jul 30, 2026
Rollup of 14 pull requests

Successful merges:

 - #159817 (Rename splat to avoid stable name collisions)
 - #160204 (Sync from portable simd 2026 07 30)
 - #150885 (Revive L4Re target)
 - #158057 (Don't escape U+FF9E and U+FF9F in `escape_debug_ext`)
 - #160125 (Fix typing mode handling in transmute checks and rustc_dump_layout)
 - #160152 (Create on-demand CI job for testing EC2 instances)
 - #159214 (std: improve the documentation of the random feature)
 - #159818 (Resolve vars before calling `unnormalized_obligations`)
 - #160040 (Split function parsing out of `item.rs` to a new module.)
 - #160044 (Add regression tests for fixed dead-code issues)
 - #160144 (renovate: group lockfiles PRs)
 - #160149 (Fix Windows on Arm PAC default)
 - #160175 (Try to recover less from incorrectly parsed const arg)
 - #160181 (Mark `Tuple` and `FnPtr` traits `#[fundamental]`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transmute: cannot transmute between types of different sizes, or dependently-sized types

3 participants