Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc authored and Vardhan Thigle committed Jan 31, 2019
1 parent 58601cb commit 058a65b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/librustc_privacy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,8 @@ impl<'a, 'tcx> Visitor<'tcx> for NamePrivacyVisitor<'a, 'tcx> {
}

fn visit_mod(&mut self, _m: &'tcx hir::Mod, _s: Span, _n: ast::NodeId) {
// Don't visit modules inside
// Don't visit nested modules, since we run a separate visitor walk
// for each module in `privacy_access_levels`
}

fn visit_nested_body(&mut self, body: hir::BodyId) {
Expand Down Expand Up @@ -922,7 +923,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypePrivacyVisitor<'a, 'tcx> {
}

fn visit_mod(&mut self, _m: &'tcx hir::Mod, _s: Span, _n: ast::NodeId) {
// Don't visit modules inside
// Don't visit nested modules, since we run a separate visitor walk
// for each module in `privacy_access_levels`
}

fn visit_nested_body(&mut self, body: hir::BodyId) {
Expand Down Expand Up @@ -1710,7 +1712,7 @@ fn privacy_access_levels<'tcx>(

let krate = tcx.hir().krate();

for &module in tcx.hir().krate().modules.keys() {
for &module in krate.modules.keys() {
queries::check_mod_privacy::ensure(tcx, tcx.hir().local_def_id(module));
}

Expand Down

0 comments on commit 058a65b

Please sign in to comment.