/// Resolves all imports for the crate. This method performs the fixed-
/// point iteration.
Resolves all imports for the crate. This method performs the fixed
point iteration.
Resolves all imports for the crate . This method performs the fixed point iteration .
fn resolve_imports(&mut self) {
        let mut i = 0;
        let mut prev_unresolved_imports = 0;
        let mut errors = Vec::new();
        loop {
            debug!("(resolving imports) iteration {}, {} imports left",
                   i,
                   self.resolver.unresolved_imports);
            // Attempt to resolve imports in all local modules.
            for module in self.resolver.arenas.local_modules().iter() {
                self.resolver.current_module = module;
                self.resolve_imports_in_current_module(&mut errors);
            }
            if self.resolver.unresolved_imports == 0 {
                debug!("(resolving imports) success");
                for module in self.resolver.arenas.local_modules().iter() {
                    self.finalize_resolutions_in(module, false);
                }
                break;
            }
            if self.resolver.unresolved_imports == prev_unresolved_imports {
                // resolving failed
                // Report unresolved imports only if no hard error was already reported
                // to avoid generating multiple errors on the same import.
                // Imports that are still indeterminate at this point are actually blocked
                // by errored imports, so there is no point reporting them.
                for module in self.resolver.arenas.local_modules().iter() {
                    self.finalize_resolutions_in(module, errors.len() == 0);
                }
                for e in errors {
                    self.import_resolving_error(e)
                }
                break;
            }
            i += 1;
            prev_unresolved_imports = self.resolver.unresolved_imports;
        }
    }
fn resolve_imports ( & mut self ) { let mut i = 0 ; let mut prev_unresolved_imports = 0 ; let mut errors = Vec :: new ( ) ; loop { debug ! ( " " i self resolver unresolved_imports ) ; // Attempt to resolve imports in all local modules. for module in self . resolver . arenas . local_modules ( ) . iter ( ) { self . resolver . current_module = module ; self . resolve_imports_in_current_module ( & mut errors ) ; } if self . resolver . unresolved_imports == 0 { debug ! ( " " ) ; for module in self . resolver . arenas . local_modules ( ) . iter ( ) { self . finalize_resolutions_in ( module , false ) ; } break ; } if self . resolver . unresolved_imports == prev_unresolved_imports { // resolving failed // Report unresolved imports only if no hard error was already reported // to avoid generating multiple errors on the same import. // Imports that are still indeterminate at this point are actually blocked // by errored imports, so there is no point reporting them. for module in self . resolver . arenas . local_modules ( ) . iter ( ) { self . finalize_resolutions_in ( module , errors . len ( ) == 0 ) ; } for e in errors { self . import_resolving_error ( e ) } break ; } i += 1 ; prev_unresolved_imports = self . resolver . unresolved_imports ; } }
Resolves all imports for the crate.
Resolves all imports for the crate .
&mut self