@@ -39,7 +39,7 @@ pub struct CombineFields<'infcx, 'tcx> {
3939 pub infcx : & ' infcx InferCtxt < ' tcx > ,
4040 pub trace : TypeTrace < ' tcx > ,
4141 pub param_env : ty:: ParamEnv < ' tcx > ,
42- pub obligations : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
42+ pub goals : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
4343 pub define_opaque_types : DefineOpaqueTypes ,
4444}
4545
@@ -50,11 +50,11 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
5050 param_env : ty:: ParamEnv < ' tcx > ,
5151 define_opaque_types : DefineOpaqueTypes ,
5252 ) -> Self {
53- Self { infcx, trace, param_env, define_opaque_types, obligations : vec ! [ ] }
53+ Self { infcx, trace, param_env, define_opaque_types, goals : vec ! [ ] }
5454 }
5555
5656 pub ( crate ) fn into_obligations ( self ) -> Vec < PredicateObligation < ' tcx > > {
57- self . obligations
57+ self . goals
5858 . into_iter ( )
5959 . map ( |goal| {
6060 Obligation :: new (
@@ -76,7 +76,7 @@ impl<'tcx> InferCtxt<'tcx> {
7676 b : Ty < ' tcx > ,
7777 ) -> RelateResult < ' tcx , Ty < ' tcx > >
7878 where
79- R : ObligationEmittingRelation < ' tcx > ,
79+ R : PredicateEmittingRelation < ' tcx > ,
8080 {
8181 debug_assert ! ( !a. has_escaping_bound_vars( ) ) ;
8282 debug_assert ! ( !b. has_escaping_bound_vars( ) ) ;
@@ -140,7 +140,7 @@ impl<'tcx> InferCtxt<'tcx> {
140140 relate:: structurally_relate_tys ( relation, a, b)
141141 }
142142 StructurallyRelateAliases :: No => {
143- relation. register_type_relate_obligation ( a, b) ;
143+ relation. register_alias_relate_predicate ( a, b) ;
144144 Ok ( a)
145145 }
146146 }
@@ -171,7 +171,7 @@ impl<'tcx> InferCtxt<'tcx> {
171171 b : ty:: Const < ' tcx > ,
172172 ) -> RelateResult < ' tcx , ty:: Const < ' tcx > >
173173 where
174- R : ObligationEmittingRelation < ' tcx > ,
174+ R : PredicateEmittingRelation < ' tcx > ,
175175 {
176176 debug ! ( "{}.consts({:?}, {:?})" , relation. tag( ) , a, b) ;
177177 debug_assert ! ( !a. has_escaping_bound_vars( ) ) ;
@@ -309,22 +309,22 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
309309 & mut self ,
310310 obligations : impl IntoIterator < Item = Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
311311 ) {
312- self . obligations . extend ( obligations) ;
312+ self . goals . extend ( obligations) ;
313313 }
314314
315315 pub fn register_predicates (
316316 & mut self ,
317317 obligations : impl IntoIterator < Item : Upcast < TyCtxt < ' tcx > , ty:: Predicate < ' tcx > > > ,
318318 ) {
319- self . obligations . extend (
319+ self . goals . extend (
320320 obligations
321321 . into_iter ( )
322322 . map ( |to_pred| Goal :: new ( self . infcx . tcx , self . param_env , to_pred) ) ,
323323 )
324324 }
325325}
326326
327- pub trait ObligationEmittingRelation < ' tcx > : TypeRelation < TyCtxt < ' tcx > > {
327+ pub trait PredicateEmittingRelation < ' tcx > : TypeRelation < TyCtxt < ' tcx > > {
328328 fn span ( & self ) -> Span ;
329329
330330 fn param_env ( & self ) -> ty:: ParamEnv < ' tcx > ;
@@ -335,19 +335,18 @@ pub trait ObligationEmittingRelation<'tcx>: TypeRelation<TyCtxt<'tcx>> {
335335 fn structurally_relate_aliases ( & self ) -> StructurallyRelateAliases ;
336336
337337 /// Register obligations that must hold in order for this relation to hold
338- fn register_obligations (
338+ fn register_goals (
339339 & mut self ,
340340 obligations : impl IntoIterator < Item = Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
341341 ) ;
342342
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.
346345 fn register_predicates (
347346 & mut self ,
348347 obligations : impl IntoIterator < Item : Upcast < TyCtxt < ' tcx > , ty:: Predicate < ' tcx > > > ,
349348 ) ;
350349
351350 /// 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 > ) ;
353352}
0 commit comments