@@ -490,7 +490,6 @@ fn settings(root_path: &str, suffix: &str, themes: &[StylePath]) -> Result<Strin
490
490
( "auto-hide-method-docs" , "Auto-hide item methods' documentation" , false ) . into ( ) ,
491
491
( "auto-hide-trait-implementations" , "Auto-hide trait implementation documentation" , false )
492
492
. into ( ) ,
493
- ( "auto-collapse-implementors" , "Auto-hide implementors of a trait" , true ) . into ( ) ,
494
493
( "go-to-only-result" , "Directly go to item in search if there is only one result" , false )
495
494
. into ( ) ,
496
495
( "line-numbers" , "Show line numbers on code examples" , false ) . into ( ) ,
@@ -1543,7 +1542,10 @@ fn render_impl(
1543
1542
}
1544
1543
}
1545
1544
if render_mode == RenderMode :: Normal {
1546
- let toggled = !impl_items. is_empty ( ) || !default_impl_items. is_empty ( ) ;
1545
+ let on_trait_page = matches ! ( * parent. kind, clean:: ItemKind :: TraitItem ( _) ) ;
1546
+ let has_impl_items = !( impl_items. is_empty ( ) && default_impl_items. is_empty ( ) ) ;
1547
+ let toggled = !on_trait_page && has_impl_items;
1548
+ let is_implementing_trait = i. inner_impl ( ) . trait_ . is_some ( ) ;
1547
1549
if toggled {
1548
1550
close_tags. insert_str ( 0 , "</details>" ) ;
1549
1551
write ! ( w, "<details class=\" rustdoc-toggle implementors-toggle\" open>" ) ;
@@ -1571,21 +1573,23 @@ fn render_impl(
1571
1573
}
1572
1574
}
1573
1575
1574
- if let Some ( ref dox) = cx. shared . maybe_collapsed_doc_value ( & i. impl_item ) {
1575
- let mut ids = cx. id_map . borrow_mut ( ) ;
1576
- write ! (
1577
- w,
1578
- "<div class=\" docblock\" >{}</div>" ,
1579
- Markdown (
1580
- & * dox,
1581
- & i. impl_item. links( cx) ,
1582
- & mut ids,
1583
- cx. shared. codes,
1584
- cx. shared. edition( ) ,
1585
- & cx. shared. playground
1586
- )
1587
- . into_string( )
1588
- ) ;
1576
+ if !on_trait_page {
1577
+ if let Some ( ref dox) = cx. shared . maybe_collapsed_doc_value ( & i. impl_item ) {
1578
+ let mut ids = cx. id_map . borrow_mut ( ) ;
1579
+ write ! (
1580
+ w,
1581
+ "<div class=\" docblock\" >{}</div>" ,
1582
+ Markdown (
1583
+ & * dox,
1584
+ & i. impl_item. links( cx) ,
1585
+ & mut ids,
1586
+ cx. shared. codes,
1587
+ cx. shared. edition( ) ,
1588
+ & cx. shared. playground
1589
+ )
1590
+ . into_string( )
1591
+ ) ;
1592
+ }
1589
1593
}
1590
1594
}
1591
1595
if !default_impl_items. is_empty ( ) || !impl_items. is_empty ( ) {
0 commit comments