From 0f36438a8ebbba0c1f3bd08a05fca8bb56162fa6 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Fri, 24 Jan 2014 20:46:19 +0900 Subject: [PATCH] Remove reexport field --- src/librustc/middle/privacy.rs | 2 +- src/librustc/middle/resolve.rs | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs index 3d5267cd928..526fb9e8d86 100644 --- a/src/librustc/middle/privacy.rs +++ b/src/librustc/middle/privacy.rs @@ -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); } } diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index 082c755b832..c69db10dc30 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -55,7 +55,6 @@ pub type ExportMap2 = @RefCell>; 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 @@ 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); } } } @@ -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) } _ => () }