]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Link associated items in search index to trait
authorUlrik Sverdrup <root@localhost>
Fri, 8 May 2015 22:03:42 +0000 (00:03 +0200)
committerUlrik Sverdrup <root@localhost>
Fri, 8 May 2015 22:03:42 +0000 (00:03 +0200)
This is related to isssue #22442 and solves it partly.

This solves the links of associated types and constants, so that they
link to the trait page.

src/librustdoc/html/render.rs
src/librustdoc/html/static/main.js

index 5a828e8376e528805414d6ff0df3cd8e58ab4416..4074a6594427dacb1150f3e3d3dcdaf5f1eadf35 100644 (file)
@@ -905,6 +905,8 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
         // Index this method for searching later on
         if let Some(ref s) = item.name {
             let (parent, is_method) = match item.inner {
+                clean::AssociatedTypeItem(..) |
+                clean::AssociatedConstItem(..) |
                 clean::TyMethodItem(..) |
                 clean::StructFieldItem(..) |
                 clean::VariantItem(..) => {
index c2a59278a86dc79dbaff558c130461602299871f..02c6c8dca9d84951ff0ec5f538dfe9dc27c61134 100644 (file)
@@ -34,7 +34,8 @@
                      "macro",
                      "primitive",
                      "associatedtype",
-                     "constant"];
+                     "constant",
+                     "associatedconstant"];
 
     $('.js-only').removeClass('js-only');