fn lookup_initial(
        &mut self,
        context: &Context,
        module: &Arc<CompileMod>,
        base: &Item,
        local: &str,
    ) -> Result<Item, CompileError> {
        debug_assert!(base.starts_with(&module.item));
        let mut base = base.clone();

        while base.starts_with(&module.item) {
            let item = base.extended(local);

            if self.names.contains(&item) {
                return Ok(item);
            }

            if base.pop().is_none() {
                break;
            }
        }

        if let Some(item) = self.prelude.get(local) {
            return Ok(item.clone());
        }

        if context.contains_crate(local) {
            return Ok(Item::with_crate(local));
        }

        Ok(module.item.extended(local))
    }
/// Walk the names to find the first one that is contained in the unit.
Walk the names to find the first one that is contained in the unit.
Walk the names to find the first one that is contained in the unit .
fn lookup_initial(
        &mut self,
        context: &Context,
        module: &Arc<CompileMod>,
        base: &Item,
        local: &str,
    ) -> Result<Item, CompileError> {
        debug_assert!(base.starts_with(&module.item));
        let mut base = base.clone();
        while base.starts_with(&module.item) {
            let item = base.extended(local);
            if self.names.contains(&item) {
                return Ok(item);
            }
            if base.pop().is_none() {
                break;
            }
        }
        if let Some(item) = self.prelude.get(local) {
            return Ok(item.clone());
        }
        if context.contains_crate(local) {
            return Ok(Item::with_crate(local));
        }
        Ok(module.item.extended(local))
    }
fn lookup_initial ( & mut self , context : & Context , module : & Arc < CompileMod > , base : & Item , local : & str , ) -> Result < Item , CompileError > { debug_assert ! ( base starts_with ( module item ) ) ; let mut base = base . clone ( ) ; while base . starts_with ( & module . item ) { let item = base . extended ( local ) ; if self . names . contains ( & item ) { return Ok ( item ) ; } if base . pop ( ) . is_none ( ) { break ; } } if let Some ( item ) = self . prelude . get ( local ) { return Ok ( item . clone ( ) ) ; } if context . contains_crate ( local ) { return Ok ( Item :: with_crate ( local ) ) ; } Ok ( module . item . extended ( local ) ) }
Walk the names to find the first one that is contained in the unit.
Walk the names to find the first one that is contained in the unit .
&mut self
context
&Context
module
&Arc<CompileMod>
base
&Item
local
&str
&mut self
context
&Context
module
&Arc<CompileMod>
base
&Item
local
&str