about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-08-19 11:17:11 -0700
committerGitHub <noreply@github.com>2016-08-19 11:17:11 -0700
commitf883b0bbab6c433eb7b7042b605b4339022c563a (patch)
tree297f377f0b4b92a79de4c51b6c8800328b11b576 /src
parent413ada30402f823a86a75578afc63d07179f6a23 (diff)
parent616b101e3fe8f66a70dd45248da5a3ab0b942ae6 (diff)
downloadrust-f883b0bbab6c433eb7b7042b605b4339022c563a.tar.gz
rust-f883b0bbab6c433eb7b7042b605b4339022c563a.zip
Auto merge of #35655 - ollie27:rustdoc_search_static_prim, r=steveklabnik
rustdoc: Fix a couple of issues with the search results

* Fix links to static items in the search results.
* Don't include the path for primitive methods in the search results. Displaying `std::u32::max_value` is misleading so just display `u32::max_value`.
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/main.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 68035e5abe4..de7e4d2483b 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -577,10 +577,6 @@
                         displayPath = item.path + '::';
                         href = rootPath + item.path.replace(/::/g, '/') + '/' +
                                name + '/index.html';
-                    } else if (type === 'static' || type === 'reexport') {
-                        displayPath = item.path + '::';
-                        href = rootPath + item.path.replace(/::/g, '/') +
-                               '/index.html';
                     } else if (type === "primitive") {
                         displayPath = "";
                         href = rootPath + item.path.replace(/::/g, '/') +
@@ -591,9 +587,14 @@
                     } else if (item.parent !== undefined) {
                         var myparent = item.parent;
                         var anchor = '#' + type + '.' + name;
-                        displayPath = item.path + '::' + myparent.name + '::';
+                        var parentType = itemTypes[myparent.ty];
+                        if (parentType === "primitive") {
+                            displayPath = myparent.name + '::';
+                        } else {
+                            displayPath = item.path + '::' + myparent.name + '::';
+                        }
                         href = rootPath + item.path.replace(/::/g, '/') +
-                               '/' + itemTypes[myparent.ty] +
+                               '/' + parentType +
                                '.' + myparent.name +
                                '.html' + anchor;
                     } else {