Skip to content

Commit 0095ec2

Browse files
Rollup merge of #39697 - notriddle:rustdoc_tooltip, r=GuillaumeGomez
Add the item type to the tooltip See: https://users.rust-lang.org/t/seeking-opinions-from-colorblind-rustaceans-coloring-in-rustdoc-code-blocks
2 parents 747b9e5 + bc4ad1a commit 0095ec2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/librustdoc/html/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,8 @@ impl<'a> fmt::Display for HRef<'a> {
550550
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
551551
match href(self.did) {
552552
Some((url, shortty, fqp)) => if !f.alternate() {
553-
write!(f, "<a class='{}' href='{}' title='{}'>{}</a>",
554-
shortty, url, fqp.join("::"), self.text)
553+
write!(f, "<a class='{}' href='{}' title='{} {}'>{}</a>",
554+
shortty, url, shortty, fqp.join("::"), self.text)
555555
} else {
556556
write!(f, "{}", self.text)
557557
},

src/librustdoc/html/render.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
18181818
write!(w, "
18191819
<tr class='{stab} module-item'>
18201820
<td><a class='{class}' href='{href}'
1821-
title='{title}'>{name}</a>{unsafety_flag}</td>
1821+
title='{title_type} {title}'>{name}</a>{unsafety_flag}</td>
18221822
<td class='docblock-short'>
18231823
{stab_docs} {docs}
18241824
</td>
@@ -1830,6 +1830,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
18301830
stab = myitem.stability_class(),
18311831
unsafety_flag = unsafety_flag,
18321832
href = item_path(myitem.type_(), myitem.name.as_ref().unwrap()),
1833+
title_type = myitem.type_(),
18331834
title = full_path(cx, myitem))?;
18341835
}
18351836
}

0 commit comments

Comments
 (0)