]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/method/probe.rs
introduce PredicateAtom
[rust.git] / src / librustc_typeck / check / method / probe.rs
index 9c5e3cbc93844a338f77c3c6977b26e59a520e63..e569d1c443a6975641748bc3e976a2775121a569 100644 (file)
@@ -798,24 +798,23 @@ fn assemble_inherent_candidates_from_param(&mut self, param_ty: ty::ParamTy) {
         // FIXME: do we want to commit to this behavior for param bounds?
         debug!("assemble_inherent_candidates_from_param(param_ty={:?})", param_ty);
 
-        let bounds = self.param_env.caller_bounds().iter().filter_map(|predicate| match predicate
-            .kind()
+        let bounds = self.param_env.caller_bounds().iter().map(ty::Predicate::skip_binders).filter_map(|predicate| match predicate
         {
-            ty::PredicateKind::Trait(ref trait_predicate, _) => {
-                match trait_predicate.skip_binder().trait_ref.self_ty().kind {
-                    ty::Param(ref p) if *p == param_ty => Some(trait_predicate.to_poly_trait_ref()),
+            ty::PredicateAtom::Trait(trait_predicate, _) => {
+                match trait_predicate.trait_ref.self_ty().kind {
+                    ty::Param(ref p) if *p == param_ty => Some(ty::Binder::bind(trait_predicate.trait_ref)),
                     _ => None,
                 }
             }
-            ty::PredicateKind::Subtype(..)
-            | ty::PredicateKind::Projection(..)
-            | ty::PredicateKind::RegionOutlives(..)
-            | ty::PredicateKind::WellFormed(..)
-            | ty::PredicateKind::ObjectSafe(..)
-            | ty::PredicateKind::ClosureKind(..)
-            | ty::PredicateKind::TypeOutlives(..)
-            | ty::PredicateKind::ConstEvaluatable(..)
-            | ty::PredicateKind::ConstEquate(..) => None,
+            ty::PredicateAtom::Subtype(..)
+            | ty::PredicateAtom::Projection(..)
+            | ty::PredicateAtom::RegionOutlives(..)
+            | ty::PredicateAtom::WellFormed(..)
+            | ty::PredicateAtom::ObjectSafe(..)
+            | ty::PredicateAtom::ClosureKind(..)
+            | ty::PredicateAtom::TypeOutlives(..)
+            | ty::PredicateAtom::ConstEvaluatable(..)
+            | ty::PredicateAtom::ConstEquate(..) => None,
         });
 
         self.elaborate_bounds(bounds, |this, poly_trait_ref, item| {