Are certain results suppressed from the documentation search?


#1

Suppose I want to sort a vector. I can just call .sort() on it. But suppose I wanted to know more precisely, or if there’s a method that returns a new sorted vector instead of mutating the receiver, or something like that. I’d search the API docs. Here’s what I’d see:

[sorry, new users can’t upload images]

Ok, I’d see collections::binary_heap::BinaryHeap::into_sorted_vec (twice), some rustc internal stuff presumably related to typechecking, GLOB_NOSORT, and then results mentioning “port”, “sqrt”, “or”, and a bunch of other things that aren’t “sort”. The correct answer is in the docs, it just doesn’t show up, at all. The same is true for e.g. sort_by, contains, and probably other interesting things in other primitive cases that I haven’t found because, well, they don’t show up. Is this purposeful? If so, what’s the reason?


#2

It seems like rustdoc currently doesn’t index inherent methods from primitive types (issue #23511) and slices are primitive types.


#3

You’ve just run into a bug in this case: https://github.com/rust-lang/rust/issues/23511