]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #39697 - notriddle:rustdoc_tooltip, r=GuillaumeGomez
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 12 Feb 2017 18:16:30 +0000 (19:16 +0100)
committerGitHub <noreply@github.com>
Sun, 12 Feb 2017 18:16:30 +0000 (19:16 +0100)
Add the item type to the tooltip

See:
https://users.rust-lang.org/t/seeking-opinions-from-colorblind-rustaceans-coloring-in-rustdoc-code-blocks

src/librustdoc/html/format.rs
src/librustdoc/html/render.rs

index c591c09bf20e2701b221f806ad659249bf899d3b..6f8c6aa7094dde3b994234642e18748885f4bb73 100644 (file)
@@ -550,8 +550,8 @@ impl<'a> fmt::Display for HRef<'a> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match href(self.did) {
             Some((url, shortty, fqp)) => if !f.alternate() {
-                write!(f, "<a class='{}' href='{}' title='{}'>{}</a>",
-                       shortty, url, fqp.join("::"), self.text)
+                write!(f, "<a class='{}' href='{}' title='{} {}'>{}</a>",
+                       shortty, url, shortty, fqp.join("::"), self.text)
             } else {
                 write!(f, "{}", self.text)
             },
index c53015850a22b002e8d64993cd0c2dec8b664fef..75fe8cabe12cc991ac9de0f2142b54c46bc52aa5 100644 (file)
@@ -1818,7 +1818,7 @@ fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: usize, idx2: usize) -> Ordering
                 write!(w, "
                        <tr class='{stab} module-item'>
                            <td><a class='{class}' href='{href}'
-                                  title='{title}'>{name}</a>{unsafety_flag}</td>
+                                  title='{title_type} {title}'>{name}</a>{unsafety_flag}</td>
                            <td class='docblock-short'>
                                {stab_docs} {docs}
                            </td>
@@ -1830,6 +1830,7 @@ fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: usize, idx2: usize) -> Ordering
                        stab = myitem.stability_class(),
                        unsafety_flag = unsafety_flag,
                        href = item_path(myitem.type_(), myitem.name.as_ref().unwrap()),
+                       title_type = myitem.type_(),
                        title = full_path(cx, myitem))?;
             }
         }