@@ -45,9 +45,8 @@ use rustc_middle::ty::{self, InferConst, ToPredicate, Ty, TyCtxt, TypeFoldable};
4545use rustc_middle:: ty:: { IntType , UintType } ;
4646use rustc_span:: { Span , DUMMY_SP } ;
4747
48- #[ derive( Clone ) ]
49- pub struct CombineFields < ' infcx , ' tcx > {
50- pub infcx : & ' infcx InferCtxt < ' infcx , ' tcx > ,
48+ pub struct CombineFields < ' a , ' infcx , ' tcx > {
49+ pub infcx : & ' a mut InferCtxt < ' infcx , ' tcx > ,
5150 pub trace : TypeTrace < ' tcx > ,
5251 pub cause : Option < ty:: relate:: Cause > ,
5352 pub param_env : ty:: ParamEnv < ' tcx > ,
@@ -285,24 +284,24 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> {
285284 }
286285}
287286
288- impl < ' infcx , ' tcx > CombineFields < ' infcx , ' tcx > {
287+ impl < ' infcx_borrow , ' infcx , ' tcx > CombineFields < ' infcx_borrow , ' infcx , ' tcx > {
289288 pub fn tcx ( & self ) -> TyCtxt < ' tcx > {
290289 self . infcx . tcx
291290 }
292291
293- pub fn equate < ' a > ( & ' a mut self , a_is_expected : bool ) -> Equate < ' a , ' infcx , ' tcx > {
292+ pub fn equate < ' a > ( & ' a mut self , a_is_expected : bool ) -> Equate < ' a , ' infcx_borrow , ' infcx , ' tcx > {
294293 Equate :: new ( self , a_is_expected)
295294 }
296295
297- pub fn sub < ' a > ( & ' a mut self , a_is_expected : bool ) -> Sub < ' a , ' infcx , ' tcx > {
296+ pub fn sub < ' a > ( & ' a mut self , a_is_expected : bool ) -> Sub < ' a , ' infcx_borrow , ' infcx , ' tcx > {
298297 Sub :: new ( self , a_is_expected)
299298 }
300299
301- pub fn lub < ' a > ( & ' a mut self , a_is_expected : bool ) -> Lub < ' a , ' infcx , ' tcx > {
300+ pub fn lub < ' a > ( & ' a mut self , a_is_expected : bool ) -> Lub < ' a , ' infcx_borrow , ' infcx , ' tcx > {
302301 Lub :: new ( self , a_is_expected)
303302 }
304303
305- pub fn glb < ' a > ( & ' a mut self , a_is_expected : bool ) -> Glb < ' a , ' infcx , ' tcx > {
304+ pub fn glb < ' a > ( & ' a mut self , a_is_expected : bool ) -> Glb < ' a , ' infcx_borrow , ' infcx , ' tcx > {
306305 Glb :: new ( self , a_is_expected)
307306 }
308307
@@ -456,11 +455,11 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
456455 }
457456}
458457
459- struct Generalizer < ' cx , ' tcx > {
460- infcx : & ' cx InferCtxt < ' cx , ' tcx > ,
458+ struct Generalizer < ' a , ' cx , ' tcx > {
459+ infcx : & ' a mut InferCtxt < ' cx , ' tcx > ,
461460
462461 /// The span, used when creating new type variables and things.
463- cause : & ' cx ObligationCause < ' tcx > ,
462+ cause : & ' a ObligationCause < ' tcx > ,
464463
465464 /// The vid of the type variable that is in the process of being
466465 /// instantiated; if we find this within the type we are folding,
@@ -520,7 +519,7 @@ struct Generalization<'tcx> {
520519 needs_wf : bool ,
521520}
522521
523- impl TypeRelation < ' tcx > for Generalizer < ' _ , ' tcx > {
522+ impl TypeRelation < ' tcx > for Generalizer < ' _ , ' _ , ' tcx > {
524523 fn tcx ( & self ) -> TyCtxt < ' tcx > {
525524 self . infcx . tcx
526525 }
0 commit comments