Skip to content

Commit e301f90

Browse files
committed
Address comments
1 parent e459000 commit e301f90

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/librustc_privacy/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,8 @@ impl<'a, 'tcx> Visitor<'tcx> for NamePrivacyVisitor<'a, 'tcx> {
783783
}
784784

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

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

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

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

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

1713-
for &module in tcx.hir().krate().modules.keys() {
1715+
for &module in krate.modules.keys() {
17141716
queries::check_mod_privacy::ensure(tcx, tcx.hir().local_def_id(module));
17151717
}
17161718

0 commit comments

Comments
 (0)