diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 96a9315599f..4c652f54009 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2144,7 +2144,7 @@ fn render_stability_since_raw<'a>(w: &mut fmt::Formatter,
containing_ver: Option<&'a str>) -> fmt::Result {
if let Some(v) = ver {
if containing_ver != ver && v.len() > 0 {
- write!(w, "{}",
+ write!(w, "
{}
",
v)?
}
}
@@ -2545,13 +2545,16 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
render_header: bool, outer_version: Option<&str>) -> fmt::Result {
if render_header {
write!(w, "{}
", i.inner_impl())?;
- let since = i.impl_item.stability.as_ref().map(|s| &s.since[..]);
- render_stability_since_raw(w, since, outer_version)?;
write!(w, "")?;
+ let since = i.impl_item.stability.as_ref().map(|s| &s.since[..]);
if let Some(l) = (Item { item: &i.impl_item, cx: cx }).href() {
+ write!(w, "")?;
+ render_stability_since_raw(w, since, outer_version)?;
write!(w, "[src]",
i.impl_item.def_id.index.as_usize(), l, "goto source code")?;
+ } else {
+ render_stability_since_raw(w, since, outer_version)?;
}
write!(w, "")?;
write!(w, "
\n")?;
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 94b59fe2add..4d65b91ed42 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -97,6 +97,7 @@ h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):no
h1.fqn {
border-bottom: 1px dashed;
margin-top: 0;
+ position: relative;
}
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
border-bottom: 1px solid;
@@ -105,6 +106,7 @@ h3.impl, h3.method, h4.method, h3.type, h4.type {
font-weight: 600;
margin-top: 10px;
margin-bottom: 10px;
+ position: relative;
}
h3.impl, h3.method, h3.type {
margin-top: 15px;
@@ -265,25 +267,39 @@ nav.sub {
.content .out-of-band {
font-size: 23px;
- width: 40%;
margin: 0px;
padding: 0px;
text-align: right;
display: inline-block;
font-weight: normal;
+ position: absolute;
+ right: 0;
}
h3.impl > .out-of-band {
font-size: 21px;
}
+h4 > code, h3 > code {
+ position: inherit;
+}
+
+.in-band, code {
+ z-index: 5;
+}
+
.content .in-band {
- width: 60%;
margin: 0px;
padding: 0px;
display: inline-block;
}
+#main { position: relative; }
+#main > .since {
+ top: inherit;
+ font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
+}
+
.content table {
border-spacing: 0 5px;
border-collapse: separate;
@@ -503,11 +519,13 @@ em.stab p {
opacity: 0.65;
}
-span.since {
- float: right;
+.since {
font-weight: normal;
font-size: initial;
color: grey;
+ position: absolute;
+ right: 0;
+ top: 0;
}
.variants_table {
@@ -602,7 +620,19 @@ a.test-arrow {
color: #999;
}
+.ghost {
+ display: none;
+}
+.ghost + .since {
+ position: initial;
+ display: table-cell;
+}
+
+.since + .srclink {
+ display: table-cell;
+ padding-left: 10px;
+}
/* Media Queries */
diff --git a/src/librustdoc/html/static/styles/main.css b/src/librustdoc/html/static/styles/main.css
index 5c073860f08..59b2ff7e3d6 100644
--- a/src/librustdoc/html/static/styles/main.css
+++ b/src/librustdoc/html/static/styles/main.css
@@ -26,6 +26,9 @@ h1.fqn {
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
border-bottom-color: #DDDDDD;
}
+.in-band, code {
+ background-color: white;
+}
.docblock code {
background-color: #F5F5F5;