1
Fork 0

Rollup merge of #122319 - compiler-errors:next-solver-normalizing-self-constrains-args, r=lcnr

Don't ICE when non-self part of trait goal is constrained in new solver

Self-explanatory. See test for example when this can happen.
This commit is contained in:
Matthias Krüger 2024-03-12 06:29:04 +01:00 committed by GitHub
commit cd2efff518
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 38 additions and 1 deletions

View file

@ -274,7 +274,9 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
let goal =
goal.with(self.tcx(), goal.predicate.with_self_ty(self.tcx(), normalized_self_ty));
debug_assert_eq!(goal, self.resolve_vars_if_possible(goal));
// Vars that show up in the rest of the goal substs may have been constrained by
// normalizing the self type as well, since type variables are not uniquified.
let goal = self.resolve_vars_if_possible(goal);
let mut candidates = vec![];