about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-06-15 18:17:22 +0000
committerbors <bors@rust-lang.org>2015-06-15 18:17:22 +0000
commita53a098b72d40e3dc2f6f843477b907af1049765 (patch)
tree432c271ec1b39279855bc2f8ee18b4b21173860e /src
parentd9b801582872a72bc234088afc74fa468158ea02 (diff)
parent434684bc9e84561f4b7195b9fdf1c0af97389a0b (diff)
Auto merge of #26293 - mihneadb:rustdoc-search-orphan-methods, r=alexcrichton
In https://github.com/rust-lang/rust/pull/23289, I did not include the type information for searching for orphan methods (methods that are defined in a module and implemented in another - doing this causes rustdoc sometimes to first find the impl before the actual type).

This PR fixes this. By merging this, searches for `char -> bool` will also find `is_alphabetic`, for example (which otherwise was only found for `charext -> bool`).


cc @alexcrichton 
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index c23cfd298aa..0080b5e5f22 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -456,13 +456,15 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::Result<String> {
             let did = ast_util::local_def(pid);
             match paths.get(&did) {
                 Some(&(ref fqp, _)) => {
+                    // Needed to determine `self` type.
+                    let parent_basename = Some(fqp[fqp.len() - 1].clone());
                     search_index.push(IndexItem {
                         ty: shortty(item),
                         name: item.name.clone().unwrap(),
                         path: fqp[..fqp.len() - 1].connect("::"),
                         desc: shorter(item.doc_value()),
                         parent: Some(did),
-                        search_type: None,
+                        search_type: get_index_search_type(&item, parent_basename),
                     });
                 },
                 None => {}