@@ -384,22 +384,22 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
384384 /// Divides the closure substs into their respective
385385 /// components. Single source of truth with respect to the
386386 /// ordering.
387- fn split ( self , def_id : DefId , tcx : TyCtxt < ' _ > ) -> SplitClosureSubsts < ' tcx > {
387+ fn split ( & self , def_id : DefId , tcx : TyCtxt < ' _ > ) -> SplitClosureSubsts < ' _ > {
388388 let generics = tcx. generics_of ( def_id) ;
389389 let parent_len = generics. parent_count ;
390390 SplitClosureSubsts {
391- closure_kind_ty : self . substs . type_at ( parent_len) ,
392- closure_sig_ty : self . substs . type_at ( parent_len + 1 ) ,
393- upvar_kinds : & self . substs [ parent_len + 2 ..] ,
391+ closure_kind_ty : self . type_at ( parent_len) ,
392+ closure_sig_ty : self . type_at ( parent_len + 1 ) ,
393+ upvar_kinds : & self [ parent_len + 2 ..] ,
394394 }
395395 }
396396
397397 #[ inline]
398398 pub fn upvar_tys (
399- & self ,
399+ & ' a self ,
400400 def_id : DefId ,
401401 tcx : TyCtxt < ' _ > ,
402- ) -> impl Iterator < Item = Ty < ' tcx > > + ' tcx {
402+ ) -> impl Iterator < Item = Ty < ' a > > + ' a {
403403 let SplitClosureSubsts { upvar_kinds, .. } = self . split ( def_id, tcx) ;
404404 upvar_kinds. iter ( ) . map ( |t| {
405405 if let UnpackedKind :: Type ( ty) = t. unpack ( ) {
@@ -413,15 +413,15 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
413413 /// Returns the closure kind for this closure; may return a type
414414 /// variable during inference. To get the closure kind during
415415 /// inference, use `infcx.closure_kind(def_id, substs)`.
416- pub fn closure_kind_ty ( self , def_id : DefId , tcx : TyCtxt < ' _ > ) -> Ty < ' tcx > {
416+ pub fn closure_kind_ty ( & ' a self , def_id : DefId , tcx : TyCtxt < ' _ > ) -> Ty < ' a > {
417417 self . split ( def_id, tcx) . closure_kind_ty
418418 }
419419
420420 /// Returns the type representing the closure signature for this
421421 /// closure; may contain type variables during inference. To get
422422 /// the closure signature during inference, use
423423 /// `infcx.fn_sig(def_id)`.
424- pub fn closure_sig_ty ( self , def_id : DefId , tcx : TyCtxt < ' _ > ) -> Ty < ' tcx > {
424+ pub fn closure_sig_ty ( & ' a self , def_id : DefId , tcx : TyCtxt < ' _ > ) -> Ty < ' a > {
425425 self . split ( def_id, tcx) . closure_sig_ty
426426 }
427427
@@ -430,7 +430,7 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
430430 /// there are no type variables.
431431 ///
432432 /// If you have an inference context, use `infcx.closure_kind()`.
433- pub fn closure_kind ( self , def_id : DefId , tcx : TyCtxt < ' tcx > ) -> ty:: ClosureKind {
433+ pub fn closure_kind ( & self , def_id : DefId , tcx : TyCtxt < ' tcx > ) -> ty:: ClosureKind {
434434 self . split ( def_id, tcx) . closure_kind_ty . to_opt_closure_kind ( ) . unwrap ( )
435435 }
436436
@@ -439,7 +439,7 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
439439 /// there are no type variables.
440440 ///
441441 /// If you have an inference context, use `infcx.closure_sig()`.
442- pub fn closure_sig ( self , def_id : DefId , tcx : TyCtxt < ' tcx > ) -> ty:: PolyFnSig < ' tcx > {
442+ pub fn closure_sig ( & ' a self , def_id : DefId , tcx : TyCtxt < ' tcx > ) -> ty:: PolyFnSig < ' a > {
443443 let ty = self . closure_sig_ty ( def_id, tcx) ;
444444 match ty. kind {
445445 ty:: FnPtr ( sig) => sig,
0 commit comments