From a5a2f2b951ea982a666eaf52b1874d8f1b17290b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 10 May 2016 21:01:10 +0200 Subject: [PATCH] Improve "since" tag placement --- src/librustdoc/html/render.rs | 6 +++--- src/librustdoc/html/static/rustdoc.css | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 6a2a0a37c1c05..da0520ebcb84a 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1537,7 +1537,6 @@ impl<'a> Item<'a> { } } - impl<'a> fmt::Display for Item<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { debug_assert!(!self.item.is_stripped()); @@ -1575,6 +1574,9 @@ impl<'a> fmt::Display for Item<'a> { write!(fmt, "")?; // in-band write!(fmt, "")?; + if let Some(version) = self.item.stable_since() { + write!(fmt, "{}", version)?; + } write!(fmt, r##" @@ -1922,7 +1924,6 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, generics = f.generics, where_clause = WhereClause(&f.generics), decl = f.decl)?; - render_stability_since_raw(w, it.stable_since(), None)?; document(w, cx, it) } @@ -2236,7 +2237,6 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, "", true)?; write!(w, "")?; - render_stability_since_raw(w, it.stable_since(), None)?; document(w, cx, it)?; let mut fields = s.fields.iter().filter(|f| { diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 4d65b91ed421c..d256e939afcfc 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -634,6 +634,12 @@ a.test-arrow { padding-left: 10px; } +span.since { + position: initial; + font-size: 20px; + margin-right: 5px; +} + /* Media Queries */ @media (max-width: 700px) {