提交 2df1ceb0 编写于 作者: N Nick Cameron

resolve: factor out resolve imports to its own module

上级 432011d1
......@@ -14,16 +14,17 @@
//! any imports resolved.
use {DefModifiers, PUBLIC, IMPORTABLE};
use ImportDirective;
use ImportDirectiveSubclass::{self, SingleImport, GlobImport};
use ImportResolution;
use resolve_imports::ImportDirective;
use resolve_imports::ImportDirectiveSubclass::{self, SingleImport, GlobImport};
use resolve_imports::ImportResolution;
use Module;
use ModuleKind::*;
use Namespace::{TypeNS, ValueNS};
use NameBindings;
use {names_to_string, module_to_string};
use ParentLink::{self, ModuleParentLink, BlockParentLink};
use Resolver;
use Shadowable;
use resolve_imports::Shadowable;
use TypeNsDef;
use self::DuplicateCheckingMode::*;
......@@ -381,7 +382,7 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, parent: &Rc<Module>) ->
false,
true));
debug!("(build reduced graph for item) found extern `{}`",
self.module_to_string(&*external_module));
module_to_string(&*external_module));
self.check_for_conflicts_between_external_crates(&**parent, name, sp);
parent.external_module_children.borrow_mut()
.insert(name, external_module.clone());
......@@ -836,7 +837,7 @@ fn build_reduced_graph_for_external_crate_def(&mut self,
/// Builds the reduced graph rooted at the given external module.
fn populate_external_module(&mut self, module: &Rc<Module>) {
debug!("(populating external module) attempting to populate {}",
self.module_to_string(&**module));
module_to_string(&**module));
let def_id = match module.def_id.get() {
None => {
......@@ -903,7 +904,7 @@ fn build_import_directive(&mut self,
match subclass {
SingleImport(target, _) => {
debug!("(building import directive) building import directive: {}::{}",
self.names_to_string(&module_.imports.borrow().last().unwrap().module_path),
names_to_string(&module_.imports.borrow().last().unwrap().module_path),
token::get_name(target));
let mut import_resolutions = module_.import_resolutions.borrow_mut();
......
此差异已折叠。
......@@ -22,6 +22,7 @@
use Namespace::{self, TypeNS, ValueNS};
use build_reduced_graph;
use module_to_string;
use rustc::middle::def::Export;
use syntax::ast;
......@@ -60,19 +61,19 @@ fn record_exports_for_module_subtree(&mut self,
// OK. Continue.
debug!("(recording exports for module subtree) recording \
exports for local module `{}`",
self.module_to_string(&*module_));
module_to_string(&*module_));
}
None => {
// Record exports for the root module.
debug!("(recording exports for module subtree) recording \
exports for root module `{}`",
self.module_to_string(&*module_));
module_to_string(&*module_));
}
Some(_) => {
// Bail out.
debug!("(recording exports for module subtree) not recording \
exports for `{}`",
self.module_to_string(&*module_));
module_to_string(&*module_));
return;
}
}
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册