Skip to content

Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented#152287

Open
jakubadamw wants to merge 2 commits intorust-lang:mainfrom
jakubadamw:issue-137190
Open

Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented#152287
jakubadamw wants to merge 2 commits intorust-lang:mainfrom
jakubadamw:issue-137190

Conversation

@jakubadamw
Copy link
Contributor

@jakubadamw jakubadamw commented Feb 7, 2026

compiler/rustc_trait_selection/src/traits/vtable.rs@vtable_entries:

The impossible predicates check in vtable_entries used instantiate_own which only includes the method's own where clauses, without the parent trait's bounds. Replace it with instantiate_and_check_impossible_predicates which also checks the trait ref itself, so unsatisfied supertrait bounds are caught and the method is marked Vacant instead of ICEing.

Closes #137190.
Closes #135470.

…l when a supertrait not implemented

compiler/rustc_trait_selection/src/traits/vtable.rs@`vtable_entries`:
The impossible predicates check in `vtable_entries` used
`instantiate_own` which only includes the method's own where-clauses,
not the parent trait's bounds. Replace it with
`instantiate_and_check_impossible_predicates` which also checks the
trait ref itself, so unsatisfied supertrait bounds are caught
and the method is marked `Vacant` instead of ICEing.
@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 Feb 7, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 7, 2026

r? @petrochenkov

rustbot has assigned @petrochenkov.
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 21 candidates
  • Random selection from 12 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: Failed to resolve instance for <() as Supertrait<()>>::method ICE: invalid CoerceUnsized impl_source: Err(FulfillmentError)

3 participants