From 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30 Mon Sep 17 00:00:00 2001 From: bors Date: Sun, 25 Jul 2021 21:41:57 +0000 Subject: Rustdoc accessibility: use real headers for doc items Part of #87059 Partially reverts #84703 Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html --- src/librustdoc/html/render/mod.rs | 22 +++++++++++----------- src/librustdoc/html/render/print_item.rs | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/librustdoc/html/render') diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 68c59612ccc..2b7f7aa3691 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1194,7 +1194,7 @@ fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String { if out.is_empty() { write!( &mut out, - "

Notable traits for {}

\ + "
Notable traits for {}
\ ", impl_.for_.print(cx) ); @@ -1350,7 +1350,7 @@ fn render_impl( ); render_rightside(w, cx, item, containing_item); write!(w, "", id); - w.write_str(""); + w.write_str("

"); render_assoc_item( w, item, @@ -1358,7 +1358,7 @@ fn render_impl( ItemType::Impl, cx, ); - w.write_str(""); + w.write_str("

"); w.write_str(""); } } @@ -1371,7 +1371,7 @@ fn render_impl( id, item_type, in_trait_class ); write!(w, "", id); - w.write_str(""); + w.write_str("

"); assoc_type( w, item, @@ -1381,7 +1381,7 @@ fn render_impl( "", cx, ); - w.write_str(""); + w.write_str("

"); w.write_str(""); } clean::AssocConstItem(ref ty, ref default) => { @@ -1394,7 +1394,7 @@ fn render_impl( ); render_rightside(w, cx, item, containing_item); write!(w, "", id); - w.write_str(""); + w.write_str("

"); assoc_const( w, item, @@ -1404,7 +1404,7 @@ fn render_impl( "", cx, ); - w.write_str(""); + w.write_str("

"); w.write_str(""); } clean::AssocTypeItem(ref bounds, ref default) => { @@ -1412,7 +1412,7 @@ fn render_impl( let id = cx.derive_id(source_id.clone()); write!(w, "
", id, item_type, in_trait_class,); write!(w, "", id); - w.write_str(""); + w.write_str("

"); assoc_type( w, item, @@ -1422,7 +1422,7 @@ fn render_impl( "", cx, ); - w.write_str(""); + w.write_str("

"); w.write_str("
"); } clean::StrippedItem(..) => return, @@ -1613,7 +1613,7 @@ pub(crate) fn render_impl_summary( write!(w, "
", id, aliases); render_rightside(w, cx, &i.impl_item, containing_item); write!(w, "", id); - write!(w, ""); + write!(w, "

"); if let Some(use_absolute) = use_absolute { write!(w, "{}", i.inner_impl().print(use_absolute, cx)); @@ -1629,7 +1629,7 @@ pub(crate) fn render_impl_summary( } else { write!(w, "{}", i.inner_impl().print(false, cx)); } - write!(w, ""); + write!(w, "

"); let is_trait = i.inner_impl().trait_.is_some(); if is_trait { diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 552958d5e40..50793acbbf0 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -621,9 +621,9 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra render_stability_since(w, m, t, cx.tcx()); write_srclink(cx, m, w); write!(w, "
"); - write!(w, ""); + write!(w, "

"); render_assoc_item(w, m, AssocItemLink::Anchor(Some(&id)), ItemType::Impl, cx); - w.write_str(""); + w.write_str("

"); w.write_str(""); if toggled { write!(w, ""); -- cgit 1.4.1-3-g733a5