@@ -14,8 +14,8 @@ use rustc_middle::mir::ConstraintCategory;
14
14
use rustc_middle:: ty:: query:: Providers ;
15
15
use rustc_middle:: ty:: trait_def:: TraitSpecializationKind ;
16
16
use 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 ,
19
19
} ;
20
20
use rustc_middle:: ty:: { GenericArgKind , InternalSubsts } ;
21
21
use rustc_session:: parse:: feature_err;
@@ -75,9 +75,10 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
75
75
// for a type to be WF, we do not need to check if const trait predicates satisfy.
76
76
let param_env = self . param_env . without_const ( ) ;
77
77
self . ocx . register_obligation ( traits:: Obligation :: new (
78
+ self . tcx ( ) ,
78
79
cause,
79
80
param_env,
80
- ty:: Binder :: dummy ( ty:: PredicateKind :: WellFormed ( arg) ) . to_predicate ( self . tcx ( ) ) ,
81
+ ty:: Binder :: dummy ( ty:: PredicateKind :: WellFormed ( arg) ) ,
81
82
) ) ;
82
83
}
83
84
}
@@ -1111,12 +1112,12 @@ fn check_type_defn<'tcx>(tcx: TyCtxt<'tcx>, item: &hir::Item<'tcx>, all_sized: b
1111
1112
traits:: MiscObligation ,
1112
1113
) ;
1113
1114
wfcx. register_obligation ( traits:: Obligation :: new (
1115
+ tcx,
1114
1116
cause,
1115
1117
wfcx. param_env ,
1116
1118
ty:: Binder :: dummy ( ty:: PredicateKind :: ConstEvaluatable (
1117
1119
ty:: Const :: from_anon_const ( tcx, discr_def_id. expect_local ( ) ) ,
1118
- ) )
1119
- . to_predicate ( tcx) ,
1120
+ ) ) ,
1120
1121
) ) ;
1121
1122
}
1122
1123
}
@@ -1453,7 +1454,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
1453
1454
wfcx. body_id ,
1454
1455
traits:: ItemObligation ( def_id. to_def_id ( ) ) ,
1455
1456
) ;
1456
- traits:: Obligation :: new ( cause, wfcx. param_env , pred)
1457
+ traits:: Obligation :: new ( tcx , cause, wfcx. param_env , pred)
1457
1458
} ) ;
1458
1459
1459
1460
let predicates = predicates. 0 . instantiate_identity ( tcx) ;
@@ -1783,8 +1784,7 @@ fn receiver_is_implemented<'tcx>(
1783
1784
substs : tcx. mk_substs_trait ( receiver_ty, & [ ] ) ,
1784
1785
} ) ;
1785
1786
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 ( ) ) ;
1788
1788
1789
1789
if wfcx. infcx . predicate_must_hold_modulo_regions ( & obligation) {
1790
1790
true
@@ -1931,6 +1931,7 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
1931
1931
}
1932
1932
1933
1933
let obligation = traits:: Obligation :: new (
1934
+ tcx,
1934
1935
traits:: ObligationCause :: new ( span, self . body_id , traits:: TrivialBound ) ,
1935
1936
empty_env,
1936
1937
pred,
0 commit comments