Skip to content

fix ICE in suggest_add_reference_to_arg for non-callable items - #160628

Open
im-lunex wants to merge 1 commit into
rust-lang:mainfrom
im-lunex:fix_#160591
Open

fix ICE in suggest_add_reference_to_arg for non-callable items#160628
im-lunex wants to merge 1 commit into
rust-lang:mainfrom
im-lunex:fix_#160591

Conversation

@im-lunex

@im-lunex im-lunex commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

tcx.fn_sig(def_id) panicked ("unexpected sort of node in fn_sig()") when
the def_id in a WhereClauseInExpr obligation was the struct being
constructed, not the impl. This happens when a struct literal argument is
missing a field.

Guard both fn_sig call sites in suggest_add_reference_to_arg so the
suggestion only fires for callable defs.

Fixes #160591.

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

rustbot commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

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

[ICE]: unexpected sort of node in fn_sig() with missing stuct field

3 participants