File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -97,16 +97,20 @@ struct SpanMapVisitor<'tcx> {
97
97
}
98
98
99
99
impl < ' tcx > SpanMapVisitor < ' tcx > {
100
- fn handle_path ( & mut self , path : & rustc_hir:: Path < ' _ > , path_span : Option < Span > ) -> bool {
100
+ /// This function is where we handle `hir::Path` elements and add them into the "span map".
101
+ fn handle_path ( & mut self , path : & rustc_hir:: Path < ' _ > , path_span : Option < Span > ) {
101
102
let info = match path. res {
103
+ // FIXME: For now, we only handle `DefKind` if it's not `DefKind::TyParam` or
104
+ // `DefKind::Macro`. Would be nice to support them too alongside the other `DefKind`
105
+ // (such as primitive types!).
102
106
Res :: Def ( kind, def_id) if kind != DefKind :: TyParam => {
103
107
if matches ! ( kind, DefKind :: Macro ( _) ) {
104
- return false ;
108
+ return ;
105
109
}
106
110
Some ( def_id)
107
111
}
108
112
Res :: Local ( _) => None ,
109
- _ => return true ,
113
+ _ => return ,
110
114
} ;
111
115
if let Some ( span) = self . tcx . hir ( ) . res_span ( path. res ) {
112
116
self . matches . insert (
@@ -123,7 +127,6 @@ impl<'tcx> SpanMapVisitor<'tcx> {
123
127
LinkFromSrc :: External ( def_id) ,
124
128
) ;
125
129
}
126
- true
127
130
}
128
131
}
129
132
You can’t perform that action at this time.
0 commit comments