]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/constrained_generic_params.rs
introduce PredicateAtom
[rust.git] / src / librustc_typeck / constrained_generic_params.rs
index 34497d12a4ecefec6a8608f34ce5efa9d41286ad..7c80315ee194d52c5cf0f183f2918c79a182e8a6 100644 (file)
@@ -180,11 +180,9 @@ pub fn setup_constraining_predicates<'tcx>(
         changed = false;
 
         for j in i..predicates.len() {
-            if let ty::PredicateKind::Projection(ref poly_projection) = predicates[j].0.kind() {
-                // Note that we can skip binder here because the impl
-                // trait ref never contains any late-bound regions.
-                let projection = poly_projection.skip_binder();
-
+            // Note that we don't have to care about binders here,
+            // as the impl trait ref never contains any late-bound regions.
+            if let ty::PredicateAtom::Projection(projection) = predicates[j].0.skip_binders() {
                 // Special case: watch out for some kind of sneaky attempt
                 // to project out an associated type defined by this very
                 // trait.