Skip to content

Commit d48a39a

Browse files
Switch item-info div to span to generate valid HTML
1 parent 201cf3d commit d48a39a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: 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

Diff for: 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
}

0 commit comments

Comments
 (0)