Skip to content

Document and correct assignment order for yield and inline-asm - #160777

Open
cjgillot wants to merge 3 commits into
rust-lang:mainfrom
cjgillot:init-kind
Open

Document and correct assignment order for yield and inline-asm#160777
cjgillot wants to merge 3 commits into
rust-lang:mainfrom
cjgillot:init-kind

Conversation

@cjgillot

@cjgillot cjgillot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

The first two commits cleanup and rename the variants of InitKind.

The third commit attempts to make several parts of MIR analyses a bit more consistent.

For calls, we correctly model assignments to happen on the return edge.

For yields, assignments also happen on the return edge according to dataflow analyses (see TerminatorEdges), but were considered unconditional. This should not change anything, as nobody uses droppable types as coroutine resume argument.

For inline_asm, same thing, dataflow analyses consider assignments to happen on targets and not on unwind. This is also corrected. I have no idea what's the impact of this. I suppose user wisely avoid to assign droppable types in inline asm that may unwind.

  • I did not use an LLM to create a change in this PR.
  • I used an LLM to create a change in this PR, and I have explained below how it was used.

This variant is never constructed.
For `yield` this is not a problem, as nobody uses droppable types a
coroutine resume argument.

For `inline_asm`, it is delicate to gauge the effect.
@rustbot

rustbot commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

This PR changes MIR

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

@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 Aug 8, 2026
@rustbot

rustbot commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

r? @mu001999

rustbot has assigned @mu001999.
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 75 candidates
  • Random selection from 19 candidates

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