Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd2efff

Browse files
authored
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.
2 parents 0b127d8 + 0b6b330 commit cd2efff

19 files changed

+38
-1
lines changed

compiler/rustc_trait_selection/src/solve/assembly/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
274274

275275
let goal =
276276
goal.with(self.tcx(), goal.predicate.with_self_ty(self.tcx(), normalized_self_ty));
277-
debug_assert_eq!(goal, self.resolve_vars_if_possible(goal));
277+
// Vars that show up in the rest of the goal substs may have been constrained by
278+
// normalizing the self type as well, since type variables are not uniquified.
279+
let goal = self.resolve_vars_if_possible(goal);
278280

279281
let mut candidates = vec![];
280282

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)