@@ -634,7 +634,6 @@ fn render_impls(
634634 & [ ] ,
635635 ImplRenderingParameters {
636636 show_def_docs : true ,
637- is_on_foreign_type : false ,
638637 show_default_items : true ,
639638 show_non_assoc_items : true ,
640639 toggle_open_by_default,
@@ -1071,7 +1070,6 @@ fn render_assoc_items_inner(
10711070 & [ ] ,
10721071 ImplRenderingParameters {
10731072 show_def_docs : true ,
1074- is_on_foreign_type : false ,
10751073 show_default_items : true ,
10761074 show_non_assoc_items : true ,
10771075 toggle_open_by_default : true ,
@@ -1287,7 +1285,6 @@ fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String {
12871285#[ derive( Clone , Copy , Debug ) ]
12881286struct ImplRenderingParameters {
12891287 show_def_docs : bool ,
1290- is_on_foreign_type : bool ,
12911288 show_default_items : bool ,
12921289 /// Whether or not to show methods.
12931290 show_non_assoc_items : bool ,
@@ -1603,7 +1600,6 @@ fn render_impl(
16031600 parent,
16041601 rendering_params. show_def_docs ,
16051602 use_absolute,
1606- rendering_params. is_on_foreign_type ,
16071603 aliases,
16081604 ) ;
16091605 if toggled {
@@ -1688,21 +1684,12 @@ pub(crate) fn render_impl_summary(
16881684 containing_item : & clean:: Item ,
16891685 show_def_docs : bool ,
16901686 use_absolute : Option < bool > ,
1691- is_on_foreign_type : bool ,
16921687 // This argument is used to reference same type with different paths to avoid duplication
16931688 // in documentation pages for trait with automatic implementations like "Send" and "Sync".
16941689 aliases : & [ String ] ,
16951690) {
1696- let id = cx. derive_id ( match i. inner_impl ( ) . trait_ {
1697- Some ( ref t) => {
1698- if is_on_foreign_type {
1699- get_id_for_impl_on_foreign_type ( & i. inner_impl ( ) . for_ , t, cx)
1700- } else {
1701- format ! ( "impl-{}" , small_url_encode( format!( "{:#}" , t. print( cx) ) ) )
1702- }
1703- }
1704- None => "impl" . to_string ( ) ,
1705- } ) ;
1691+ let id =
1692+ cx. derive_id ( get_id_for_impl ( & i. inner_impl ( ) . for_ , i. inner_impl ( ) . trait_ . as_ref ( ) , cx) ) ;
17061693 let aliases = if aliases. is_empty ( ) {
17071694 String :: new ( )
17081695 } else {
@@ -2147,12 +2134,11 @@ fn sidebar_struct(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item, s: &clea
21472134 }
21482135}
21492136
2150- fn get_id_for_impl_on_foreign_type (
2151- for_ : & clean:: Type ,
2152- trait_ : & clean:: Path ,
2153- cx : & Context < ' _ > ,
2154- ) -> String {
2155- small_url_encode ( format ! ( "impl-{:#}-for-{:#}" , trait_. print( cx) , for_. print( cx) ) )
2137+ fn get_id_for_impl ( for_ : & clean:: Type , trait_ : Option < & clean:: Path > , cx : & Context < ' _ > ) -> String {
2138+ match trait_ {
2139+ Some ( t) => small_url_encode ( format ! ( "impl-{:#}-for-{:#}" , t. print( cx) , for_. print( cx) ) ) ,
2140+ None => small_url_encode ( format ! ( "impl-{:#}" , for_. print( cx) ) ) ,
2141+ }
21562142}
21572143
21582144fn extract_for_impl_name ( item : & clean:: Item , cx : & Context < ' _ > ) -> Option < ( String , String ) > {
@@ -2161,10 +2147,7 @@ fn extract_for_impl_name(item: &clean::Item, cx: &Context<'_>) -> Option<(String
21612147 i. trait_ . as_ref ( ) . map ( |trait_| {
21622148 // Alternative format produces no URLs,
21632149 // so this parameter does nothing.
2164- (
2165- format ! ( "{:#}" , i. for_. print( cx) ) ,
2166- get_id_for_impl_on_foreign_type ( & i. for_ , trait_, cx) ,
2167- )
2150+ ( format ! ( "{:#}" , i. for_. print( cx) ) , get_id_for_impl ( & i. for_ , Some ( trait_) , cx) )
21682151 } )
21692152 }
21702153 _ => None ,
0 commit comments