15
15
//! paths etc in all kinds of annoying scenarios.
16
16
17
17
use rustc:: hir;
18
- use rustc:: hir:: intravisit:: { self , Visitor , NestedVisitorMap } ;
19
18
use rustc:: ty:: TyCtxt ;
20
19
use syntax:: ast;
21
20
@@ -34,8 +33,7 @@ pub fn report_symbol_names<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
34
33
35
34
tcx. dep_graph . with_ignore ( || {
36
35
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) ;
39
37
} )
40
38
}
41
39
@@ -66,23 +64,16 @@ impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> {
66
64
}
67
65
}
68
66
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 > {
74
68
fn visit_item ( & mut self , item : & ' tcx hir:: Item ) {
75
69
self . process_attrs ( item. id ) ;
76
- intravisit:: walk_item ( self , item) ;
77
70
}
78
71
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 ) ;
82
74
}
83
75
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 ) ;
87
78
}
88
79
}
0 commit comments