Skip to content

Commit bf81e13

Browse files
committed
Restore details for Impls on Foreign Types
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.
1 parent 2ac5c17 commit bf81e13

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/librustdoc/html/render/print_item.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ use rustc_span::symbol::{kw, sym, Symbol};
1515
use super::{
1616
collect_paths_for_type, document, ensure_trailing_slash, item_ty_to_strs, notable_traits_decl,
1717
render_assoc_item, render_assoc_items, render_attributes_in_code, render_attributes_in_pre,
18-
render_impl_summary, render_stability_since_raw, write_srclink, AssocItemLink, Context,
18+
render_impl, render_impl_summary, render_stability_since_raw, write_srclink, AssocItemLink,
19+
Context,
1920
};
2021
use crate::clean::{self, GetDefId};
2122
use crate::formats::item_type::ItemType;
22-
use crate::formats::{AssocItemRender, Impl};
23+
use crate::formats::{AssocItemRender, Impl, RenderMode};
2324
use crate::html::escape::Escape;
2425
use crate::html::format::{print_abi_with_space, print_where_clause, Buffer, PrintWithSpace};
2526
use crate::html::highlight;
@@ -694,15 +695,20 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
694695
write_small_section_header(w, "foreign-impls", "Implementations on Foreign Types", "");
695696

696697
for implementor in foreign {
697-
render_impl_summary(
698+
let provided_methods = implementor.inner_impl().provided_trait_methods(cx.tcx());
699+
let assoc_link =
700+
AssocItemLink::GotoSource(implementor.impl_item.def_id, &provided_methods);
701+
render_impl(
698702
w,
699703
cx,
700704
&implementor,
701705
it,
702-
&implementor.impl_item,
706+
assoc_link,
707+
RenderMode::Normal,
703708
false,
704709
None,
705710
true,
711+
false,
706712
&[],
707713
);
708714
}

0 commit comments

Comments
 (0)