about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/outlives/mod.rs
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2022-11-24 18:14:58 -0300
committerSantiago Pastorino <spastorino@gmail.com>2022-11-25 00:04:54 -0300
commit974e2837bb643a1213caeea4025f2f5681bd5f3e (patch)
treeef25aad9b89c8cb4f8f618f153c04f3dd2aa8b87 /compiler/rustc_hir_analysis/src/outlives/mod.rs
parent42cc8e8f4e5fe3864a9aca4f342ee2aff2ba696a (diff)
downloadrust-974e2837bb643a1213caeea4025f2f5681bd5f3e.tar.gz
rust-974e2837bb643a1213caeea4025f2f5681bd5f3e.zip
Introduce PredicateKind::Clause
Diffstat (limited to 'compiler/rustc_hir_analysis/src/outlives/mod.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/outlives/mod.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/rustc_hir_analysis/src/outlives/mod.rs b/compiler/rustc_hir_analysis/src/outlives/mod.rs
index ea0c2a20de3..c8f37176836 100644
--- a/compiler/rustc_hir_analysis/src/outlives/mod.rs
+++ b/compiler/rustc_hir_analysis/src/outlives/mod.rs
@@ -51,8 +51,10 @@ 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().skip_binder() {
-                            ty::PredicateKind::RegionOutlives(p) => p.to_string(),
-                            ty::PredicateKind::TypeOutlives(p) => p.to_string(),
+                            ty::PredicateKind::Clause(ty::Clause::RegionOutlives(p)) => {
+                                p.to_string()
+                            }
+                            ty::PredicateKind::Clause(ty::Clause::TypeOutlives(p)) => p.to_string(),
                             err => bug!("unexpected predicate {:?}", err),
                         })
                         .collect();
@@ -101,15 +103,17 @@ fn inferred_outlives_crate(tcx: TyCtxt<'_>, (): ()) -> CratePredicatesMap<'_> {
                 |(ty::OutlivesPredicate(kind1, region2), &span)| {
                     match kind1.unpack() {
                         GenericArgKind::Type(ty1) => Some((
-                            ty::Binder::dummy(ty::PredicateKind::TypeOutlives(
+                            ty::Binder::dummy(ty::PredicateKind::Clause(ty::Clause::TypeOutlives(
                                 ty::OutlivesPredicate(ty1, *region2),
-                            ))
+                            )))
                             .to_predicate(tcx),
                             span,
                         )),
                         GenericArgKind::Lifetime(region1) => Some((
-                            ty::Binder::dummy(ty::PredicateKind::RegionOutlives(
-                                ty::OutlivesPredicate(region1, *region2),
+                            ty::Binder::dummy(ty::PredicateKind::Clause(
+                                ty::Clause::RegionOutlives(ty::OutlivesPredicate(
+                                    region1, *region2,
+                                )),
                             ))
                             .to_predicate(tcx),
                             span,