1
Fork 0

Make queries more explicit

This commit is contained in:
Michael Goulet 2024-06-27 12:01:49 -04:00
parent 036b38ced3
commit 81c2c57519
22 changed files with 68 additions and 59 deletions

View file

@ -187,7 +187,7 @@ fn predicates_reference_self(
) -> SmallVec<[Span; 1]> {
let trait_ref = ty::Binder::dummy(ty::TraitRef::identity(tcx, trait_def_id));
let predicates = if supertraits_only {
tcx.super_predicates_of(trait_def_id)
tcx.explicit_super_predicates_of(trait_def_id)
} else {
tcx.predicates_of(trait_def_id)
};
@ -256,7 +256,7 @@ fn super_predicates_have_non_lifetime_binders(
if !tcx.features().non_lifetime_binders {
return SmallVec::new();
}
tcx.super_predicates_of(trait_def_id)
tcx.explicit_super_predicates_of(trait_def_id)
.predicates
.iter()
.filter_map(|(pred, span)| pred.has_non_region_bound_vars().then_some(*span))

View file

@ -574,7 +574,7 @@ 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
.super_predicates_of(trait_predicate.def_id())
.explicit_super_predicates_of(trait_predicate.def_id())
.instantiate(tcx, trait_predicate.trait_ref.args)
.predicates
.into_iter()

View file

@ -128,7 +128,7 @@ impl<'tcx> TraitAliasExpander<'tcx> {
}
// Get components of trait alias.
let predicates = tcx.super_predicates_of(trait_ref.def_id());
let predicates = tcx.explicit_super_predicates_of(trait_ref.def_id());
debug!(?predicates);
let items = predicates.predicates.iter().rev().filter_map(|(pred, span)| {

View file

@ -117,7 +117,7 @@ fn prepare_vtable_segments_inner<'tcx, T>(
let &(inner_most_trait_ref, _, _) = stack.last().unwrap();
let mut direct_super_traits_iter = tcx
.super_predicates_of(inner_most_trait_ref.def_id())
.explicit_super_predicates_of(inner_most_trait_ref.def_id())
.predicates
.into_iter()
.filter_map(move |(pred, _)| {