Skip to content

Fix ICE \Unexpected node Synthetic\ in diagnostic_hir_wf_check#157856

Open
Ijtihed wants to merge 5 commits into
rust-lang:mainfrom
Ijtihed:fix-ice-unexpected-node-synthetic
Open

Fix ICE \Unexpected node Synthetic\ in diagnostic_hir_wf_check#157856
Ijtihed wants to merge 5 commits into
rust-lang:mainfrom
Ijtihed:fix-ice-unexpected-node-synthetic

Conversation

@Ijtihed

@Ijtihed Ijtihed commented Jun 13, 2026

Copy link
Copy Markdown

Fixes #148630

diagnostic_hir_wf_check panics on Node::Synthetic when walking HIR types for WF error span refinement. RPITIT opaque types produce synthetic HIR nodes via query feeding and have no real HIR type to walk.

handle Node::Synthetic by returning an empty type list so the function returns None and the primary WF error is preserved with its original span. this is consistent with how other code handles synthetic nodes (e.g. reachable.rs, hir/mod.rs).

Added two regression tests from the issue.

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

rustbot commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 21 candidates

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

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 node Synthetic

4 participants