Skip to content

Commit 352a70b

Browse files
committed
Make the #[stable(since)] version attribute clearer with a tooltip
1 parent 0667ae9 commit 352a70b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustdoc/html/render.rs

+3-2
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)