@@ -384,22 +384,22 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
384
384
/// Divides the closure substs into their respective
385
385
/// components. Single source of truth with respect to the
386
386
/// ordering.
387
- fn split ( self , def_id : DefId , tcx : TyCtxt < ' _ > ) -> SplitClosureSubsts < ' tcx > {
387
+ fn split ( & self , def_id : DefId , tcx : TyCtxt < ' _ > ) -> SplitClosureSubsts < ' _ > {
388
388
let generics = tcx. generics_of ( def_id) ;
389
389
let parent_len = generics. parent_count ;
390
390
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 ..] ,
394
394
}
395
395
}
396
396
397
397
#[ inline]
398
398
pub fn upvar_tys (
399
- & self ,
399
+ & ' a self ,
400
400
def_id : DefId ,
401
401
tcx : TyCtxt < ' _ > ,
402
- ) -> impl Iterator < Item = Ty < ' tcx > > + ' tcx {
402
+ ) -> impl Iterator < Item = Ty < ' a > > + ' a {
403
403
let SplitClosureSubsts { upvar_kinds, .. } = self . split ( def_id, tcx) ;
404
404
upvar_kinds. iter ( ) . map ( |t| {
405
405
if let UnpackedKind :: Type ( ty) = t. unpack ( ) {
@@ -413,15 +413,15 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
413
413
/// Returns the closure kind for this closure; may return a type
414
414
/// variable during inference. To get the closure kind during
415
415
/// 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 > {
417
417
self . split ( def_id, tcx) . closure_kind_ty
418
418
}
419
419
420
420
/// Returns the type representing the closure signature for this
421
421
/// closure; may contain type variables during inference. To get
422
422
/// the closure signature during inference, use
423
423
/// `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 > {
425
425
self . split ( def_id, tcx) . closure_sig_ty
426
426
}
427
427
@@ -430,7 +430,7 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
430
430
/// there are no type variables.
431
431
///
432
432
/// 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 {
434
434
self . split ( def_id, tcx) . closure_kind_ty . to_opt_closure_kind ( ) . unwrap ( )
435
435
}
436
436
@@ -439,7 +439,7 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
439
439
/// there are no type variables.
440
440
///
441
441
/// 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 > {
443
443
let ty = self . closure_sig_ty ( def_id, tcx) ;
444
444
match ty. kind {
445
445
ty:: FnPtr ( sig) => sig,
0 commit comments