@@ -13,7 +13,7 @@ use ty::{self, Ty, TyCtxt};
1313use hir:: def_id:: DefId ;
1414
1515use super :: { FulfillmentContext , FulfillmentError } ;
16- use super :: { ObligationCause , PredicateObligation , PendingPredicateObligation } ;
16+ use super :: { ObligationCause , PendingPredicateObligation , PredicateObligation } ;
1717
1818pub trait TraitEngine < ' tcx > {
1919 fn normalize_projection_type < ' a , ' gcx > (
@@ -52,18 +52,20 @@ pub trait TraitEngine<'tcx> {
5252 fn pending_obligations ( & self ) -> Vec < PendingPredicateObligation < ' tcx > > ;
5353}
5454
55- impl < ' a , ' gcx , ' tcx > dyn TraitEngine < ' tcx > +' tcx {
56- pub fn new ( _tcx : TyCtxt < ' _ , ' _ , ' tcx > ) -> Box < Self > {
57- Box :: new ( FulfillmentContext :: new ( ) )
58- }
55+ impl < ' a , ' gcx , ' tcx > TraitEngine < ' tcx > + ' tcx {
56+ pub fn new ( _tcx : TyCtxt < ' _ , ' _ , ' tcx > ) -> Box < Self > {
57+ Box :: new ( FulfillmentContext :: new ( ) )
58+ }
5959
60- pub fn register_predicate_obligations < I > ( & mut self ,
61- infcx : & InferCtxt < ' a , ' gcx , ' tcx > ,
62- obligations : I )
63- where I : IntoIterator < Item = PredicateObligation < ' tcx > >
64- {
65- for obligation in obligations {
66- self . register_predicate_obligation ( infcx, obligation) ;
67- }
68- }
60+ pub fn register_predicate_obligations < I > (
61+ & mut self ,
62+ infcx : & InferCtxt < ' a , ' gcx , ' tcx > ,
63+ obligations : I ,
64+ ) where
65+ I : IntoIterator < Item = PredicateObligation < ' tcx > > ,
66+ {
67+ for obligation in obligations {
68+ self . register_predicate_obligation ( infcx, obligation) ;
69+ }
70+ }
6971}
0 commit comments