1
Fork 0

Stop using ty::GenericPredicates for non-predicates_of queries

This commit is contained in:
Michael Goulet 2024-08-29 00:17:40 -04:00
parent ac77e88f7a
commit 92004523db
20 changed files with 101 additions and 98 deletions

View file

@ -600,21 +600,19 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// Check supertraits hold. This is so that their associated type bounds
// will be checked in the code below.
for super_trait in tcx
for (supertrait, _) in tcx
.explicit_super_predicates_of(trait_predicate.def_id())
.instantiate(tcx, trait_predicate.trait_ref.args)
.predicates
.into_iter()
.iter_instantiated_copied(tcx, trait_predicate.trait_ref.args)
{
let normalized_super_trait = normalize_with_depth_to(
let normalized_supertrait = normalize_with_depth_to(
self,
obligation.param_env,
obligation.cause.clone(),
obligation.recursion_depth + 1,
super_trait,
supertrait,
&mut nested,
);
nested.push(obligation.with(tcx, normalized_super_trait));
nested.push(obligation.with(tcx, normalized_supertrait));
}
let assoc_types: Vec<_> = tcx