]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/outlives/mod.rs
introduce PredicateAtom
[rust.git] / src / librustc_typeck / outlives / mod.rs
index 1b2b08a2e62eec6a7351469069bfa92eb2a2bf26..823a0235b176dd45527465a1720afce2c472ec2c 100644 (file)
@@ -13,7 +13,7 @@
 pub mod test;
 mod utils;
 
-pub fn provide(providers: &mut Providers<'_>) {
+pub fn provide(providers: &mut Providers) {
     *providers = Providers { inferred_outlives_of, inferred_outlives_crate, ..*providers };
 }
 
@@ -31,8 +31,12 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[(ty::Predicate
                     let mut pred: Vec<String> = predicates
                         .iter()
                         .map(|(out_pred, _)| match out_pred.kind() {
-                            ty::PredicateKind::RegionOutlives(p) => p.to_string(),
-                            ty::PredicateKind::TypeOutlives(p) => p.to_string(),
+                            ty::PredicateKind::Atom(ty::PredicateAtom::RegionOutlives(p)) => {
+                                p.to_string()
+                            }
+                            ty::PredicateKind::Atom(ty::PredicateAtom::TypeOutlives(p)) => {
+                                p.to_string()
+                            }
                             err => bug!("unexpected predicate {:?}", err),
                         })
                         .collect();
@@ -85,17 +89,17 @@ fn inferred_outlives_crate(tcx: TyCtxt<'_>, crate_num: CrateNum) -> CratePredica
                 |(ty::OutlivesPredicate(kind1, region2), &span)| {
                     match kind1.unpack() {
                         GenericArgKind::Type(ty1) => Some((
-                            ty::PredicateKind::TypeOutlives(ty::Binder::bind(
-                                ty::OutlivesPredicate(ty1, region2),
-                            ))
-                            .to_predicate(tcx),
+                            ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(ty1, region2))
+                                .to_predicate(tcx)
+                                .potentially_quantified(tcx, ty::PredicateKind::ForAll),
                             span,
                         )),
                         GenericArgKind::Lifetime(region1) => Some((
-                            ty::PredicateKind::RegionOutlives(ty::Binder::bind(
-                                ty::OutlivesPredicate(region1, region2),
+                            ty::PredicateAtom::RegionOutlives(ty::OutlivesPredicate(
+                                region1, region2,
                             ))
-                            .to_predicate(tcx),
+                            .to_predicate(tcx)
+                            .potentially_quantified(tcx, ty::PredicateKind::ForAll),
                             span,
                         )),
                         GenericArgKind::Const(_) => {