shallow_resolve stalled vars + conservative include
diff --git a/compiler/rustc_trait_selection/src/solve/fulfill.rs b/compiler/rustc_trait_selection/src/solve/fulfill.rs index b30850d..e813519 100644 --- a/compiler/rustc_trait_selection/src/solve/fulfill.rs +++ b/compiler/rustc_trait_selection/src/solve/fulfill.rs
@@ -89,8 +89,14 @@ fn clone_pending_potentially_referencing_sub_root( .iter() .filter(|(_, stalled_on)| { let Some(stalled_on) = stalled_on else { return true }; + // Conservative here: if any of its stalled vars are not infer var anymore, + // some unification happened, so this goal is no longer stalled. + // So include it to re-evaluate in the downstream. stalled_on.stalled_vars.iter().filter_map(|arg| arg.as_type()).any(|ty| { - matches!(*ty.kind(), ty::Infer(ty::TyVar(tv)) if infcx.sub_unification_table_root_var(tv) == vid) + match *infcx.shallow_resolve(ty).kind() { + ty::Infer(ty::TyVar(tv)) => infcx.sub_unification_table_root_var(tv) == vid, + _ => true, + } }) }) .map(|(o, _)| o.clone())