Skip to content

Fix coroutine MIR saved local remapping#158655

Open
dingxiangfei2009 wants to merge 2 commits into
rust-lang:mainfrom
dingxiangfei2009:fix-remapping
Open

Fix coroutine MIR saved local remapping#158655
dingxiangfei2009 wants to merge 2 commits into
rust-lang:mainfrom
dingxiangfei2009:fix-remapping

Conversation

@dingxiangfei2009

Copy link
Copy Markdown
Contributor

The unsound analysis was found while I was working on the async-drop code. Apparently the counter variable in the array drop glue is not correctly identified as a saved local.

Also we did not patch up indices in ProjectionElem::Index when they are saved locals.

The reproduction is in the older commit with the expected output.

Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
Storage is still required even if the local is moved out and
immediately moved in again.

Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
@rustbot

rustbot commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@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 Jul 1, 2026
@rustbot

rustbot commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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
  • compiler expanded to 73 candidates
  • Random selection from 15 candidates

@dingxiangfei2009

Copy link
Copy Markdown
Contributor Author

r? cjgillot

who probably has more context

@rustbot rustbot assigned cjgillot and unassigned TaKO8Ki Jul 1, 2026
@dingxiangfei2009 dingxiangfei2009 requested a review from cjgillot July 1, 2026 12:33
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.

4 participants