@@ -719,7 +719,6 @@ fn render_impls(cx: &Context<'_>, w: &mut Buffer, impls: &[&&Impl], containing_i
719
719
& [ ] ,
720
720
ImplRenderingParameters {
721
721
show_def_docs : true ,
722
- is_on_foreign_type : false ,
723
722
show_default_items : true ,
724
723
show_non_assoc_items : true ,
725
724
toggle_open_by_default : true ,
@@ -1104,7 +1103,6 @@ fn render_assoc_items_inner(
1104
1103
& [ ] ,
1105
1104
ImplRenderingParameters {
1106
1105
show_def_docs : true ,
1107
- is_on_foreign_type : false ,
1108
1106
show_default_items : true ,
1109
1107
show_non_assoc_items : true ,
1110
1108
toggle_open_by_default : true ,
@@ -1308,7 +1306,6 @@ fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String {
1308
1306
#[ derive( Clone , Copy , Debug ) ]
1309
1307
struct ImplRenderingParameters {
1310
1308
show_def_docs : bool ,
1311
- is_on_foreign_type : bool ,
1312
1309
show_default_items : bool ,
1313
1310
/// Whether or not to show methods.
1314
1311
show_non_assoc_items : bool ,
@@ -1616,7 +1613,6 @@ fn render_impl(
1616
1613
parent,
1617
1614
rendering_params. show_def_docs ,
1618
1615
use_absolute,
1619
- rendering_params. is_on_foreign_type ,
1620
1616
aliases,
1621
1617
) ;
1622
1618
if toggled {
@@ -1693,21 +1689,12 @@ pub(crate) fn render_impl_summary(
1693
1689
containing_item : & clean:: Item ,
1694
1690
show_def_docs : bool ,
1695
1691
use_absolute : Option < bool > ,
1696
- is_on_foreign_type : bool ,
1697
1692
// This argument is used to reference same type with different paths to avoid duplication
1698
1693
// in documentation pages for trait with automatic implementations like "Send" and "Sync".
1699
1694
aliases : & [ String ] ,
1700
1695
) {
1701
- let id = cx. derive_id ( match i. inner_impl ( ) . trait_ {
1702
- Some ( ref t) => {
1703
- if is_on_foreign_type {
1704
- get_id_for_impl_on_foreign_type ( & i. inner_impl ( ) . for_ , t, cx)
1705
- } else {
1706
- format ! ( "impl-{}" , small_url_encode( format!( "{:#}" , t. print( cx) ) ) )
1707
- }
1708
- }
1709
- None => "impl" . to_string ( ) ,
1710
- } ) ;
1696
+ let id =
1697
+ cx. derive_id ( get_id_for_impl ( & i. inner_impl ( ) . for_ , i. inner_impl ( ) . trait_ . as_ref ( ) , cx) ) ;
1711
1698
let aliases = if aliases. is_empty ( ) {
1712
1699
String :: new ( )
1713
1700
} else {
@@ -2198,12 +2185,11 @@ fn sidebar_struct(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item, s: &clea
2198
2185
}
2199
2186
}
2200
2187
2201
- fn get_id_for_impl_on_foreign_type (
2202
- for_ : & clean:: Type ,
2203
- trait_ : & clean:: Path ,
2204
- cx : & Context < ' _ > ,
2205
- ) -> String {
2206
- small_url_encode ( format ! ( "impl-{:#}-for-{:#}" , trait_. print( cx) , for_. print( cx) ) )
2188
+ fn get_id_for_impl ( for_ : & clean:: Type , trait_ : Option < & clean:: Path > , cx : & Context < ' _ > ) -> String {
2189
+ match trait_ {
2190
+ Some ( t) => small_url_encode ( format ! ( "impl-{:#}-for-{:#}" , t. print( cx) , for_. print( cx) ) ) ,
2191
+ None => small_url_encode ( format ! ( "impl-{:#}" , for_. print( cx) ) ) ,
2192
+ }
2207
2193
}
2208
2194
2209
2195
fn extract_for_impl_name ( item : & clean:: Item , cx : & Context < ' _ > ) -> Option < ( String , String ) > {
@@ -2212,10 +2198,7 @@ fn extract_for_impl_name(item: &clean::Item, cx: &Context<'_>) -> Option<(String
2212
2198
i. trait_ . as_ref ( ) . map ( |trait_| {
2213
2199
// Alternative format produces no URLs,
2214
2200
// so this parameter does nothing.
2215
- (
2216
- format ! ( "{:#}" , i. for_. print( cx) ) ,
2217
- get_id_for_impl_on_foreign_type ( & i. for_ , trait_, cx) ,
2218
- )
2201
+ ( format ! ( "{:#}" , i. for_. print( cx) ) , get_id_for_impl ( & i. for_ , Some ( trait_) , cx) )
2219
2202
} )
2220
2203
}
2221
2204
_ => None ,
0 commit comments