]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_privacy/lib.rs
Add Alexis thesis to bibliography
[rust.git] / src / librustc_privacy / lib.rs
index 1cc2482a39e2787c957fd0762cf45cd5990d5cc1..d3da93a3e080d53508928af23f0c8b0068568b03 100644 (file)
@@ -35,6 +35,7 @@
 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;
@@ -328,9 +329,11 @@ fn visit_mod(&mut self, m: &hir::Mod, _sp: Span, id: ast::NodeId) {
         // 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));
+                    }
                 }
             }
         }
@@ -1527,7 +1530,7 @@ fn visit_ty(&mut self, ty: &hir::Ty) {
                                         lint::builtin::PRIVATE_IN_PUBLIC,
                                         node_id,
                                         ty.span,
-                                        "private type in public interface (error E0446)".to_string()
+                                        format!("private type in public interface"),
                                     );
                                 }
                             }
@@ -1674,6 +1677,8 @@ pub fn check_crate(tcx: &ty::ctxt,
                    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