Skip to content

Fix ICE on TypeTestError during speculative NLL solve - #159117

Open
mansiverma897993 wants to merge 1 commit into
rust-lang:mainfrom
mansiverma897993:fix-ice-typetesterror-159100
Open

Fix ICE on TypeTestError during speculative NLL solve#159117
mansiverma897993 wants to merge 1 commit into
rust-lang:mainfrom
mansiverma897993:fix-ice-typetesterror-159100

Conversation

@mansiverma897993

Copy link
Copy Markdown

This PR prevents registering a delayed bug during speculative NLL solve runs.

When solving NLL regions in helper/speculative contexts (e.g. compute_closure_requirements_modulo_opaques), any error generated is ignored and not emitted to the user. Registering a delayed bug for these ignored errors causes the compiler to panic/ICE at the end of compilation when no error has been emitted. This PR adds a speculative flag to prevent registering delayed bugs in such scenarios.

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

rustbot commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @wesleywiser (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: borrowck, compiler
  • borrowck, compiler expanded to 75 candidates
  • Random selection from 20 candidates

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@workingjubilee

workingjubilee commented Jul 12, 2026

Copy link
Copy Markdown
Member

Your fix appears to cause additional ICEs. Or at least not address them? Unclear.

It is often the case that an ICE should not be fixed by simply "fixing the ICE", but addressing the actual reason that the troublesome event occurred. That is, even if you can "make the error go away", the error being hit is a warning sign that there is a more fundamental issue with the codepath.

This particular reproduction requires generic_const_exprs which is a fairly broken feature planned for eventual removal, so changing the codebase at the current moment to make it less noisy may not be ideal if it does indeed require that feature to be hit.

@mansiverma897993

Copy link
Copy Markdown
Author

@workingjubilee Thanks for the clarification. I'll investigate the underlying cause in the speculative NLL path instead of only preventing the ICE, and update the PR accordingly.

@mansiverma897993

Copy link
Copy Markdown
Author

@workingjubilee I've updated the branch with the formatting fixes and resolved the tidy/lint failures. Let me know if you need anything else! Could you please take a look?

@workingjubilee

Copy link
Copy Markdown
Member

You did not actually reassess your approach as you suggested you would.

@mati865

mati865 commented Jul 22, 2026

Copy link
Copy Markdown
Member

@workingjubilee you'll be probably better off putting your energy elsewhere seeing how other PRs went: rust-lang/libc#5229

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.

6 participants