fn import_step(
        &mut self,
        span: Span,
        module: &Arc<CompileMod>,
        item: &Item,
        used: Used,
        path: &mut Vec<ImportEntryStep>,
    ) -> Result<Option<ImportStep>, QueryError> {
        // already resolved query.
        if let Some(meta) = self.meta.get(item) {
            return Ok(match &meta.kind {
                CompileMetaKind::Import {
                    module,
                    location,
                    target,
                } => Some(ImportStep {
                    module: module.clone(),
                    location: *location,
                    target: target.clone(),
                }),
                _ => None,
            });
        }

        // resolve query.
        let entry = match self.remove_indexed(span, item)? {
            Some(entry) => entry,
            _ => return Ok(None),
        };

        self.check_access_to(
            span,
            &*module,
            item,
            &entry.item.module,
            entry.item.location,
            entry.item.visibility,
            path,
        )?;

        let import = match entry.indexed {
            Indexed::Import(import) => import.entry,
            indexed => {
                self.import_indexed(span, entry.item, entry.source, indexed, used)?;
                return Ok(None);
            }
        };

        let meta = CompileMeta {
            item: entry.item.clone(),
            kind: CompileMetaKind::Import {
                module: import.module.clone(),
                location: import.location,
                target: import.target.clone(),
            },
            source: None,
        };

        self.insert_meta(span, meta)?;

        Ok(Some(ImportStep {
            module: import.module,
            location: import.location,
            target: import.target,
        }))
    }
/// Inner import implementation that doesn't walk the imported name.
Inner import implementation that doesn't walk the imported name.
Inner import implementation that doesn ' t walk the imported name .
fn import_step(
        &mut self,
        span: Span,
        module: &Arc<CompileMod>,
        item: &Item,
        used: Used,
        path: &mut Vec<ImportEntryStep>,
    ) -> Result<Option<ImportStep>, QueryError> {
        // already resolved query.
        if let Some(meta) = self.meta.get(item) {
            return Ok(match &meta.kind {
                CompileMetaKind::Import {
                    module,
                    location,
                    target,
                } => Some(ImportStep {
                    module: module.clone(),
                    location: *location,
                    target: target.clone(),
                }),
                _ => None,
            });
        }
        // resolve query.
        let entry = match self.remove_indexed(span, item)? {
            Some(entry) => entry,
            _ => return Ok(None),
        };
        self.check_access_to(
            span,
            &*module,
            item,
            &entry.item.module,
            entry.item.location,
            entry.item.visibility,
            path,
        )?;
        let import = match entry.indexed {
            Indexed::Import(import) => import.entry,
            indexed => {
                self.import_indexed(span, entry.item, entry.source, indexed, used)?;
                return Ok(None);
            }
        };
        let meta = CompileMeta {
            item: entry.item.clone(),
            kind: CompileMetaKind::Import {
                module: import.module.clone(),
                location: import.location,
                target: import.target.clone(),
            },
            source: None,
        };
        self.insert_meta(span, meta)?;
        Ok(Some(ImportStep {
            module: import.module,
            location: import.location,
            target: import.target,
        }))
    }
fn import_step ( & mut self , span : Span , module : & Arc < CompileMod > , item : & Item , used : Used , path : & mut Vec < ImportEntryStep > , ) -> Result < Option < ImportStep > , QueryError > { // already resolved query. if let Some ( meta ) = self . meta . get ( item ) { return Ok ( match & meta . kind { CompileMetaKind :: Import { module , location , target , } => Some ( ImportStep { module : module . clone ( ) , location : * location , target : target . clone ( ) , } ) , _ => None , } ) ; } // resolve query. let entry = match self . remove_indexed ( span , item ) ? { Some ( entry ) => entry , _ => return Ok ( None ) , } ; self . check_access_to ( span , & * module , item , & entry . item . module , entry . item . location , entry . item . visibility , path , ) ? ; let import = match entry . indexed { Indexed :: Import ( import ) => import . entry , indexed => { self . import_indexed ( span , entry . item , entry . source , indexed , used ) ? ; return Ok ( None ) ; } } ; let meta = CompileMeta { item : entry . item . clone ( ) , kind : CompileMetaKind :: Import { module : import . module . clone ( ) , location : import . location , target : import . target . clone ( ) , } , source : None , } ; self . insert_meta ( span , meta ) ? ; Ok ( Some ( ImportStep { module : import . module , location : import . location , target : import . target , } ) ) }
Inner import implementation that doesn't walk the imported name.
Inner import implementation that doesn ' t walk the imported name .
&mut self
span
Span
module
&Arc<CompileMod>
item
&Item
used
Used
path
&mut Vec<ImportEntryStep>
&mut self
span
Span
module
&Arc<CompileMod>
item
&Item
used
Used
path
&mut Vec<ImportEntryStep>