Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reexport field #11772

Merged
merged 1 commit into from
Jan 25, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc/middle/privacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ impl<'a> Visitor<()> for EmbargoVisitor<'a> {
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);
}
}
Expand Down
15 changes: 5 additions & 10 deletions src/librustc/middle/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ pub type ExportMap2 = @RefCell<HashMap<NodeId, ~[Export2]>>;
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
Expand Down Expand Up @@ -3364,22 +3363,19 @@ impl Resolver {
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);
}
}
}
Expand All @@ -3396,13 +3392,12 @@ impl Resolver {
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)
}
_ => ()
}
Expand Down