/// Returns the early-bound lifetimes declared in this generics
/// listing.  For anything other than fns/methods, this is just all
/// the lifetimes that are declared. For fns or methods, we have to
/// screen out those that do not appear in any where-clauses etc using
/// `resolve_lifetime::early_bound_lifetimes`.
Returns the early-bound lifetimes declared in this generics
listing.  For anything other than fns/methods, this is just all
the lifetimes that are declared. For fns or methods, we have to
screen out those that do not appear in any where-clauses etc using
`resolve_lifetime::early_bound_lifetimes`.
Returns the early - bound lifetimes declared in this generics listing . For anything other than fns / methods this is just all the lifetimes that are declared . For fns or methods we have to screen out those that do not appear in any where - clauses etc using ` resolve_lifetime :: early_bound_lifetimes ` .
fn early_bound_lifetimes_from_generics<'a, 'tcx>(
    tcx: TyCtxt<'a, 'tcx, 'tcx>,
    generics: &'a hir::Generics)
    -> impl Iterator<Item=&'a hir::GenericParam> + Captures<'tcx>
{
    generics.params.iter().filter(move |param| match param.kind {
        GenericParamKind::Lifetime { .. } => {
            let hir_id = tcx.hir.node_to_hir_id(param.id);
            !tcx.is_late_bound(hir_id)
        }
        _ => false,
    })
}
fn early_bound_lifetimes_from_generics < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , generics : & ' a hir :: Generics ) -> impl Iterator < Item = & ' a hir :: GenericParam > + Captures < ' tcx > { generics . params . iter ( ) . filter ( move | param | match param . kind { GenericParamKind :: Lifetime { .. } => { let hir_id = tcx . hir . node_to_hir_id ( param . id ) ; ! tcx . is_late_bound ( hir_id ) } _ => false , } ) }
Returns the early-bound lifetimes declared in this generics
listing.
Returns the early - bound lifetimes declared in this generics listing .
tcx
TyCtxt<'a, 'tcx, 'tcx>
generics
&'a hir::Generics