auto merge of #11772 : sanxiyn/rust/reexport, r=cmr

The field is always set to true.
This commit is contained in:
bors 2014-01-24 19:11:39 -08:00
commit 7c028c9ba7
2 changed files with 6 additions and 11 deletions

View File

@ -338,7 +338,7 @@ fn visit_mod(&mut self, m: &ast::Mod, _sp: Span, id: ast::NodeId, _: ()) {
let exp_map2 = self.exp_map2.borrow();
assert!(exp_map2.get().contains_key(&id), "wut {:?}", id);
for export in exp_map2.get().get(&id).iter() {
if is_local(export.def_id) && export.reexport {
if is_local(export.def_id) {
self.reexports.insert(export.def_id.node);
}
}

View File

@ -55,7 +55,6 @@ struct binding_info {
pub struct Export2 {
name: @str, // The name of the target.
def_id: DefId, // The definition of the target.
reexport: bool, // Whether this is a reexport.
}
// This set contains all exported definitions from external crates. The set does
@ -3364,22 +3363,19 @@ fn add_exports_of_namebindings(&mut self,
exports2: &mut ~[Export2],
name: Name,
namebindings: @NameBindings,
ns: Namespace,
reexport: bool) {
ns: Namespace) {
match namebindings.def_for_namespace(ns) {
Some(d) => {
debug!("(computing exports) YES: {} '{}' => {:?}",
if reexport { ~"reexport" } else { ~"export"},
debug!("(computing exports) YES: export '{}' => {:?}",
interner_get(name),
def_id_of_def(d));
exports2.push(Export2 {
reexport: reexport,
name: interner_get(name),
def_id: def_id_of_def(d)
});
}
d_opt => {
debug!("(computing reexports) NO: {:?}", d_opt);
debug!("(computing exports) NO: {:?}", d_opt);
}
}
}
@ -3396,13 +3392,12 @@ fn add_exports_for_module(&mut self,
for &ns in xs.iter() {
match importresolution.target_for_namespace(ns) {
Some(target) => {
debug!("(computing exports) maybe reexport '{}'",
debug!("(computing exports) maybe export '{}'",
interner_get(*name));
self.add_exports_of_namebindings(exports2,
*name,
target.bindings,
ns,
true)
ns)
}
_ => ()
}