change HIR typeck unification handling approach

This commit is contained in:
lcnr
2025-08-22 13:39:38 +02:00
parent 831e291d3b
commit 17ac2fc96d
25 changed files with 168 additions and 128 deletions

View File

@@ -252,7 +252,9 @@ where
// inside of an opaque type, e.g. if there's `Opaque = (?x, ?x)` in the
// storage, we can also rely on structural identity of `?x` even if we
// later uniquify it in MIR borrowck.
if infcx.in_hir_typeck && obligation.has_non_region_infer() {
if infcx.in_hir_typeck
&& (obligation.has_non_region_infer() || obligation.has_free_regions())
{
infcx.push_hir_typeck_potentially_region_dependent_goal(obligation);
}
}