diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index bb9a7be590e87..df3701487d797 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1345,6 +1345,7 @@ impl AllTypes { write!( f, "

\ + List of all items\ \ \ \ - List of all items\

" ); print_entries(f, &self.structs, "Structs", "structs"); @@ -1711,36 +1711,7 @@ where fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer) { debug_assert!(!item.is_stripped()); // Write the breadcrumb trail header for the top - write!(buf, "

"); - render_stability_since_raw( - buf, - item.stable_since(cx.tcx()).as_deref(), - item.const_stable_since(cx.tcx()).as_deref(), - None, - None, - ); - write!( - buf, - "\ - \ - []\ - \ - " - ); - - // Write `src` tag - // - // When this item is part of a `crate use` in a downstream crate, the - // [src] link in the downstream documentation will actually come back to - // this page, and this link will be auto-clicked. The `id` attribute is - // used to find the link to auto-click. - if cx.shared.include_sources && !item.is_primitive() { - write_srclink(cx, item, buf); - } - - write!(buf, ""); // out-of-band - write!(buf, ""); + write!(buf, "

"); let name = match *item.kind { clean::ModuleItem(ref m) => { if m.is_crate { @@ -1788,7 +1759,36 @@ fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer) { } write!(buf, "{}", item.type_(), item.name.as_ref().unwrap()); - write!(buf, "

"); // in-band + write!(buf, "
"); // in-band + write!(buf, ""); + render_stability_since_raw( + buf, + item.stable_since(cx.tcx()).as_deref(), + item.const_stable_since(cx.tcx()).as_deref(), + None, + None, + ); + write!( + buf, + "\ + \ + []\ + \ + " + ); + + // Write `src` tag + // + // When this item is part of a `crate use` in a downstream crate, the + // [src] link in the downstream documentation will actually come back to + // this page, and this link will be auto-clicked. The `id` attribute is + // used to find the link to auto-click. + if cx.shared.include_sources && !item.is_primitive() { + write_srclink(cx, item, buf); + } + + write!(buf, "

"); // out-of-band match *item.kind { clean::ModuleItem(ref m) => item_module(buf, cx, item, &m.items),