]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_traits/implied_outlives_bounds.rs
introduce PredicateAtom
[rust.git] / src / librustc_traits / implied_outlives_bounds.rs
index bda3da120e958893fbfd7082413197d836f82317..de3096eac9b193df599036065968bbcfe796ac73 100644 (file)
@@ -95,29 +95,25 @@ fn compute_implied_outlives_bounds<'tcx>(
         implied_bounds.extend(obligations.into_iter().flat_map(|obligation| {
             assert!(!obligation.has_escaping_bound_vars());
             match obligation.predicate.kind() {
-                ty::PredicateKind::Trait(..)
-                | ty::PredicateKind::Subtype(..)
-                | ty::PredicateKind::Projection(..)
-                | ty::PredicateKind::ClosureKind(..)
-                | ty::PredicateKind::ObjectSafe(..)
-                | ty::PredicateKind::ConstEvaluatable(..)
-                | ty::PredicateKind::ConstEquate(..) => vec![],
-
-                &ty::PredicateKind::WellFormed(arg) => {
-                    wf_args.push(arg);
-                    vec![]
-                }
+                &ty::PredicateKind::ForAll(..) => vec![],
+                &ty::PredicateKind::Atom(atom) => match atom {
+                    ty::PredicateAtom::Trait(..)
+                    | ty::PredicateAtom::Subtype(..)
+                    | ty::PredicateAtom::Projection(..)
+                    | ty::PredicateAtom::ClosureKind(..)
+                    | ty::PredicateAtom::ObjectSafe(..)
+                    | ty::PredicateAtom::ConstEvaluatable(..)
+                    | ty::PredicateAtom::ConstEquate(..) => vec![],
+                    ty::PredicateAtom::WellFormed(arg) => {
+                        wf_args.push(arg);
+                        vec![]
+                    }
 
-                ty::PredicateKind::RegionOutlives(ref data) => match data.no_bound_vars() {
-                    None => vec![],
-                    Some(ty::OutlivesPredicate(r_a, r_b)) => {
+                    ty::PredicateAtom::RegionOutlives(ty::OutlivesPredicate(r_a, r_b)) => {
                         vec![OutlivesBound::RegionSubRegion(r_b, r_a)]
                     }
-                },
 
-                ty::PredicateKind::TypeOutlives(ref data) => match data.no_bound_vars() {
-                    None => vec![],
-                    Some(ty::OutlivesPredicate(ty_a, r_b)) => {
+                    ty::PredicateAtom::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);