Skip to content

Commit

Permalink
Auto merge of #26293 - mihneadb:rustdoc-search-orphan-methods, r=alex…
Browse files Browse the repository at this point in the history
…crichton

In #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
  • Loading branch information
bors committed Jun 15, 2015
2 parents d9b8015 + 434684b commit a53a098
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {}
Expand Down

0 comments on commit a53a098

Please sign in to comment.