Skip to content

Skip empty projections in UnDerefer - #161074

Open
tachsin wants to merge 1 commit into
rust-lang:mainfrom
tachsin:skip-empty-projections-underef
Open

Skip empty projections in UnDerefer#161074
tachsin wants to merge 1 commit into
rust-lang:mainfrom
tachsin:skip-empty-projections-underef

Conversation

@tachsin

@tachsin tachsin commented Aug 13, 2026

Copy link
Copy Markdown

Skip empty projections when replaying CopyForDeref chains.

PostAnalysisNormalize can strip an OpaqueCast that was the only
projection, leaving CopyForDeref of a local. Drop elaboration then
panicked in UnDerefer by indexing that empty projection.

Fixes #160800

r? @ghost

LLM disclosure: I used Cursor to investigate #160800 and implement the
UnDerefer change plus a UI regression test. I reviewed the MIR before and
after PostAnalysisNormalize, confirmed the empty-projection panic, and ran
the new test plus related TAIT drop-elaboration tests locally.

This is not pre-arranged with a reviewer. rust-lang LLM policy asks new
contributors to find a reviewer (e.g. #t-compiler/llm-mentoring on Zulip)
before LLM-assisted PRs are assigned. Using r? @ghost until then.

Made with Cursor

PostAnalysisNormalize can strip an OpaqueCast, leaving CopyForDeref of a
local. Indexing that empty projection ICEd during drop elaboration.

Fixes rust-lang#160800

Co-authored-by: Cursor <cursoragent@cursor.com>
@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 13, 2026
@rustbot

rustbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

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.

[ICE]: index out of bounds: the len is 0 but the index is ..

2 participants