@@ -3066,7 +3066,7 @@ fn render_implementor(cx: &Context, implementor: &Impl, w: &mut fmt::Formatter<'
3066
3066
_ => false ,
3067
3067
} ;
3068
3068
render_impl ( w, cx, implementor, AssocItemLink :: Anchor ( None ) , RenderMode :: Normal ,
3069
- implementor. impl_item . stable_since ( ) , false , Some ( use_absolute) , false ) ?;
3069
+ implementor. impl_item . stable_since ( ) , false , Some ( use_absolute) , false , false ) ?;
3070
3070
Ok ( ( ) )
3071
3071
}
3072
3072
@@ -3077,7 +3077,7 @@ fn render_impls(cx: &Context, w: &mut fmt::Formatter<'_>,
3077
3077
let did = i. trait_did ( ) . unwrap ( ) ;
3078
3078
let assoc_link = AssocItemLink :: GotoSource ( did, & i. inner_impl ( ) . provided_trait_methods ) ;
3079
3079
render_impl ( w, cx, i, assoc_link,
3080
- RenderMode :: Normal , containing_item. stable_since ( ) , true , None , false ) ?;
3080
+ RenderMode :: Normal , containing_item. stable_since ( ) , true , None , false , true ) ?;
3081
3081
}
3082
3082
Ok ( ( ) )
3083
3083
}
@@ -3307,7 +3307,7 @@ fn item_trait(
3307
3307
) ;
3308
3308
render_impl ( w, cx, & implementor, assoc_link,
3309
3309
RenderMode :: Normal , implementor. impl_item . stable_since ( ) , false ,
3310
- None , true ) ?;
3310
+ None , true , false ) ?;
3311
3311
}
3312
3312
write_loading_content ( w, "" ) ?;
3313
3313
}
@@ -3979,7 +3979,7 @@ fn render_assoc_items(w: &mut fmt::Formatter<'_>,
3979
3979
} ;
3980
3980
for i in & non_trait {
3981
3981
render_impl ( w, cx, i, AssocItemLink :: Anchor ( None ) , render_mode,
3982
- containing_item. stable_since ( ) , true , None , false ) ?;
3982
+ containing_item. stable_since ( ) , true , None , false , true ) ?;
3983
3983
}
3984
3984
}
3985
3985
if let AssocItemRender :: DerefFor { .. } = what {
@@ -4161,7 +4161,8 @@ fn spotlight_decl(decl: &clean::FnDecl) -> Result<String, fmt::Error> {
4161
4161
4162
4162
fn render_impl ( w : & mut fmt:: Formatter < ' _ > , cx : & Context , i : & Impl , link : AssocItemLink < ' _ > ,
4163
4163
render_mode : RenderMode , outer_version : Option < & str > , show_def_docs : bool ,
4164
- use_absolute : Option < bool > , is_on_foreign_type : bool ) -> fmt:: Result {
4164
+ use_absolute : Option < bool > , is_on_foreign_type : bool ,
4165
+ show_default_items : bool ) -> fmt:: Result {
4165
4166
if render_mode == RenderMode :: Normal {
4166
4167
let id = cx. derive_id ( match i. inner_impl ( ) . trait_ {
4167
4168
Some ( ref t) => if is_on_foreign_type {
@@ -4345,9 +4346,13 @@ fn render_impl(w: &mut fmt::Formatter<'_>, cx: &Context, i: &Impl, link: AssocIt
4345
4346
4346
4347
// If we've implemented a trait, then also emit documentation for all
4347
4348
// default items which weren't overridden in the implementation block.
4348
- if let Some ( t) = trait_ {
4349
- render_default_items ( w, cx, t, & i. inner_impl ( ) ,
4350
- render_mode, outer_version, show_def_docs) ?;
4349
+ // We don't emit documentation for default items if they appear in the
4350
+ // Implementations on Foreign Types or Implementors sections.
4351
+ if show_default_items {
4352
+ if let Some ( t) = trait_ {
4353
+ render_default_items ( w, cx, t, & i. inner_impl ( ) ,
4354
+ render_mode, outer_version, show_def_docs) ?;
4355
+ }
4351
4356
}
4352
4357
write ! ( w, "</div>" ) ?;
4353
4358
0 commit comments