diff --git a/src/librustc_infer/infer/canonical/query_response.rs b/src/librustc_infer/infer/canonical/query_response.rs index 89add21a7cd..c01759393df 100644 --- a/src/librustc_infer/infer/canonical/query_response.rs +++ b/src/librustc_infer/infer/canonical/query_response.rs @@ -670,10 +670,8 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> { self.obligations.push(Obligation { cause: self.cause.clone(), param_env: self.param_env, - predicate: ty::PredicateKind::RegionOutlives(ty::Binder::dummy(ty::OutlivesPredicate( - sup, sub, - ))) - .to_predicate(self.infcx.tcx), + predicate: ty::PredicateKint::RegionOutlives(ty::OutlivesPredicate(sup, sub)) + .to_predicate(self.infcx.tcx), recursion_depth: 0, }); } diff --git a/src/librustc_infer/infer/combine.rs b/src/librustc_infer/infer/combine.rs index c63464e5bae..e8ec5e651bb 100644 --- a/src/librustc_infer/infer/combine.rs +++ b/src/librustc_infer/infer/combine.rs @@ -308,7 +308,7 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> { self.obligations.push(Obligation::new( self.trace.cause.clone(), self.param_env, - ty::PredicateKind::WellFormed(b_ty.into()).to_predicate(self.infcx.tcx), + ty::PredicateKint::WellFormed(b_ty.into()).to_predicate(self.infcx.tcx), )); } @@ -400,9 +400,9 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> { b: &'tcx ty::Const<'tcx>, ) { let predicate = if a_is_expected { - ty::PredicateKind::ConstEquate(a, b) + ty::PredicateKint::ConstEquate(a, b) } else { - ty::PredicateKind::ConstEquate(b, a) + ty::PredicateKint::ConstEquate(b, a) }; self.obligations.push(Obligation::new( self.trace.cause.clone(), diff --git a/src/librustc_infer/infer/sub.rs b/src/librustc_infer/infer/sub.rs index d190f7e4342..50c1f491557 100644 --- a/src/librustc_infer/infer/sub.rs +++ b/src/librustc_infer/infer/sub.rs @@ -100,11 +100,11 @@ impl TypeRelation<'tcx> for Sub<'combine, 'infcx, 'tcx> { self.fields.obligations.push(Obligation::new( self.fields.trace.cause.clone(), self.fields.param_env, - ty::PredicateKind::Subtype(ty::Binder::dummy(ty::SubtypePredicate { + ty::PredicateKint::Subtype(ty::SubtypePredicate { a_is_expected: self.a_is_expected, a, b, - })) + }) .to_predicate(self.tcx()), )); diff --git a/src/librustc_infer/traits/util.rs b/src/librustc_infer/traits/util.rs index 957c993c4bf..ddb7e7adbc6 100644 --- a/src/librustc_infer/traits/util.rs +++ b/src/librustc_infer/traits/util.rs @@ -234,16 +234,16 @@ impl Elaborator<'tcx> { if r.is_late_bound() { None } else { - Some(ty::PredicateKind::RegionOutlives(ty::Binder::dummy( - ty::OutlivesPredicate(r, r_min), + Some(ty::PredicateKint::RegionOutlives(ty::OutlivesPredicate( + r, r_min, ))) } } Component::Param(p) => { let ty = tcx.mk_ty_param(p.index, p.name); - Some(ty::PredicateKind::TypeOutlives(ty::Binder::dummy( - ty::OutlivesPredicate(ty, r_min), + Some(ty::PredicateKint::TypeOutlives(ty::OutlivesPredicate( + ty, r_min, ))) } diff --git a/src/librustc_middle/ty/codec.rs b/src/librustc_middle/ty/codec.rs index a7c7b160480..b8e041a00ee 100644 --- a/src/librustc_middle/ty/codec.rs +++ b/src/librustc_middle/ty/codec.rs @@ -39,7 +39,7 @@ impl<'tcx> EncodableWithShorthand for Ty<'tcx> { } impl<'tcx> EncodableWithShorthand for ty::Predicate<'tcx> { - type Variant = ty::PredicateKind<'tcx>; + type Variant = ty::PredicateKynd<'tcx>; fn variant(&self) -> &Self::Variant { self.kind() } @@ -195,7 +195,7 @@ where }) } else { let tcx = decoder.tcx(); - Ok(tcx.mk_predicate(ty::PredicateKind::decode(decoder)?)) + Ok(tcx.mk_predicate(ty::PredicateKynd::decode(decoder)?)) } } diff --git a/src/librustc_mir/borrow_check/type_check/mod.rs b/src/librustc_mir/borrow_check/type_check/mod.rs index bede9b22bbb..5491c3fb248 100644 --- a/src/librustc_mir/borrow_check/type_check/mod.rs +++ b/src/librustc_mir/borrow_check/type_check/mod.rs @@ -27,8 +27,8 @@ use rustc_middle::ty::cast::CastTy; use rustc_middle::ty::fold::TypeFoldable; use rustc_middle::ty::subst::{GenericArgKind, Subst, SubstsRef, UserSubsts}; use rustc_middle::ty::{ - self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, RegionVid, ToPolyTraitRef, - ToPredicate, Ty, TyCtxt, UserType, UserTypeAnnotationIndex, + self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, RegionVid, ToPredicate, Ty, + TyCtxt, UserType, UserTypeAnnotationIndex, }; use rustc_span::{Span, DUMMY_SP}; use rustc_target::abi::VariantIdx; @@ -1021,7 +1021,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { } self.prove_predicate( - ty::PredicateKind::WellFormed(inferred_ty.into()).to_predicate(self.tcx()), + ty::PredicateKint::WellFormed(inferred_ty.into()).to_predicate(self.tcx()), Locations::All(span), ConstraintCategory::TypeAnnotation, ); @@ -1273,7 +1273,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { obligations.obligations.push(traits::Obligation::new( ObligationCause::dummy(), param_env, - ty::PredicateKind::WellFormed(revealed_ty.into()).to_predicate(infcx.tcx), + ty::PredicateKint::WellFormed(revealed_ty.into()).to_predicate(infcx.tcx), )); obligations.add( infcx @@ -1617,7 +1617,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { self.check_call_dest(body, term, &sig, destination, term_location); self.prove_predicates( - sig.inputs_and_output.iter().map(|ty| ty::PredicateKind::WellFormed(ty.into())), + sig.inputs_and_output.iter().map(|ty| ty::PredicateKint::WellFormed(ty.into())), term_location.to_locations(), ConstraintCategory::Boring, ); @@ -2706,8 +2706,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { category: ConstraintCategory, ) { self.prove_predicates( - Some(ty::PredicateKind::Trait( - trait_ref.to_poly_trait_ref().to_poly_trait_predicate(), + Some(ty::PredicateKint::Trait( + ty::TraitPredicate { trait_ref }, hir::Constness::NotConst, )), locations, diff --git a/src/librustc_trait_selection/traits/select/confirmation.rs b/src/librustc_trait_selection/traits/select/confirmation.rs index fa970589bbb..b9f39fd23cb 100644 --- a/src/librustc_trait_selection/traits/select/confirmation.rs +++ b/src/librustc_trait_selection/traits/select/confirmation.rs @@ -532,7 +532,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { obligations.push(Obligation::new( obligation.cause.clone(), obligation.param_env, - ty::PredicateKind::ClosureKind(closure_def_id, substs, kind) + ty::PredicateKint::ClosureKind(closure_def_id, substs, kind) .to_predicate(self.tcx()), )); } diff --git a/src/librustc_trait_selection/traits/wf.rs b/src/librustc_trait_selection/traits/wf.rs index 0e445e1e53b..4eb1d1856fb 100644 --- a/src/librustc_trait_selection/traits/wf.rs +++ b/src/librustc_trait_selection/traits/wf.rs @@ -316,7 +316,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> { traits::Obligation::new( new_cause, param_env, - ty::PredicateKind::WellFormed(arg).to_predicate(tcx), + ty::PredicateKint::WellFormed(arg).to_predicate(tcx), ) }), ); diff --git a/src/librustc_traits/type_op.rs b/src/librustc_traits/type_op.rs index 9cc9a35b38b..309de9bddb7 100644 --- a/src/librustc_traits/type_op.rs +++ b/src/librustc_traits/type_op.rs @@ -140,7 +140,7 @@ impl AscribeUserTypeCx<'me, 'tcx> { self.relate(self_ty, Variance::Invariant, impl_self_ty)?; self.prove_predicate( - ty::PredicateKind::WellFormed(impl_self_ty.into()).to_predicate(self.tcx()), + ty::PredicateKint::WellFormed(impl_self_ty.into()).to_predicate(self.tcx()), ); } @@ -155,7 +155,7 @@ impl AscribeUserTypeCx<'me, 'tcx> { // them? This would only be relevant if some input // type were ill-formed but did not appear in `ty`, // which...could happen with normalization... - self.prove_predicate(ty::PredicateKind::WellFormed(ty.into()).to_predicate(self.tcx())); + self.prove_predicate(ty::PredicateKint::WellFormed(ty.into()).to_predicate(self.tcx())); Ok(()) } } diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 64dce3e1738..ee27b581311 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -399,7 +399,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { obligations.push(traits::Obligation::new( cause, self.param_env, - ty::PredicateKind::WellFormed(method_ty.into()).to_predicate(tcx), + ty::PredicateKint::WellFormed(method_ty.into()).to_predicate(tcx), )); let callee = MethodCallee { def_id, substs: trait_ref.substs, sig: fn_sig }; diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 6e77aba3050..7a96d6c678a 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -3612,7 +3612,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { self.register_predicate(traits::Obligation::new( cause, self.param_env, - ty::PredicateKind::WellFormed(arg).to_predicate(self.tcx), + ty::PredicateKint::WellFormed(arg).to_predicate(self.tcx), )); }