diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 9b1d256304dd..e89bd7aae9bf 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2141,7 +2141,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
if !types.is_empty() {
write!(w, "
-
Associated Types
+
")?;
for t in &types {
@@ -2152,7 +2154,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
if !consts.is_empty() {
write!(w, "
-
Associated Constants
+
")?;
for t in &consts {
@@ -2164,7 +2168,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
// Output the documentation for each function individually
if !required.is_empty() {
write!(w, "
-
Required Methods
+
")?;
for m in &required {
@@ -2174,7 +2180,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
}
if !provided.is_empty() {
write!(w, "
-
Provided Methods
+
")?;
for m in &provided {
@@ -2188,7 +2196,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
let cache = cache();
write!(w, "
-
Implementors
+
")?;
if let Some(implementors) = cache.implementors.get(&it.def_id) {
@@ -2419,7 +2429,8 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
}).peekable();
if let doctree::Plain = s.struct_type {
if fields.peek().is_some() {
- write!(w, "Fields
")?;
+ write!(w, "")?;
for (field, ty) in fields {
let id = derive_id(format!("{}.{}",
ItemType::StructField,
@@ -2467,7 +2478,8 @@ fn item_union(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
}
}).peekable();
if fields.peek().is_some() {
- write!(w, "Fields
")?;
+ write!(w, "")?;
for (field, ty) in fields {
write!(w, "{name}: {ty}
",
@@ -2539,7 +2551,8 @@ fn item_enum(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
document(w, cx, it)?;
if !e.variants.is_empty() {
- write!(w, "Variants
\n")?;
+ write!(w, "\n")?;
for variant in &e.variants {
let id = derive_id(format!("{}.{}",
ItemType::Variant,
@@ -2810,12 +2823,19 @@ fn render_assoc_items(w: &mut fmt::Formatter,
if !non_trait.is_empty() {
let render_mode = match what {
AssocItemRender::All => {
- write!(w, "Methods
")?;
+ write!(w, "
+
+ ")?;
RenderMode::Normal
}
AssocItemRender::DerefFor { trait_, type_, deref_mut_ } => {
- write!(w, "Methods from \
- {}<Target = {}>
", trait_, type_)?;
+ write!(w, "
+
+ ", trait_, type_)?;
RenderMode::ForDeref { mut_: deref_mut_ }
}
};
@@ -2837,8 +2857,11 @@ fn render_assoc_items(w: &mut fmt::Formatter,
}).is_some();
render_deref_methods(w, cx, impl_, containing_item, has_deref_mut)?;
}
- write!(w, "Trait \
- Implementations
")?;
+ write!(w, "
+
+ ")?;
for i in &traits {
let did = i.trait_did().unwrap();
let assoc_link = AssocItemLink::GotoSource(did, &i.inner_impl().provided_trait_methods);