let predicates = item_predicates.filter_map(|obligation| {
let pred = obligation.predicate;
- match pred.kind() {
- ty::PredicateKind::Trait(tr, _) => {
- if let ty::Projection(p) = tr.skip_binder().self_ty().kind {
+ match pred.skip_binders() {
+ ty::PredicateAtom::Trait(tr, _) => {
+ if let ty::Projection(p) = tr.self_ty().kind {
if p == assoc_item_ty {
return Some(pred);
}
}
}
- ty::PredicateKind::Projection(proj) => {
- if let ty::Projection(p) = proj.skip_binder().projection_ty.self_ty().kind {
+ ty::PredicateAtom::Projection(proj) => {
+ if let ty::Projection(p) = proj.projection_ty.self_ty().kind {
if p == assoc_item_ty {
return Some(pred);
}
}
}
- ty::PredicateKind::TypeOutlives(outlives) => {
- if let ty::Projection(p) = outlives.skip_binder().0.kind {
+ ty::PredicateAtom::TypeOutlives(outlives) => {
+ if let ty::Projection(p) = outlives.0.kind {
if p == assoc_item_ty {
return Some(pred);
}
let filtered_predicates = predicates.filter_map(|obligation| {
let pred = obligation.predicate;
- match pred.kind() {
- ty::PredicateKind::Trait(tr, _) => {
- if let ty::Opaque(opaque_def_id, opaque_substs) = tr.skip_binder().self_ty().kind {
+ match pred.skip_binders() {
+ ty::PredicateAtom::Trait(tr, _) => {
+ if let ty::Opaque(opaque_def_id, opaque_substs) = tr.self_ty().kind {
if opaque_def_id == def_id && opaque_substs == substs {
return Some(pred);
}
}
}
- ty::PredicateKind::Projection(proj) => {
- if let ty::Opaque(opaque_def_id, opaque_substs) =
- proj.skip_binder().projection_ty.self_ty().kind
+ ty::PredicateAtom::Projection(proj) => {
+ if let ty::Opaque(opaque_def_id, opaque_substs) = proj.projection_ty.self_ty().kind
{
if opaque_def_id == def_id && opaque_substs == substs {
return Some(pred);
}
}
}
- ty::PredicateKind::TypeOutlives(outlives) => {
- if let ty::Opaque(opaque_def_id, opaque_substs) = outlives.skip_binder().0.kind {
+ ty::PredicateAtom::TypeOutlives(outlives) => {
+ if let ty::Opaque(opaque_def_id, opaque_substs) = outlives.0.kind {
if opaque_def_id == def_id && opaque_substs == substs {
return Some(pred);
}
}
}
// These can come from elaborating other predicates
- ty::PredicateKind::RegionOutlives(_) => return None,
+ ty::PredicateAtom::RegionOutlives(_) => return None,
_ => {}
}
tcx.sess.delay_span_bug(