@@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
55use rustc_hir:: def:: { DefKind , Res } ;
66use rustc_hir:: def_id:: DefId ;
77use rustc_hir:: intravisit:: { self , Visitor } ;
8- use rustc_hir:: { ExprKind , GenericParam , HirId , Mod , Node } ;
8+ use rustc_hir:: { ExprKind , Generics , HirId , Mod , Node , WherePredicate } ;
99use rustc_middle:: hir:: nested_filter;
1010use rustc_middle:: ty:: TyCtxt ;
1111use rustc_span:: Span ;
@@ -100,7 +100,17 @@ impl<'tcx> Visitor<'tcx> for SpanMapVisitor<'tcx> {
100100 self . tcx . hir ( )
101101 }
102102
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+ }
104114
105115 fn visit_path ( & mut self , path : & ' tcx rustc_hir:: Path < ' tcx > , _id : HirId ) {
106116 self . handle_path ( path, None ) ;
0 commit comments