// this is kind of ugly.
|self_ty: Ty<'tcx>, parent_pred: &ty::Predicate<'tcx>, obligation: &str| {
// We don't care about regions here, so it's fine to skip the binder here.
- if let (ty::Param(_), ty::PredicateKind::Trait(p, _)) = (
- &self_ty.kind,
- parent_pred.ignore_qualifiers(tcx).skip_binder().kind(),
- ) {
+ if let (ty::Param(_), ty::PredicateAtom::Trait(p, _)) =
+ (&self_ty.kind, parent_pred.skip_binders())
+ {
if let ty::Adt(def, _) = p.trait_ref.self_ty().kind {
let node = def.did.as_local().map(|def_id| {
self.tcx.hir().get(self.tcx.hir().as_local_hir_id(def_id))
}
};
let mut format_pred = |pred: ty::Predicate<'tcx>| {
- // TODO: forall
- match pred.ignore_qualifiers(tcx).skip_binder().kind() {
- &ty::PredicateKind::Projection(pred) => {
+ match pred.skip_binders() {
+ ty::PredicateAtom::Projection(pred) => {
let pred = ty::Binder::bind(pred);
// `<Foo as Iterator>::Item = String`.
let trait_ref =
bound_span_label(trait_ref.self_ty(), &obligation, &quiet);
Some((obligation, trait_ref.self_ty()))
}
- &ty::PredicateKind::Trait(poly_trait_ref, _) => {
+ ty::PredicateAtom::Trait(poly_trait_ref, _) => {
let poly_trait_ref = ty::Binder::bind(poly_trait_ref);
let p = poly_trait_ref.skip_binder().trait_ref;
let self_ty = p.self_ty();
// implementing a trait would be legal but is rejected
// here).
unsatisfied_predicates.iter().all(|(p, _)| {
- match p.ignore_qualifiers(self.tcx).skip_binder().kind() {
+ match p.skip_binders() {
// Hide traits if they are present in predicates as they can be fixed without
// having to implement them.
- ty::PredicateKind::Trait(t, _) => t.def_id() == info.def_id,
- ty::PredicateKind::Projection(p) => {
+ ty::PredicateAtom::Trait(t, _) => t.def_id() == info.def_id,
+ ty::PredicateAtom::Projection(p) => {
p.projection_ty.item_def_id == info.def_id
}
_ => false,