about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-09-30 10:15:59 -0700
committerMichael Howell <michael@notriddle.com>2022-09-30 10:45:19 -0700
commitf145f283f737d766404f39b26dd773eadc98e344 (patch)
tree79bd418ae483b9f4ed39de659428920b13d59a5d
parent8728e178554eb7b0eeb4d8c2e254b07a3bccd4cb (diff)
downloadrust-f145f283f737d766404f39b26dd773eadc98e344.tar.gz
rust-f145f283f737d766404f39b26dd773eadc98e344.zip
rustdoc: add missing margin to no-docblock trait items
Fixes another regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee,
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
-rw-r--r--src/librustdoc/html/render/print_item.rs4
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 9f6b6b52536..7bd0dbf9325 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -718,7 +718,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
         if toggled {
             write!(w, "<details class=\"rustdoc-toggle method-toggle\" open><summary>");
         }
-        write!(w, "<div id=\"{}\" class=\"method has-srclink\">", id);
+        write!(w, "<section id=\"{}\" class=\"method has-srclink\">", id);
         render_rightside(w, cx, m, t, RenderMode::Normal);
         write!(w, "<h4 class=\"code-header\">");
         render_assoc_item(
@@ -730,7 +730,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
             RenderMode::Normal,
         );
         w.write_str("</h4>");
-        w.write_str("</div>");
+        w.write_str("</section>");
         if toggled {
             write!(w, "</summary>");
             w.push_buffer(content);
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 37c95f6c784..8ffd092426d 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -2010,7 +2010,8 @@ in storage.js plus the media query with (min-width: 701px)
 .impl,
 #implementors-list > .docblock,
 .impl-items > section,
- {
+.methods > section
+{
 	margin-bottom: 0.75em;
 }