Skip to content

Commit 622c445

Browse files
committed
remove FIXME(#37712) and implement ItemLikeVisitor instead of Visitor
1 parent 4a06708 commit 622c445

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

src/librustc_trans_utils/symbol_names_test.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//! paths etc in all kinds of annoying scenarios.
1616
1717
use rustc::hir;
18-
use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap};
1918
use rustc::ty::TyCtxt;
2019
use syntax::ast;
2120

@@ -34,8 +33,7 @@ pub fn report_symbol_names<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
3433

3534
tcx.dep_graph.with_ignore(|| {
3635
let mut visitor = SymbolNamesTest { tcx: tcx };
37-
// FIXME(#37712) could use ItemLikeVisitor if trait items were item-like
38-
tcx.hir.krate().visit_all_item_likes(&mut visitor.as_deep_visitor());
36+
tcx.hir.krate().visit_all_item_likes(&mut visitor);
3937
})
4038
}
4139

@@ -66,23 +64,16 @@ impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> {
6664
}
6765
}
6866

69-
impl<'a, 'tcx> Visitor<'tcx> for SymbolNamesTest<'a, 'tcx> {
70-
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
71-
NestedVisitorMap::None
72-
}
73-
67+
impl<'a, 'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for SymbolNamesTest<'a, 'tcx> {
7468
fn visit_item(&mut self, item: &'tcx hir::Item) {
7569
self.process_attrs(item.id);
76-
intravisit::walk_item(self, item);
7770
}
7871

79-
fn visit_trait_item(&mut self, ti: &'tcx hir::TraitItem) {
80-
self.process_attrs(ti.id);
81-
intravisit::walk_trait_item(self, ti)
72+
fn visit_trait_item(&mut self, trait_item: &'tcx hir::TraitItem) {
73+
self.process_attrs(trait_item.id);
8274
}
8375

84-
fn visit_impl_item(&mut self, ii: &'tcx hir::ImplItem) {
85-
self.process_attrs(ii.id);
86-
intravisit::walk_impl_item(self, ii)
76+
fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem) {
77+
self.process_attrs(impl_item.id);
8778
}
8879
}

0 commit comments

Comments
 (0)