From 434684bc9e84561f4b7195b9fdf1c0af97389a0b Mon Sep 17 00:00:00 2001 From: Mihnea Dobrescu-Balaur Date: Sun, 14 Jun 2015 14:33:31 +0300 Subject: [PATCH] Find type of orphan methods for rustdoc search. --- src/librustdoc/html/render.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { 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 => {}