]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_ty/ty.rs
Auto merge of #65989 - Aaron1011:fix/normalize-param-env, r=nikomatsakis
[rust.git] / src / librustc_ty / ty.rs
index c508fc5f89bae841109c87edc1634f8616a1c840..dfb28b473ff267c240981ae9f3bf78a58c4dcc33 100644 (file)
@@ -396,23 +396,23 @@ fn associated_type_projection_predicates(
 
     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);
                     }
@@ -447,25 +447,24 @@ fn opaque_type_projection_predicates(
 
     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);
                     }
@@ -475,7 +474,7 @@ fn opaque_type_projection_predicates(
                 }
             }
             // These can come from elaborating other predicates
-            ty::PredicateKind::RegionOutlives(_) => return None,
+            ty::PredicateAtom::RegionOutlives(_) => return None,
             _ => {}
         }
         tcx.sess.delay_span_bug(