Skip to content

Commit f145f28

Browse files
committed
rustdoc: add missing margin to no-docblock trait items
Fixes another regression caused by 8846c08, this time fixing the appearance of methods that have no docblock (we didn't notice this one because libstd docs *always* have docblocks). See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/trait.AttributesExt.html
1 parent 8728e17 commit f145f28

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/librustdoc/html/render/print_item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
718718
if toggled {
719719
write!(w, "<details class=\"rustdoc-toggle method-toggle\" open><summary>");
720720
}
721-
write!(w, "<div id=\"{}\" class=\"method has-srclink\">", id);
721+
write!(w, "<section id=\"{}\" class=\"method has-srclink\">", id);
722722
render_rightside(w, cx, m, t, RenderMode::Normal);
723723
write!(w, "<h4 class=\"code-header\">");
724724
render_assoc_item(
@@ -730,7 +730,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
730730
RenderMode::Normal,
731731
);
732732
w.write_str("</h4>");
733-
w.write_str("</div>");
733+
w.write_str("</section>");
734734
if toggled {
735735
write!(w, "</summary>");
736736
w.push_buffer(content);

src/librustdoc/html/static/css/rustdoc.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,8 @@ in storage.js plus the media query with (min-width: 701px)
20102010
.impl,
20112011
#implementors-list > .docblock,
20122012
.impl-items > section,
2013-
{
2013+
.methods > section
2014+
{
20142015
margin-bottom: 0.75em;
20152016
}
20162017

0 commit comments

Comments
 (0)