Skip to content

Commit e3b830d

Browse files
committed
rustc_privacy: Migrate EmbargoVisitor to visit_all_item_likes_in_crate
Previously it had some logic requiring tree visiting, but it was moved to resolve last year.
1 parent 03761a5 commit e3b830d

File tree

1 file changed

+1
-18
lines changed
  • compiler/rustc_privacy/src

1 file changed

+1
-18
lines changed

compiler/rustc_privacy/src/lib.rs

+1-18
Original file line numberDiff line numberDiff line change
@@ -700,14 +700,6 @@ impl<'tcx> EmbargoVisitor<'tcx> {
700700
}
701701

702702
impl<'tcx> Visitor<'tcx> for EmbargoVisitor<'tcx> {
703-
type NestedFilter = nested_filter::All;
704-
705-
/// We want to visit items in the context of their containing
706-
/// module and so forth, so supply a crate for doing a deep walk.
707-
fn nested_visit_map(&mut self) -> Self::Map {
708-
self.tcx.hir()
709-
}
710-
711703
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
712704
let item_ev = match item.kind {
713705
hir::ItemKind::Impl { .. } => {
@@ -915,15 +907,6 @@ impl<'tcx> Visitor<'tcx> for EmbargoVisitor<'tcx> {
915907
}
916908
}
917909
}
918-
919-
intravisit::walk_item(self, item);
920-
}
921-
922-
fn visit_block(&mut self, b: &'tcx hir::Block<'tcx>) {
923-
// Blocks can have public items, for example impls, but they always
924-
// start as completely private regardless of publicity of a function,
925-
// constant, type, field, etc., in which this block resides.
926-
intravisit::walk_block(self, b);
927910
}
928911
}
929912

@@ -2210,7 +2193,7 @@ fn effective_visibilities(tcx: TyCtxt<'_>, (): ()) -> &EffectiveVisibilities {
22102193

22112194
visitor.effective_visibilities.check_invariants(tcx, true);
22122195
loop {
2213-
tcx.hir().walk_toplevel_module(&mut visitor);
2196+
tcx.hir().visit_all_item_likes_in_crate(&mut visitor);
22142197
if visitor.changed {
22152198
visitor.changed = false;
22162199
} else {

0 commit comments

Comments
 (0)