",
);
@@ -1153,8 +1152,9 @@ fn render_assoc_items_inner(
if !blanket_impl.is_empty() {
w.write_str(
"\
",
);
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 44a9ec5ea4210..1fd3bfe92038f 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -660,7 +660,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
write!(
w,
"{2}",
id, title, extra_content
)
@@ -1001,7 +1001,7 @@ fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Uni
write!(
w,
"
\
- Fields
"
+
Fields"
);
for (field, ty) in fields {
let name = field.name.as_ref().expect("union field name");
@@ -1108,7 +1108,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
write!(
w,
"
\
- Variants{}
",
+
Variants{}",
document_non_exhaustive_header(it)
);
document_non_exhaustive(w, it);
@@ -1300,7 +1300,7 @@ fn item_struct(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
write!(
w,
"
\
- {}{}\
+ {}{}\
",
if let CtorKind::Fictive = s.struct_type { "Fields" } else { "Tuple Fields" },
document_non_exhaustive_header(it)
@@ -1732,7 +1732,8 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
return;
}
- writeln!(w, "");
+ writeln!(w, "");
writeln!(w, "
");
let tcx = cx.tcx();
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index e5c667a37c669..650d649dede70 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1129,6 +1129,7 @@ a.test-arrow:hover{
text-decoration: none;
}
+.small-section-header:hover > a:before,
.section-header:hover a:before {
position: absolute;
left: -25px;
@@ -1136,6 +1137,11 @@ a.test-arrow:hover{
content: '\2002\00a7\2002';
}
+#deref-methods-str > a.anchor:before {
+ position: relative;
+ left: -0.5em;
+}
+
.section-header:hover a {
text-decoration: none;
}
diff --git a/src/test/rustdoc-gui/anchors.goml b/src/test/rustdoc-gui/anchors.goml
index ca60be72cea46..05bf689f8c38a 100644
--- a/src/test/rustdoc-gui/anchors.goml
+++ b/src/test/rustdoc-gui/anchors.goml
@@ -23,7 +23,7 @@ assert-css: (".in-band a", {"color": "rgb(0, 0, 0)"})
// We move the cursor over the "Implementations" title so the anchor is displayed.
move-cursor-to: "h2#implementations"
-assert-css: ("h2#implementations a.anchor", {"color": "rgb(0, 0, 0)"})
+assert-css: ("h2#implementations", {"color": "rgb(0, 0, 0)"})
// Same thing with the impl block title.
move-cursor-to: "#impl"