Skip to content

interpreter: improve comments and error message in mir_assign_valid_types#155512

Open
RalfJung wants to merge 1 commit intorust-lang:mainfrom
RalfJung:interpret-assignment-validity
Open

interpreter: improve comments and error message in mir_assign_valid_types#155512
RalfJung wants to merge 1 commit intorust-lang:mainfrom
RalfJung:interpret-assignment-validity

Conversation

@RalfJung
Copy link
Copy Markdown
Member

@RalfJung RalfJung commented Apr 19, 2026

I looked at this while debugging #155477, but this makes no progress on that issue.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 19, 2026

Some changes occurred to the CTFE machinery

cc @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@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 Apr 19, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 19, 2026

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, mir
  • compiler, mir expanded to 72 candidates
  • Random selection from 17 candidates

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 19, 2026

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@RalfJung RalfJung changed the title interpret: improve assignment type validity check and error messages check MIR assignment type validity check during codegen Apr 19, 2026
Comment thread compiler/rustc_ty_utils/src/compare_types.rs
@RalfJung RalfJung force-pushed the interpret-assignment-validity branch from 4f96108 to 3e7a6e4 Compare April 19, 2026 11:28
@RalfJung
Copy link
Copy Markdown
Member Author

RalfJung commented Apr 19, 2026

Strangely, codegen does not seem to see the same types as the interpreter / Miri. I can't reproduce the ICE there.

@RalfJung
Copy link
Copy Markdown
Member Author

Ah, transmute is implemented differently in codegen so we're not asking the mir_assign_valid_types question as part of the transmute. So there's not really a place outside the interpreter that could hit #155477.

It could still be worth checking mir_assign_valid_types during codegen, as a sanity check? I can also remove the 2nd commit again if you prefer. (But note that this does resolve an existing FIXME saying we need to find a better place for these utility functions.)

@RalfJung RalfJung force-pushed the interpret-assignment-validity branch 2 times, most recently from 5239e33 to ec0f805 Compare April 19, 2026 12:02
@rust-bors

This comment has been minimized.

@RalfJung RalfJung force-pushed the interpret-assignment-validity branch from ec0f805 to 20d66f0 Compare April 20, 2026 06:55
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 20, 2026

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.

@RalfJung RalfJung force-pushed the interpret-assignment-validity branch from 20d66f0 to ab617ae Compare April 20, 2026 13:34
@RalfJung
Copy link
Copy Markdown
Member Author

Given that relate_types is apparently buggy I think maybe we shouldn't make it more widely available then. ;) So I removed the 2nd commit.

@RalfJung RalfJung changed the title check MIR assignment type validity check during codegen interpreter: improve comments and error message in mir_assign_valid_types Apr 20, 2026
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.

3 participants