use rustc_front::hir;
use rustc_front::intravisit::{self, Visitor};
+use rustc::dep_graph::DepNode;
use rustc::lint;
use rustc::middle::def;
use rustc::middle::def_id::DefId;
// This code is here instead of in visit_item so that the
// crate module gets processed as well.
if self.prev_level.is_some() {
- for export in self.export_map.get(&id).expect("module isn't found in export map") {
- if let Some(node_id) = self.tcx.map.as_local_node_id(export.def_id) {
- self.update(node_id, Some(AccessLevel::Exported));
+ if let Some(exports) = self.export_map.get(&id) {
+ for export in exports {
+ if let Some(node_id) = self.tcx.map.as_local_node_id(export.def_id) {
+ self.update(node_id, Some(AccessLevel::Exported));
+ }
}
}
}
lint::builtin::PRIVATE_IN_PUBLIC,
node_id,
ty.span,
- "private type in public interface (error E0446)".to_string()
+ format!("private type in public interface"),
);
}
}
export_map: &def::ExportMap,
external_exports: ExternalExports)
-> AccessLevels {
+ let _task = tcx.dep_graph.in_task(DepNode::Privacy);
+
let krate = tcx.map.krate();
// Sanity check to make sure that all privacy usage and controls are