From 2fc0bedc8335455dfa8716e91a7aa7de7a974e16 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 20 May 2011 21:27:54 -0400 Subject: [PATCH] rustc: Don't write metadata for unexported items --- src/comp/middle/metadata.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);