From d48a39a5e24ab08f727d1c919dc2af98c333ad14 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 6 Apr 2022 20:41:44 +0200 Subject: [PATCH] Switch item-info div to span to generate valid HTML --- src/librustdoc/html/render/mod.rs | 6 +++--- src/librustdoc/html/static/css/rustdoc.css | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index e223b30650541..12da16527a0eb 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -597,11 +597,11 @@ fn document_item_info( ) { let item_infos = short_item_info(item, cx, parent); if !item_infos.is_empty() { - w.write_str("
"); + w.write_str(""); for info in item_infos { w.write_str(&info); } - w.write_str("
"); + w.write_str(""); } } @@ -1772,7 +1772,7 @@ pub(crate) fn render_impl_summary( let is_trait = i.inner_impl().trait_.is_some(); if is_trait { if let Some(portability) = portability(&i.impl_item, Some(parent)) { - write!(w, "
{}
", portability); + write!(w, "{}", portability); } } diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index ee265b8c4b543..68c88b551ca74 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -737,6 +737,10 @@ h2.location a { border: none; } +.item-info { + display: block; +} + .content .item-info code { font-size: 0.875rem; }