Skip to content

Commit fe6d69f

Browse files
authored
Rollup merge of #95738 - GuillaumeGomez:item-info-switch-to-span, r=jsha
Switch item-info from div to span Following discussion in #95684. cc `@jsha` r? `@notriddle`
2 parents b22df08 + 56d0f94 commit fe6d69f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/librustdoc/html/render/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -597,11 +597,11 @@ fn document_item_info(
597597
) {
598598
let item_infos = short_item_info(item, cx, parent);
599599
if !item_infos.is_empty() {
600-
w.write_str("<div class=\"item-info\">");
600+
w.write_str("<span class=\"item-info\">");
601601
for info in item_infos {
602602
w.write_str(&info);
603603
}
604-
w.write_str("</div>");
604+
w.write_str("</span>");
605605
}
606606
}
607607

@@ -1772,7 +1772,7 @@ pub(crate) fn render_impl_summary(
17721772
let is_trait = i.inner_impl().trait_.is_some();
17731773
if is_trait {
17741774
if let Some(portability) = portability(&i.impl_item, Some(parent)) {
1775-
write!(w, "<div class=\"item-info\">{}</div>", portability);
1775+
write!(w, "<span class=\"item-info\">{}</span>", portability);
17761776
}
17771777
}
17781778

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

+4
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,10 @@ h2.location a {
737737
border: none;
738738
}
739739

740+
.item-info {
741+
display: block;
742+
}
743+
740744
.content .item-info code {
741745
font-size: 0.875rem;
742746
}

src/test/rustdoc/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
pub struct Unstable {
66
// @has stability/struct.Unstable.html \
7-
// '//div[@class="item-info"]//div[@class="stab unstable"]' \
7+
// '//span[@class="item-info"]//div[@class="stab unstable"]' \
88
// 'This is a nightly-only experimental API'
99
// @count stability/struct.Unstable.html '//span[@class="stab unstable"]' 0
1010
pub foo: u32,

0 commit comments

Comments
 (0)