@@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
5
5
use rustc_hir:: def:: { DefKind , Res } ;
6
6
use rustc_hir:: def_id:: DefId ;
7
7
use rustc_hir:: intravisit:: { self , Visitor } ;
8
- use rustc_hir:: { ExprKind , GenericParam , HirId , Mod , Node } ;
8
+ use rustc_hir:: { ExprKind , Generics , HirId , Mod , Node , WherePredicate } ;
9
9
use rustc_middle:: hir:: nested_filter;
10
10
use rustc_middle:: ty:: TyCtxt ;
11
11
use rustc_span:: Span ;
@@ -100,7 +100,17 @@ impl<'tcx> Visitor<'tcx> for SpanMapVisitor<'tcx> {
100
100
self . tcx . hir ( )
101
101
}
102
102
103
- fn visit_generic_param ( & mut self , _: & ' tcx GenericParam < ' tcx > ) { }
103
+ fn visit_generics ( & mut self , g : & ' tcx Generics < ' tcx > ) {
104
+ for predicate in g. predicates {
105
+ if let WherePredicate :: BoundPredicate ( w) = predicate {
106
+ for bound in w. bounds {
107
+ if let Some ( trait_ref) = bound. trait_ref ( ) {
108
+ self . handle_path ( trait_ref. path , None ) ;
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
104
114
105
115
fn visit_path ( & mut self , path : & ' tcx rustc_hir:: Path < ' tcx > , _id : HirId ) {
106
116
self . handle_path ( path, None ) ;
0 commit comments