Introduce DeepRejectCtxt::substs_refs_may_unify.
It factors out a repeated code pattern.
This commit is contained in:
@@ -2542,8 +2542,10 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
|
||||
// substitution if we find that any of the input types, when
|
||||
// simplified, do not match.
|
||||
let drcx = DeepRejectCtxt { treat_obligation_params: TreatParams::ForLookup };
|
||||
iter::zip(obligation.predicate.skip_binder().trait_ref.substs, impl_trait_ref.substs)
|
||||
.any(|(obl, imp)| !drcx.generic_args_may_unify(obl, imp))
|
||||
!drcx.substs_refs_may_unify(
|
||||
obligation.predicate.skip_binder().trait_ref.substs,
|
||||
impl_trait_ref.substs,
|
||||
)
|
||||
}
|
||||
|
||||
/// Normalize `where_clause_trait_ref` and try to match it against
|
||||
|
||||
Reference in New Issue
Block a user