about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrik Sverdrup <root@localhost>2015-05-09 00:03:42 +0200
committerUlrik Sverdrup <root@localhost>2015-05-09 00:03:42 +0200
commitff4e06104903c8cb03600739fa51afb905188b18 (patch)
tree02e2ab43fc5bb164dd4fd3e1f45d77f3e6e75afc
parent6cd748611346dec3181f81ca3aa551cce0529343 (diff)
downloadrust-ff4e06104903c8cb03600739fa51afb905188b18.tar.gz
rust-ff4e06104903c8cb03600739fa51afb905188b18.zip
rustdoc: Link associated items in search index to trait
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.
-rw-r--r--src/librustdoc/html/render.rs2
-rw-r--r--src/librustdoc/html/static/main.js3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 5a828e8376e..4074a659442 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -905,6 +905,8 @@ impl DocFolder for Cache {
         // 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(..) => {
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index c2a59278a86..02c6c8dca9d 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -34,7 +34,8 @@
                      "macro",
                      "primitive",
                      "associatedtype",
-                     "constant"];
+                     "constant",
+                     "associatedconstant"];
 
     $('.js-only').removeClass('js-only');