Skip to content

Allow transmute casts in pre-runtime-MIR #142124

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 1 commit into
base: master
Choose a base branch
from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jun 6, 2025

r? @scottmcm

cc @BoxyUwU

turns out in #138393 I erroneously used transmute casts in

Rvalue::Cast(CastKind::Transmute, Operand::Copy(place), base),

I don't think they have any issues using them before runtime, we just checked for them because we didn't have code exercising those code paths

@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 Jun 6, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 6, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

This PR changes MIR

cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @vakaras

@scottmcm
Copy link
Member

scottmcm commented Jun 9, 2025

I think r=me for the code change here, since it looks like tests pass.

That said, I could have sworn there was more that would have been needed here. If this is in built mir now, are we sure that there's nothing in borrow-checking or move-checking or something that would need handling? (If not and I'm just worried for nothing that's fine too.)

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