// could be extended easily also to the other `Predicate`.
let predicate_matches_closure = |p: Predicate<'tcx>| {
let mut relator: SimpleEqRelation<'tcx> = SimpleEqRelation::new(tcx, self_param_env);
- match (predicate.kind(), p.kind()) {
- (&ty::PredicateKind::Trait(a, _), &ty::PredicateKind::Trait(b, _)) => {
- relator.relate(a, b).is_ok()
+ match (predicate.skip_binders(), p.skip_binders()) {
+ (ty::PredicateAtom::Trait(a, _), ty::PredicateAtom::Trait(b, _)) => {
+ relator.relate(ty::Binder::bind(a), ty::Binder::bind(b)).is_ok()
}
- (&ty::PredicateKind::Projection(a), &ty::PredicateKind::Projection(b)) => {
- relator.relate(a, b).is_ok()
+ (ty::PredicateAtom::Projection(a), ty::PredicateAtom::Projection(b)) => {
+ relator.relate(ty::Binder::bind(a), ty::Binder::bind(b)).is_ok()
}
_ => predicate == p,
}