Skip to content

Commit 4253153

Browse files
committedJan 17, 2021
Auto merge of #80679 - jackh726:predicate-kind-take2, r=lcnr
Remove PredicateKind and instead only use Binder<PredicateAtom> Originally brought up in #76814 (comment) r? `@lcnr`
2 parents 1f0fc02 + c4376ba commit 4253153

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+655
-759
lines changed
 

‎compiler/rustc_infer/src/infer/canonical/query_response.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,19 +530,18 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
530530

531531
let atom = match k1.unpack() {
532532
GenericArgKind::Lifetime(r1) => {
533-
ty::PredicateAtom::RegionOutlives(ty::OutlivesPredicate(r1, r2))
533+
ty::PredicateKind::RegionOutlives(ty::OutlivesPredicate(r1, r2))
534534
}
535535
GenericArgKind::Type(t1) => {
536-
ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(t1, r2))
536+
ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(t1, r2))
537537
}
538538
GenericArgKind::Const(..) => {
539539
// Consts cannot outlive one another, so we don't expect to
540540
// encounter this branch.
541541
span_bug!(cause.span, "unexpected const outlives {:?}", constraint);
542542
}
543543
};
544-
let predicate =
545-
predicate.rebind(atom).potentially_quantified(self.tcx, ty::PredicateKind::ForAll);
544+
let predicate = predicate.rebind(atom).to_predicate(self.tcx);
546545

547546
Obligation::new(cause.clone(), param_env, predicate)
548547
})
@@ -664,7 +663,7 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
664663
self.obligations.push(Obligation {
665664
cause: self.cause.clone(),
666665
param_env: self.param_env,
667-
predicate: ty::PredicateAtom::RegionOutlives(ty::OutlivesPredicate(sup, sub))
666+
predicate: ty::PredicateKind::RegionOutlives(ty::OutlivesPredicate(sup, sub))
668667
.to_predicate(self.infcx.tcx),
669668
recursion_depth: 0,
670669
});

‎compiler/rustc_infer/src/infer/combine.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
358358
self.obligations.push(Obligation::new(
359359
self.trace.cause.clone(),
360360
self.param_env,
361-
ty::PredicateAtom::WellFormed(b_ty.into()).to_predicate(self.infcx.tcx),
361+
ty::PredicateKind::WellFormed(b_ty.into()).to_predicate(self.infcx.tcx),
362362
));
363363
}
364364

@@ -451,9 +451,9 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
451451
b: &'tcx ty::Const<'tcx>,
452452
) {
453453
let predicate = if a_is_expected {
454-
ty::PredicateAtom::ConstEquate(a, b)
454+
ty::PredicateKind::ConstEquate(a, b)
455455
} else {
456-
ty::PredicateAtom::ConstEquate(b, a)
456+
ty::PredicateKind::ConstEquate(b, a)
457457
};
458458
self.obligations.push(Obligation::new(
459459
self.trace.cause.clone(),

0 commit comments

Comments
 (0)