let extra_predicates = extend.into_iter().chain(
icx.type_parameter_bounds_in_generics(ast_generics, param_id, ty, OnlySelfBounds(true))
.into_iter()
- .filter(|(predicate, _)| match predicate.kind() {
- ty::PredicateKind::Trait(ref data, _) => {
- data.skip_binder().self_ty().is_param(index)
- }
+ .filter(|(predicate, _)| match predicate.skip_binders() {
+ ty::PredicateAtom::Trait(data, _) => data.self_ty().is_param(index),
_ => false,
}),
);
// which will, in turn, reach indirect supertraits.
for &(pred, span) in superbounds {
debug!("superbound: {:?}", pred);
- if let ty::PredicateKind::Trait(bound, _) = pred.kind() {
+ if let ty::PredicateAtom::Trait(bound, _) = pred.skip_binders() {
tcx.at(span).super_predicates_of(bound.def_id());
}
}
&hir::GenericBound::Outlives(ref lifetime) => {
let region = AstConv::ast_region_to_region(&icx, lifetime, None);
- let pred = ty::Binder::bind(ty::OutlivesPredicate(ty, region));
predicates.push((
- ty::PredicateKind::TypeOutlives(pred).to_predicate(tcx),
+ ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(ty, region))
+ .to_predicate(tcx)
+ .potentially_quantified(tcx, ty::PredicateKind::ForAll),
lifetime.span,
))
}
}
_ => bug!(),
};
- let pred = ty::Binder::bind(ty::OutlivesPredicate(r1, r2));
+ let pred = ty::PredicateAtom::RegionOutlives(ty::OutlivesPredicate(r1, r2))
+ .to_predicate(icx.tcx);
- (ty::PredicateKind::RegionOutlives(pred).to_predicate(icx.tcx), span)
+ (pred.potentially_quantified(icx.tcx, ty::PredicateKind::ForAll), span)
}))
}
}
hir::GenericBound::Outlives(ref lifetime) => {
let region = astconv.ast_region_to_region(lifetime, None);
- let pred = ty::Binder::bind(ty::OutlivesPredicate(param_ty, region));
- vec![(ty::PredicateKind::TypeOutlives(pred).to_predicate(astconv.tcx()), lifetime.span)]
+ let pred = ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(param_ty, region))
+ .to_predicate(astconv.tcx())
+ .potentially_quantified(astconv.tcx(), ty::PredicateKind::ForAll);
+ vec![(pred, lifetime.span)]
}
}
}