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

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

" ); print_entries(f, &self.structs, "Structs", "structs"); @@ -1712,37 +1712,9 @@ where fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer, cache: &Cache) { 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, cache); - } - write!(buf, ""); // out-of-band - write!(buf, ""); + // Write the breadcrumb trail header for the top + write!(buf, "

"); let name = match *item.kind { clean::ModuleItem(ref m) => { if m.is_crate { @@ -1790,7 +1762,37 @@ fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer, cache: &Ca } 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, cache); + } + + write!(buf, "

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