Skip to content

Commit 3509162

Browse files
Don't generate div inside header (h4/h3/h...) elements
1 parent 02f5786 commit 3509162

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustdoc/html/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3804,7 +3804,7 @@ fn render_attributes(w: &mut dyn fmt::Write, it: &clean::Item, top: bool) -> fmt
38043804
}
38053805
}
38063806
if attrs.len() > 0 {
3807-
write!(w, "<div class=\"docblock attributes{}\">{}</div>",
3807+
write!(w, "<span class=\"docblock attributes{}\">{}</span>",
38083808
if top { " top-attr" } else { "" }, &attrs)?;
38093809
}
38103810
Ok(())

src/test/rustdoc/trait-attributes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// ignore-tidy-linelength
44

55
pub trait Foo {
6-
// @has foo/trait.Foo.html '//h3[@id="tymethod.foo"]//div[@class="docblock attributes"]' '#[must_use]'
6+
// @has foo/trait.Foo.html '//h3[@id="tymethod.foo"]//span[@class="docblock attributes"]' '#[must_use]'
77
#[must_use]
88
fn foo();
99
}
@@ -12,11 +12,11 @@ pub trait Foo {
1212
pub struct Bar;
1313

1414
impl Bar {
15-
// @has foo/struct.Bar.html '//h4[@id="method.bar"]//div[@class="docblock attributes"]' '#[must_use]'
15+
// @has foo/struct.Bar.html '//h4[@id="method.bar"]//span[@class="docblock attributes"]' '#[must_use]'
1616
#[must_use]
1717
pub fn bar() {}
1818

19-
// @has foo/struct.Bar.html '//h4[@id="method.bar2"]//div[@class="docblock attributes"]' '#[must_use]'
19+
// @has foo/struct.Bar.html '//h4[@id="method.bar2"]//span[@class="docblock attributes"]' '#[must_use]'
2020
#[must_use]
2121
pub fn bar2() {}
2222
}

0 commit comments

Comments
 (0)