@@ -394,10 +394,14 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
394
394
ns,
395
395
impl_,
396
396
)
397
- . map ( |item| match item. kind {
398
- ty:: AssocKind :: Fn => "method" ,
399
- ty:: AssocKind :: Const => "associatedconstant" ,
400
- ty:: AssocKind :: Type => "associatedtype" ,
397
+ . map ( |item| {
398
+ let kind = item. kind ;
399
+ self . kind_side_channel . set ( Some ( ( kind. as_def_kind ( ) , item. def_id ) ) ) ;
400
+ match kind {
401
+ ty:: AssocKind :: Fn => "method" ,
402
+ ty:: AssocKind :: Const => "associatedconstant" ,
403
+ ty:: AssocKind :: Type => "associatedtype" ,
404
+ }
401
405
} )
402
406
. map ( |out| {
403
407
(
@@ -1143,7 +1147,7 @@ impl LinkCollector<'_, '_> {
1143
1147
) ;
1144
1148
} ;
1145
1149
match res {
1146
- Res :: Primitive ( _) => match disambiguator {
1150
+ Res :: Primitive ( _) if self . kind_side_channel . get ( ) . is_none ( ) => match disambiguator {
1147
1151
Some ( Disambiguator :: Primitive | Disambiguator :: Namespace ( _) ) | None => {
1148
1152
Some ( ItemLink { link : ori_link. link , link_text, did : None , fragment } )
1149
1153
}
@@ -1152,6 +1156,7 @@ impl LinkCollector<'_, '_> {
1152
1156
None
1153
1157
}
1154
1158
} ,
1159
+ Res :: Primitive ( _) => Some ( ItemLink { link : ori_link, link_text, did : None , fragment } ) ,
1155
1160
Res :: Def ( kind, id) => {
1156
1161
debug ! ( "intra-doc link to {} resolved to {:?}" , path_str, res) ;
1157
1162
0 commit comments