Split super_predicates_that_define_assoc_type query from super_predicates_of

This commit is contained in:
Michael Goulet 2023-02-02 18:50:25 +00:00
parent 45749b21b7
commit 3dab259cb9
5 changed files with 10 additions and 12 deletions

View file

@ -64,8 +64,9 @@ pub fn provide(providers: &mut Providers) {
predicates_defined_on,
explicit_predicates_of: predicates_of::explicit_predicates_of,
super_predicates_of: predicates_of::super_predicates_of,
super_predicates_that_define_assoc_type:
predicates_of::super_predicates_that_define_assoc_type,
super_predicates_that_define_assoc_type: |tcx, (def_id, assoc_name)| {
predicates_of::super_predicates_that_define_assoc_type(tcx, (def_id, Some(assoc_name)))
},
trait_explicit_predicates_and_bounds: predicates_of::trait_explicit_predicates_and_bounds,
type_param_predicates: predicates_of::type_param_predicates,
trait_def,

View file

@ -1749,8 +1749,7 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
if trait_defines_associated_type_named(def_id) {
break Some(bound_vars.into_iter().collect());
}
let predicates =
tcx.super_predicates_that_define_assoc_type((def_id, Some(assoc_name)));
let predicates = tcx.super_predicates_that_define_assoc_type((def_id, assoc_name));
let obligations = predicates.predicates.iter().filter_map(|&(pred, _)| {
let bound_predicate = pred.kind();
match bound_predicate.skip_binder() {