/// Searches the current set of local scopes for labels.
/// Stops after meeting a closure.
Searches the current set of local scopes for labels.
Stops after meeting a closure.
Searches the current set of local scopes for labels . Stops after meeting a closure .
fn search_label(&self, mut ident: ast::Ident) -> Option<Def> {
        for rib in self.label_ribs.iter().rev() {
            match rib.kind {
                NormalRibKind => {
                    // Continue
                }
                MacroDefinition(mac) => {
                    // If an invocation of this macro created `ident`, give up on `ident`
                    // and switch to `ident`'s source from the macro definition.
                    let (source_ctxt, source_macro) = ident.ctxt.source();
                    if source_macro == mac {
                        ident.ctxt = source_ctxt;
                    }
                }
                _ => {
                    // Do not resolve labels across function boundary
                    return None;
                }
            }
            let result = rib.bindings.get(&ident).cloned();
            if result.is_some() {
                return result;
            }
        }
        None
    }
fn search_label ( & self , mut ident : ast :: Ident ) -> Option < Def > { for rib in self . label_ribs . iter ( ) . rev ( ) { match rib . kind { NormalRibKind => { // Continue } MacroDefinition ( mac ) => { // If an invocation of this macro created `ident`, give up on `ident` // and switch to `ident`'s source from the macro definition. let ( source_ctxt , source_macro ) = ident . ctxt . source ( ) ; if source_macro == mac { ident . ctxt = source_ctxt ; } } _ => { // Do not resolve labels across function boundary return None ; } } let result = rib . bindings . get ( & ident ) . cloned ( ) ; if result . is_some ( ) { return result ; } } None }
Searches the current set of local scopes for labels.
Searches the current set of local scopes for labels .
&self
ident
ast::Ident