self.external_exports.insert(def_id);
let parent_link = ModuleParentLink(parent, name);
let def = Def::Mod(def_id);
- let local_def_id = self.ast_map.local_def_id(item.id);
- let external_module =
- self.new_extern_crate_module(parent_link, def, is_public, local_def_id);
- self.define(parent, name, TypeNS, (external_module, sp));
+ let module = self.new_extern_crate_module(parent_link, def, is_public, item.id);
+ self.define(parent, name, TypeNS, (module, sp));
if is_public {
let export = Export { name: name, def_id: def_id };
}
}
- self.build_reduced_graph_for_external_crate(external_module);
+ self.build_reduced_graph_for_external_crate(module);
}
parent
}
def: Option<Def>,
is_public: bool,
- // If the module is an extern crate, `def` is root of the external crate and `extern_crate_did`
- // is the DefId of the local `extern crate` item (otherwise, `extern_crate_did` is None).
- extern_crate_did: Option<DefId>,
+ // If the module is an extern crate, `def` is root of the external crate and `extern_crate_id`
+ // is the NodeId of the local `extern crate` item (otherwise, `extern_crate_id` is None).
+ extern_crate_id: Option<NodeId>,
resolutions: RefCell<HashMap<(Name, Namespace), NameResolution<'a>>>,
unresolved_imports: RefCell<Vec<ImportDirective>>,
parent_link: parent_link,
def: def,
is_public: is_public,
- extern_crate_did: None,
+ extern_crate_id: None,
resolutions: RefCell::new(HashMap::new()),
unresolved_imports: RefCell::new(Vec::new()),
module_children: RefCell::new(NodeMap()),
}
fn is_extern_crate(&self) -> bool {
- self.module().and_then(|module| module.extern_crate_did).is_some()
+ self.module().and_then(|module| module.extern_crate_id).is_some()
}
fn is_import(&self) -> bool {
parent_link: ParentLink<'a>,
def: Def,
is_public: bool,
- local_def: DefId)
+ local_node_id: NodeId)
-> Module<'a> {
let mut module = ModuleS::new(parent_link, Some(def), false, is_public);
- module.extern_crate_did = Some(local_def);
+ module.extern_crate_id = Some(local_node_id);
self.arenas.modules.alloc(module)
}