Skip to content

Commit d0580a7

Browse files
committedMay 10, 2016
Rollup merge of rust-lang#33542 - GuillaumeGomez:move_since, r=steveklabnik
Improve "since" tag placement Continuation of rust-lang#33431. r? @steveklabnik
2 parents 26cca1a + a5a2f2b commit d0580a7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
 

‎src/librustdoc/html/render.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,6 @@ impl<'a> Item<'a> {
15371537
}
15381538
}
15391539

1540-
15411540
impl<'a> fmt::Display for Item<'a> {
15421541
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
15431542
debug_assert!(!self.item.is_stripped());
@@ -1575,6 +1574,9 @@ impl<'a> fmt::Display for Item<'a> {
15751574

15761575
write!(fmt, "</span>")?; // in-band
15771576
write!(fmt, "<span class='out-of-band'>")?;
1577+
if let Some(version) = self.item.stable_since() {
1578+
write!(fmt, "<span class='since'>{}</span>", version)?;
1579+
}
15781580
write!(fmt,
15791581
r##"<span id='render-detail'>
15801582
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
@@ -1922,7 +1924,6 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
19221924
generics = f.generics,
19231925
where_clause = WhereClause(&f.generics),
19241926
decl = f.decl)?;
1925-
render_stability_since_raw(w, it.stable_since(), None)?;
19261927
document(w, cx, it)
19271928
}
19281929

@@ -2236,7 +2237,6 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
22362237
"",
22372238
true)?;
22382239
write!(w, "</pre>")?;
2239-
render_stability_since_raw(w, it.stable_since(), None)?;
22402240

22412241
document(w, cx, it)?;
22422242
let mut fields = s.fields.iter().filter(|f| {

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

+6
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,12 @@ a.test-arrow {
634634
padding-left: 10px;
635635
}
636636

637+
span.since {
638+
position: initial;
639+
font-size: 20px;
640+
margin-right: 5px;
641+
}
642+
637643
/* Media Queries */
638644

639645
@media (max-width: 700px) {

0 commit comments

Comments
 (0)
Please sign in to comment.