Skip to content

Allow Transmute in Analysis(PostCleanup) #137264

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

Closed
wants to merge 1 commit into from

Conversation

scottmcm
Copy link
Member

Fix #137243

@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2025

r? @wesleywiser

rustbot has assigned @wesleywiser.
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 Feb 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@compiler-errors
Copy link
Member

compiler-errors commented Feb 19, 2025

I don't think this is the right fix.

The problem here is just that the phase is not updated correctly for coroutine bodies, since coroutine lowering happens on the Runtime(PostCleanup) -> Runtime(Initial) pass, but since we clone the drop shim body before the phase has been set, we don't updated the cloned body's phase (since the pass manager intentionally does not recurse into the drop shim's body).

The correct fix would be to set the coroutine drop shim body's phase to Runtime(Initial) in create_coroutine_drop_shim after the body has been cloned, with a comment that explains why this needs to be done.

@compiler-errors
Copy link
Member

r? compiler-errors @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 Feb 19, 2025
@scottmcm scottmcm closed this Mar 15, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 14, 2025
…se, r=scottmcm

Proactively update coroutine drop shim's phase to account for later passes applied during shim query

See comments in the pass and on test. Also see rust-lang#137264 (comment).

Fixes rust-lang#137243
Fixes rust-lang#139698

r? scottmcm
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 14, 2025
Rollup merge of rust-lang#139699 - compiler-errors:coroutine-drop-phase, r=scottmcm

Proactively update coroutine drop shim's phase to account for later passes applied during shim query

See comments in the pass and on test. Also see rust-lang#137264 (comment).

Fixes rust-lang#137243
Fixes rust-lang#139698

r? scottmcm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: broken MIR in DropGlue Transmute is not supported in non-runtime phase Analysis(PostCleanup)
4 participants