]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_traits/src/implied_outlives_bounds.rs
Rollup merge of #81879 - imbrem:make-reverse-repr-transparent, r=m-ou-se
[rust.git] / compiler / rustc_traits / src / implied_outlives_bounds.rs
index dc2eaf82d092c51566e4d69e6320224c1e461190..90ba90259c32bcd2b11a4a9127c9e9f60c79a368 100644 (file)
@@ -94,35 +94,33 @@ fn compute_implied_outlives_bounds<'tcx>(
         // region relationships.
         implied_bounds.extend(obligations.into_iter().flat_map(|obligation| {
             assert!(!obligation.has_escaping_bound_vars());
-            let binder = obligation.predicate.bound_atom();
-            if binder.skip_binder().has_escaping_bound_vars() {
-                vec![]
-            } else {
-                match binder.skip_binder() {
-                    ty::PredicateAtom::Trait(..)
-                    | ty::PredicateAtom::Subtype(..)
-                    | ty::PredicateAtom::Projection(..)
-                    | ty::PredicateAtom::ClosureKind(..)
-                    | ty::PredicateAtom::ObjectSafe(..)
-                    | ty::PredicateAtom::ConstEvaluatable(..)
-                    | ty::PredicateAtom::ConstEquate(..)
-                    | ty::PredicateAtom::TypeWellFormedFromEnv(..) => vec![],
-                    ty::PredicateAtom::WellFormed(arg) => {
+            match obligation.predicate.kind().no_bound_vars() {
+                None => vec![],
+                Some(pred) => match pred {
+                    ty::PredicateKind::Trait(..)
+                    | ty::PredicateKind::Subtype(..)
+                    | ty::PredicateKind::Projection(..)
+                    | ty::PredicateKind::ClosureKind(..)
+                    | ty::PredicateKind::ObjectSafe(..)
+                    | ty::PredicateKind::ConstEvaluatable(..)
+                    | ty::PredicateKind::ConstEquate(..)
+                    | ty::PredicateKind::TypeWellFormedFromEnv(..) => vec![],
+                    ty::PredicateKind::WellFormed(arg) => {
                         wf_args.push(arg);
                         vec![]
                     }
 
-                    ty::PredicateAtom::RegionOutlives(ty::OutlivesPredicate(r_a, r_b)) => {
+                    ty::PredicateKind::RegionOutlives(ty::OutlivesPredicate(r_a, r_b)) => {
                         vec![OutlivesBound::RegionSubRegion(r_b, r_a)]
                     }
 
-                    ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(ty_a, r_b)) => {
+                    ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(ty_a, r_b)) => {
                         let ty_a = infcx.resolve_vars_if_possible(ty_a);
                         let mut components = smallvec![];
                         tcx.push_outlives_components(ty_a, &mut components);
                         implied_bounds_from_components(r_b, components)
                     }
-                }
+                },
             }
         }));
     }