@@ -1531,6 +1531,8 @@ fn render_impl(
1531
1531
let mut impl_items = Buffer :: empty_from ( w) ;
1532
1532
let mut default_impl_items = Buffer :: empty_from ( w) ;
1533
1533
1534
+ // FFFFXXX
1535
+
1534
1536
for trait_item in & i. inner_impl ( ) . items {
1535
1537
doc_impl_item (
1536
1538
& mut default_impl_items,
@@ -1613,6 +1615,8 @@ fn render_impl(
1613
1615
) ;
1614
1616
write ! ( w, "<summary>" )
1615
1617
}
1618
+
1619
+ write ! ( w, "{}:{} " , file!( ) , line!( ) ) ;
1616
1620
render_impl_summary (
1617
1621
w,
1618
1622
cx,
@@ -1624,6 +1628,7 @@ fn render_impl(
1624
1628
rendering_params. is_on_foreign_type ,
1625
1629
aliases,
1626
1630
) ;
1631
+ write ! ( w, "{}:{} " , file!( ) , line!( ) ) ;
1627
1632
if toggled {
1628
1633
write ! ( w, "</summary>" )
1629
1634
}
@@ -1691,6 +1696,7 @@ pub(crate) fn render_impl_summary(
1691
1696
// in documentation pages for trait with automatic implementations like "Send" and "Sync".
1692
1697
aliases : & [ String ] ,
1693
1698
) {
1699
+ // This is where the ID is created
1694
1700
let id = cx. derive_id ( match i. inner_impl ( ) . trait_ {
1695
1701
Some ( ref t) => {
1696
1702
if is_on_foreign_type {
@@ -1701,6 +1707,9 @@ pub(crate) fn render_impl_summary(
1701
1707
}
1702
1708
None => "impl" . to_string ( ) ,
1703
1709
} ) ;
1710
+
1711
+ cx. nixon_hack . borrow_mut ( ) . insert ( i. impl_item . def_id , id. clone ( ) ) ;
1712
+
1704
1713
let aliases = if aliases. is_empty ( ) {
1705
1714
String :: new ( )
1706
1715
} else {
@@ -2215,6 +2224,7 @@ fn get_id_for_impl_on_foreign_type(
2215
2224
}
2216
2225
2217
2226
fn extract_for_impl_name ( item : & clean:: Item , cx : & Context < ' _ > ) -> Option < ( String , String ) > {
2227
+ //
2218
2228
match * item. kind {
2219
2229
clean:: ItemKind :: ImplItem ( ref i) => {
2220
2230
i. trait_ . as_ref ( ) . map ( |trait_| {
@@ -2306,6 +2316,7 @@ fn sidebar_trait(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item, t: &clean
2306
2316
. filter ( |i| {
2307
2317
i. inner_impl ( ) . for_ . def_id ( cache) . map_or ( false , |d| !cache. paths . contains_key ( & d) )
2308
2318
} )
2319
+ // TODO: Dont do the filter map dance
2309
2320
. filter_map ( |i| extract_for_impl_name ( & i. impl_item , cx) )
2310
2321
. collect :: < Vec < _ > > ( ) ;
2311
2322
@@ -2325,7 +2336,38 @@ fn sidebar_trait(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item, t: &clean
2325
2336
2326
2337
sidebar_assoc_items ( cx, buf, it) ;
2327
2338
2328
- buf. push_str ( "<h3 class=\" sidebar-title\" ><a href=\" #implementors\" >Implementors</a></h3>" ) ;
2339
+ if let Some ( implementors) = cache. implementors . get ( & it. def_id . expect_def_id ( ) ) {
2340
+ let mut res = implementors
2341
+ . iter ( )
2342
+ . filter ( |i| {
2343
+ i. inner_impl ( ) . for_ . def_id ( cache) . map_or ( true , |d| cache. paths . contains_key ( & d) )
2344
+ } )
2345
+ // TODO: Dont do the filter map dance
2346
+ // .filter_map(|i| extract_for_impl_name(&i.impl_item, cx))
2347
+ . map ( |i| {
2348
+ (
2349
+ format ! ( "{:#}" , i. inner_impl( ) . for_. print( cx) ) ,
2350
+ cx. nixon_hack . borrow ( ) . get ( & i. impl_item . def_id ) . unwrap ( ) . clone ( ) ,
2351
+ )
2352
+ } )
2353
+ . collect :: < Vec < _ > > ( ) ;
2354
+
2355
+ if !res. is_empty ( ) {
2356
+ res. sort_unstable ( ) ;
2357
+
2358
+ buf. push_str (
2359
+ "<h3 class=\" sidebar-title\" >\
2360
+ <a href=\" #implementors\" >Implementors</a>\
2361
+ </h3>
2362
+ <div class=\" sidebar-links\" >" ,
2363
+ ) ;
2364
+ for ( name, id) in res. into_iter ( ) {
2365
+ write ! ( buf, "<a href=\" #{}\" >{}</a>" , id, Escape ( & name) ) ;
2366
+ }
2367
+ buf. push_str ( "</div>" ) ;
2368
+ }
2369
+ }
2370
+
2329
2371
if t. is_auto {
2330
2372
buf. push_str (
2331
2373
"<h3 class=\" sidebar-title\" ><a \
0 commit comments