@@ -39,7 +39,7 @@ pub struct CombineFields<'infcx, 'tcx> {
39
39
pub infcx : & ' infcx InferCtxt < ' tcx > ,
40
40
pub trace : TypeTrace < ' tcx > ,
41
41
pub param_env : ty:: ParamEnv < ' tcx > ,
42
- pub obligations : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
42
+ pub goals : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
43
43
pub define_opaque_types : DefineOpaqueTypes ,
44
44
}
45
45
@@ -50,11 +50,11 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
50
50
param_env : ty:: ParamEnv < ' tcx > ,
51
51
define_opaque_types : DefineOpaqueTypes ,
52
52
) -> Self {
53
- Self { infcx, trace, param_env, define_opaque_types, obligations : vec ! [ ] }
53
+ Self { infcx, trace, param_env, define_opaque_types, goals : vec ! [ ] }
54
54
}
55
55
56
56
pub ( crate ) fn into_obligations ( self ) -> Vec < PredicateObligation < ' tcx > > {
57
- self . obligations
57
+ self . goals
58
58
. into_iter ( )
59
59
. map ( |goal| {
60
60
Obligation :: new (
@@ -76,7 +76,7 @@ impl<'tcx> InferCtxt<'tcx> {
76
76
b : Ty < ' tcx > ,
77
77
) -> RelateResult < ' tcx , Ty < ' tcx > >
78
78
where
79
- R : ObligationEmittingRelation < ' tcx > ,
79
+ R : PredicateEmittingRelation < ' tcx > ,
80
80
{
81
81
debug_assert ! ( !a. has_escaping_bound_vars( ) ) ;
82
82
debug_assert ! ( !b. has_escaping_bound_vars( ) ) ;
@@ -140,7 +140,7 @@ impl<'tcx> InferCtxt<'tcx> {
140
140
relate:: structurally_relate_tys ( relation, a, b)
141
141
}
142
142
StructurallyRelateAliases :: No => {
143
- relation. register_type_relate_obligation ( a, b) ;
143
+ relation. register_alias_relate_predicate ( a, b) ;
144
144
Ok ( a)
145
145
}
146
146
}
@@ -171,7 +171,7 @@ impl<'tcx> InferCtxt<'tcx> {
171
171
b : ty:: Const < ' tcx > ,
172
172
) -> RelateResult < ' tcx , ty:: Const < ' tcx > >
173
173
where
174
- R : ObligationEmittingRelation < ' tcx > ,
174
+ R : PredicateEmittingRelation < ' tcx > ,
175
175
{
176
176
debug ! ( "{}.consts({:?}, {:?})" , relation. tag( ) , a, b) ;
177
177
debug_assert ! ( !a. has_escaping_bound_vars( ) ) ;
@@ -309,22 +309,22 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
309
309
& mut self ,
310
310
obligations : impl IntoIterator < Item = Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
311
311
) {
312
- self . obligations . extend ( obligations) ;
312
+ self . goals . extend ( obligations) ;
313
313
}
314
314
315
315
pub fn register_predicates (
316
316
& mut self ,
317
317
obligations : impl IntoIterator < Item : Upcast < TyCtxt < ' tcx > , ty:: Predicate < ' tcx > > > ,
318
318
) {
319
- self . obligations . extend (
319
+ self . goals . extend (
320
320
obligations
321
321
. into_iter ( )
322
322
. map ( |to_pred| Goal :: new ( self . infcx . tcx , self . param_env , to_pred) ) ,
323
323
)
324
324
}
325
325
}
326
326
327
- pub trait ObligationEmittingRelation < ' tcx > : TypeRelation < TyCtxt < ' tcx > > {
327
+ pub trait PredicateEmittingRelation < ' tcx > : TypeRelation < TyCtxt < ' tcx > > {
328
328
fn span ( & self ) -> Span ;
329
329
330
330
fn param_env ( & self ) -> ty:: ParamEnv < ' tcx > ;
@@ -335,19 +335,18 @@ pub trait ObligationEmittingRelation<'tcx>: TypeRelation<TyCtxt<'tcx>> {
335
335
fn structurally_relate_aliases ( & self ) -> StructurallyRelateAliases ;
336
336
337
337
/// Register obligations that must hold in order for this relation to hold
338
- fn register_obligations (
338
+ fn register_goals (
339
339
& mut self ,
340
340
obligations : impl IntoIterator < Item = Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
341
341
) ;
342
342
343
- /// Register predicates that must hold in order for this relation to hold. Uses
344
- /// a default obligation cause, [`ObligationEmittingRelation::register_obligations`] should
345
- /// be used if control over the obligation causes is required.
343
+ /// Register predicates that must hold in order for this relation to hold.
344
+ /// This uses the default `param_env` of the obligation.
346
345
fn register_predicates (
347
346
& mut self ,
348
347
obligations : impl IntoIterator < Item : Upcast < TyCtxt < ' tcx > , ty:: Predicate < ' tcx > > > ,
349
348
) ;
350
349
351
350
/// Register `AliasRelate` obligation(s) that both types must be related to each other.
352
- fn register_type_relate_obligation ( & mut self , a : Ty < ' tcx > , b : Ty < ' tcx > ) ;
351
+ fn register_alias_relate_predicate ( & mut self , a : Ty < ' tcx > , b : Ty < ' tcx > ) ;
353
352
}
0 commit comments