Skip to content

Commit

Permalink
Restore details for Impls on Foreign Types
Browse files Browse the repository at this point in the history
These were previously removed along with the details in the
"Implementors" section of trait pages. But for "Implementations on
Foreign Types," we need to include the details because they will not be
documented anywhere else.
  • Loading branch information
jsha committed Jun 17, 2021
1 parent 2ac5c17 commit bf81e13
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ use rustc_span::symbol::{kw, sym, Symbol};
use super::{
collect_paths_for_type, document, ensure_trailing_slash, item_ty_to_strs, notable_traits_decl,
render_assoc_item, render_assoc_items, render_attributes_in_code, render_attributes_in_pre,
render_impl_summary, render_stability_since_raw, write_srclink, AssocItemLink, Context,
render_impl, render_impl_summary, render_stability_since_raw, write_srclink, AssocItemLink,
Context,
};
use crate::clean::{self, GetDefId};
use crate::formats::item_type::ItemType;
use crate::formats::{AssocItemRender, Impl};
use crate::formats::{AssocItemRender, Impl, RenderMode};
use crate::html::escape::Escape;
use crate::html::format::{print_abi_with_space, print_where_clause, Buffer, PrintWithSpace};
use crate::html::highlight;
Expand Down Expand Up @@ -694,15 +695,20 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
write_small_section_header(w, "foreign-impls", "Implementations on Foreign Types", "");

for implementor in foreign {
render_impl_summary(
let provided_methods = implementor.inner_impl().provided_trait_methods(cx.tcx());
let assoc_link =
AssocItemLink::GotoSource(implementor.impl_item.def_id, &provided_methods);
render_impl(
w,
cx,
&implementor,
it,
&implementor.impl_item,
assoc_link,
RenderMode::Normal,
false,
None,
true,
false,
&[],
);
}
Expand Down

0 comments on commit bf81e13

Please sign in to comment.