/// Visits self by adding a scope and handling recursive walk over the contents with `walk`.
///
/// Handles visiting fns and methods. These are a bit complicated because we must distinguish
/// early- vs late-bound lifetime parameters. We do this by checking which lifetimes appear
/// within type bounds; those are early bound lifetimes, and the rest are late bound.
///
/// For example:
///
///    fn foo<'a,'b,'c,T:Trait<'b>>(...)
///
/// Here `'a` and `'c` are late bound but `'b` is early bound. Note that early- and late-bound
/// lifetimes may be interspersed together.
///
/// If early bound lifetimes are present, we separate them into their own list (and likewise
/// for late bound). They will be numbered sequentially, starting from the lowest index that is
/// already in scope (for a fn item, that will be 0, but for a method it might not be). Late
/// bound lifetimes are resolved by name and associated with a binder id (`binder_id`), so the
/// ordering is not important there.
Visits self by adding a scope and handling recursive walk over the contents with `walk`.
Handles visiting fns and methods. These are a bit complicated because we must distinguish
early- vs late-bound lifetime parameters. We do this by checking which lifetimes appear
within type bounds; those are early bound lifetimes, and the rest are late bound.

For example.





If early bound lifetimes are present, we separate them into their own list (and likewise
for late bound). They will be numbered sequentially, starting from the lowest index that is
already in scope (for a fn item, that will be 0, but for a method it might not be). Late
bound lifetimes are resolved by name and associated with a binder id (`binder_id`), so the
ordering is not important there.
Visits self by adding a scope and handling recursive walk over the contents with ` walk ` . Handles visiting fns and methods . These are a bit complicated because we must distinguish early - vs late - bound lifetime parameters . We do this by checking which lifetimes appear within type bounds ; those are early bound lifetimes and the rest are late bound . For example . If early bound lifetimes are present we separate them into their own list ( and likewise for late bound ) . They will be numbered sequentially starting from the lowest index that is already in scope ( for a fn item that will be 0 but for a method it might not be ) . Late bound lifetimes are resolved by name and associated with a binder id ( ` binder_id ` ) so the ordering is not important there .
fn visit_early_late<F>(&mut self,
                           fn_id: ast::NodeId,
                           early_space: subst::ParamSpace,
                           decl: &hir::FnDecl,
                           generics: &hir::Generics,
                           walk: F) where
        F: FnOnce(&mut LifetimeContext),
    {
        let fn_def_id = self.hir_map.local_def_id(fn_id);
        insert_late_bound_lifetimes(self.map,
                                    fn_def_id,
                                    decl,
                                    generics);
        let (late, early): (Vec<_>, _) =
            generics.lifetimes
                    .iter()
                    .cloned()
                    .partition(|l| self.map.late_bound.contains_key(&l.lifetime.id));
        let this = self;
        this.with(EarlyScope(early_space, &early, this.scope), move |old_scope, this| {
            this.with(LateScope(&late, this.scope), move |_, this| {
                this.check_lifetime_defs(old_scope, &generics.lifetimes);
                walk(this);
            });
        });
    }
fn visit_early_late < F > ( & mut self , fn_id : ast :: NodeId , early_space : subst :: ParamSpace , decl : & hir :: FnDecl , generics : & hir :: Generics , walk : F ) where F : FnOnce ( & mut LifetimeContext ) , { let fn_def_id = self . hir_map . local_def_id ( fn_id ) ; insert_late_bound_lifetimes ( self . map , fn_def_id , decl , generics ) ; let ( late , early ) : ( Vec < _ > , _ ) = generics . lifetimes . iter ( ) . cloned ( ) . partition ( | l | self . map . late_bound . contains_key ( & l . lifetime . id ) ) ; let this = self ; this . with ( EarlyScope ( early_space , & early , this . scope ) , move | old_scope , this | { this . with ( LateScope ( & late , this . scope ) , move | _ , this | { this . check_lifetime_defs ( old_scope , & generics . lifetimes ) ; walk ( this ) ; } ) ; } ) ; }
Visits self by adding a scope and handling recursive walk over the contents with `walk`.
Visits self by adding a scope and handling recursive walk over the contents with ` walk ` .
&mut self
fn_id
ast::NodeId
early_space
subst::ParamSpace
decl
&hir::FnDecl
generics
&hir::Generics
walk
F