Skip to content

internal: Align MIR ProjectionElem more with rustc's version and simplify it#22510

Open
flodiebold wants to merge 2 commits into
rust-lang:masterfrom
flodiebold:mir-salsa-projections
Open

internal: Align MIR ProjectionElem more with rustc's version and simplify it#22510
flodiebold wants to merge 2 commits into
rust-lang:masterfrom
flodiebold:mir-salsa-projections

Conversation

@flodiebold
Copy link
Copy Markdown
Member

  • Instead of three Field variants, we now have just one that takes just a field index, like rustc (except rustc also tracks the type).
  • Enum variant downcasting in patterns is handled with the Downcast projection like in rustc; previously it happened implicitly through the FieldId which knew its variant
  • Introduce PlaceTy helper for this variant downcasting
  • Align projection_ty code mostly with rustc
  • Remove unused OpaqueCast variant for now

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 1, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants