Avoid ICE when handling const auto traits in the next-gen solver

This commit is contained in:
lapla 2025-11-26 01:02:01 +09:00
parent 3326fbd1f4
commit ae699c8e78
No known key found for this signature in database
GPG key ID: B39C71D9F127FF9F
3 changed files with 27 additions and 4 deletions

View file

@ -189,10 +189,11 @@ where
}
fn consider_auto_trait_candidate(
_ecx: &mut EvalCtxt<'_, D>,
ecx: &mut EvalCtxt<'_, D>,
_goal: Goal<I, Self>,
) -> Result<Candidate<I>, NoSolution> {
unreachable!("auto traits are never const")
ecx.cx().delay_bug("auto traits are never const");
Err(NoSolution)
}
fn consider_trait_alias_candidate(