Skip to content

Commit 355d9f9

Browse files
committed
Rollup merge of #33705 - lqd:rustdoc-version-tooltip, r=GuillaumeGomez
rustdoc: Make the #[stable(since)] version attribute clearer with a tooltip Rustdoc's new 'since' version placement only shows the version number in which the item was marked stable. This gains space but might make the meaning of this version string less clear in the docs, so I tried to bring some explicitness in a tooltip.
2 parents 26f666b + 352a70b commit 355d9f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustdoc/html/render.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,8 @@ impl<'a> fmt::Display for Item<'a> {
15661566
write!(fmt, "</span>")?; // in-band
15671567
write!(fmt, "<span class='out-of-band'>")?;
15681568
if let Some(version) = self.item.stable_since() {
1569-
write!(fmt, "<span class='since'>{}</span>", version)?;
1569+
write!(fmt, "<span class='since' title='Stable since Rust version {0}'>{0}</span>",
1570+
version)?;
15701571
}
15711572
write!(fmt,
15721573
r##"<span id='render-detail'>
@@ -2136,7 +2137,7 @@ fn render_stability_since_raw<'a>(w: &mut fmt::Formatter,
21362137
containing_ver: Option<&'a str>) -> fmt::Result {
21372138
if let Some(v) = ver {
21382139
if containing_ver != ver && v.len() > 0 {
2139-
write!(w, "<div class=\"since\">{}</div>",
2140+
write!(w, "<div class='since' title='Stable since Rust version {0}'>{0}</div>",
21402141
v)?
21412142
}
21422143
}

0 commit comments

Comments
 (0)