about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrian Anderson <andersrb@gmail.com>2011-05-20 21:27:54 -0400
committerBrian Anderson <andersrb@gmail.com>2011-05-20 21:32:57 -0400
commit2fc0bedc8335455dfa8716e91a7aa7de7a974e16 (patch)
tree83c1cb3178fbe8647d85e74f551bfedba9da5959 /src
parent78178242057a6a60f6f3a36b9f4a6feae62c7881 (diff)
downloadrust-2fc0bedc8335455dfa8716e91a7aa7de7a974e16.tar.gz
rust-2fc0bedc8335455dfa8716e91a7aa7de7a974e16.zip
rustc: Don't write metadata for unexported items
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/metadata.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/comp/middle/metadata.rs b/src/comp/middle/metadata.rs
index 97b2f3d7c4a..db84eeabb48 100644
--- a/src/comp/middle/metadata.rs
+++ b/src/comp/middle/metadata.rs
@@ -341,8 +341,11 @@ fn encode_module_item_paths(&ebml::writer ebml_w,
                             &ast::_mod module,
                             &vec[str] path,
                             &mutable vec[tup(str, uint)] index) {
-    // TODO: only encode exported items
     for (@ast::item it in module.items) {
+        if (!ast::is_exported(ast::item_ident(it), module)) {
+            cont;
+        }
+
         alt (it.node) {
             case (ast::item_const(?id, _, ?tps, ?did, ?ann)) {
                 add_to_index(ebml_w, path, index, id);