@@ -14,8 +14,8 @@ use rustc_middle::mir::ConstraintCategory;
1414use rustc_middle:: ty:: query:: Providers ;
1515use rustc_middle:: ty:: trait_def:: TraitSpecializationKind ;
1616use rustc_middle:: ty:: {
17- self , AdtKind , DefIdTree , GenericParamDefKind , ToPredicate , Ty , TyCtxt , TypeFoldable ,
18- TypeSuperVisitable , TypeVisitable , TypeVisitor ,
17+ self , AdtKind , DefIdTree , GenericParamDefKind , Ty , TyCtxt , TypeFoldable , TypeSuperVisitable ,
18+ TypeVisitable , TypeVisitor ,
1919} ;
2020use rustc_middle:: ty:: { GenericArgKind , InternalSubsts } ;
2121use rustc_session:: parse:: feature_err;
@@ -75,9 +75,10 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
7575 // for a type to be WF, we do not need to check if const trait predicates satisfy.
7676 let param_env = self . param_env . without_const ( ) ;
7777 self . ocx . register_obligation ( traits:: Obligation :: new (
78+ self . tcx ( ) ,
7879 cause,
7980 param_env,
80- ty:: Binder :: dummy ( ty:: PredicateKind :: WellFormed ( arg) ) . to_predicate ( self . tcx ( ) ) ,
81+ ty:: Binder :: dummy ( ty:: PredicateKind :: WellFormed ( arg) ) ,
8182 ) ) ;
8283 }
8384}
@@ -1111,12 +1112,12 @@ fn check_type_defn<'tcx>(tcx: TyCtxt<'tcx>, item: &hir::Item<'tcx>, all_sized: b
11111112 traits:: MiscObligation ,
11121113 ) ;
11131114 wfcx. register_obligation ( traits:: Obligation :: new (
1115+ tcx,
11141116 cause,
11151117 wfcx. param_env ,
11161118 ty:: Binder :: dummy ( ty:: PredicateKind :: ConstEvaluatable (
11171119 ty:: Const :: from_anon_const ( tcx, discr_def_id. expect_local ( ) ) ,
1118- ) )
1119- . to_predicate ( tcx) ,
1120+ ) ) ,
11201121 ) ) ;
11211122 }
11221123 }
@@ -1453,7 +1454,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
14531454 wfcx. body_id ,
14541455 traits:: ItemObligation ( def_id. to_def_id ( ) ) ,
14551456 ) ;
1456- traits:: Obligation :: new ( cause, wfcx. param_env , pred)
1457+ traits:: Obligation :: new ( tcx , cause, wfcx. param_env , pred)
14571458 } ) ;
14581459
14591460 let predicates = predicates. 0 . instantiate_identity ( tcx) ;
@@ -1783,8 +1784,7 @@ fn receiver_is_implemented<'tcx>(
17831784 substs : tcx. mk_substs_trait ( receiver_ty, & [ ] ) ,
17841785 } ) ;
17851786
1786- let obligation =
1787- traits:: Obligation :: new ( cause, wfcx. param_env , trait_ref. without_const ( ) . to_predicate ( tcx) ) ;
1787+ let obligation = traits:: Obligation :: new ( tcx, cause, wfcx. param_env , trait_ref. without_const ( ) ) ;
17881788
17891789 if wfcx. infcx . predicate_must_hold_modulo_regions ( & obligation) {
17901790 true
@@ -1931,6 +1931,7 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
19311931 }
19321932
19331933 let obligation = traits:: Obligation :: new (
1934+ tcx,
19341935 traits:: ObligationCause :: new ( span, self . body_id , traits:: TrivialBound ) ,
19351936 empty_env,
19361937 pred,
0 commit comments