rustc: Make the export_map of TyCtxt private

This map, like `trait_map`, is calculated in resolve, but we want to be sure to
track it for incremental compliation. Hide it behind a query to get more
refactorings later.
This commit is contained in:
Alex Crichton
2017-08-29 11:10:22 -07:00
parent 32d35e6e9f
commit 942c8dcf19
7 changed files with 33 additions and 10 deletions

View File

@@ -325,8 +325,9 @@ impl<'a, 'tcx> Visitor<'tcx> for EmbargoVisitor<'a, 'tcx> {
// This code is here instead of in visit_item so that the
// crate module gets processed as well.
if self.prev_level.is_some() {
if let Some(exports) = self.tcx.export_map.get(&id) {
for export in exports {
let hir_id = self.tcx.hir.node_to_hir_id(id);
if let Some(exports) = self.tcx.module_exports(hir_id) {
for export in exports.iter() {
if let Some(node_id) = self.tcx.hir.as_local_node_id(export.def.def_id()) {
self.update(node_id, Some(AccessLevel::Exported));
}