diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 617d2a9b58d..95d48056389 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -2265,8 +2265,8 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, if fields.peek().is_some() { write!(w, "
{name}: {ty}
- ",
+ write!(w, "{name}: {ty}
+ ",
shortty = ItemType::StructField,
stab = field.stability_class(),
name = field.name.as_ref().unwrap(),
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index da04f26a70b..6d2b315502e 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -659,6 +659,10 @@ span.since {
margin-bottom: 25px;
}
+.variant, .structfield {
+ display: block;
+}
+
:target > code {
background: #FDFFD3;
}