diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index eaa6f85906c..d66adb5ecfa 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1662,8 +1662,13 @@ fn document_full(w: &mut fmt::Formatter, item: &clean::Item) -> fmt::Result {
}
fn document_stability(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item) -> fmt::Result {
- for stability in short_stability(item, cx, true) {
- write!(w, "
{}
", stability)?;
+ let stabilities = short_stability(item, cx, true);
+ if !stabilities.is_empty() {
+ write!(w, "")?;
+ for stability in stabilities {
+ write!(w, "{}", stability)?;
+ }
+ write!(w, "
")?;
}
Ok(())
}
@@ -1862,7 +1867,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec{}", text))
+ stability.push(format!("{}
", text))
};
if stab.level == stability::Unstable {
@@ -1887,7 +1892,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec{}", text))
+ stability.push(format!("{}
", text))
};
} else if let Some(depr) = item.deprecation.as_ref() {
let note = if show_reason && !depr.note.is_empty() {
@@ -1902,7 +1907,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec{}", text))
+ stability.push(format!("{}
", text))
}
stability
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index ce7c6acdf47..0ca4f7ea36f 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -523,20 +523,20 @@ body.blur > :not(#help) {
padding: 20px;
}
-em.stab {
- display: inline-block;
+.stab {
+ display: table;
border-width: 1px;
border-style: solid;
padding: 3px;
margin-bottom: 5px;
font-size: 90%;
- font-style: normal;
}
-em.stab p {
+.stab p {
display: inline;
}
.module-item .stab {
+ display: inline;
border-width: 0;
padding: 0;
margin: 0;
diff --git a/src/librustdoc/html/static/styles/main.css b/src/librustdoc/html/static/styles/main.css
index 6a9a24f6996..862d6d12b9a 100644
--- a/src/librustdoc/html/static/styles/main.css
+++ b/src/librustdoc/html/static/styles/main.css
@@ -30,10 +30,6 @@ h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.t
background-color: white;
}
-div.stability > em > code {
- background-color: initial;
-}
-
.docblock code, .docblock-short code {
background-color: #F5F5F5;
}
@@ -129,5 +125,5 @@ a.test-arrow {
background-color: white;
}
-em.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
-em.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }
+.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
+.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }