Skip to content

simplify MoveDataBuilder::move_path_for with new UnDerefer::co_iter_projections - #160784

Open
beepster4096 wants to merge 2 commits into
rust-lang:mainfrom
beepster4096:underefer_projection_coroutine
Open

simplify MoveDataBuilder::move_path_for with new UnDerefer::co_iter_projections#160784
beepster4096 wants to merge 2 commits into
rust-lang:mainfrom
beepster4096:underefer_projection_coroutine

Conversation

@beepster4096

@beepster4096 beepster4096 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor
  • 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.

Split off an old design of #160780

MoveDataBuilder::move_path_for has been kind of messy since Derefer was moved before drop elaboration because of borrowck problems with the UnDerefer::iter_projections iterator. This PR adds co_iter_projections, returning a ProjectionCoroutine which takes a &UnDerefer for each iteration. Now, move_path_for doesn't have an outlined copy of add_move_path anymore which is a lot nicer.

Since my other PR doesn't need this anymore, if its a perf regression I'll probably just close the PR.

Issues:

  • Is it a major perf regression from re-accessing the hashmap??
    • At least should be identical for places that don't have derefs in the middle
  • I'm not sure if co_iter_projections is the best name

Possible alternatives:

  • mem::take on self.data.rev_lookup.un_derefer?

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

rustbot commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

r? @oli-obk

rustbot has assigned @oli-obk.
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

@beepster4096
beepster4096 force-pushed the underefer_projection_coroutine branch from 8e94571 to 4dd8d59 Compare August 9, 2026 00:38
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