You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rustdoc type-based search appears to not support searching by built-in types #60485
You can search for functions that appear to satisfy some sort of a shape/type as such input -> output, however that will not work for more complicated searches involving built-in types, including:
slices [T] -> *;
pointers *mut T -> *;
tuples (*, *);
and similarly multiple arguments
probably more.
Instead of attempting to guess a what kind of search this is based on -> I propose that we add another "type" indicating that this is a signature we’re looking for and take a type of the function pointer as an argument, so something like this would work:
You can search for functions that appear to satisfy some sort of a shape/type as such input -> output, however that will not work for more complicated searches involving built-in types, including:
support for raw pointers was added in #145731, and slices and tuples seem to have been added a while ago. unsure if there are any primitive types still not supported.
Activity
GuillaumeGomez commentedon May 2, 2019
Ah no, I didn't support that at all.
jyn514 commentedon Jul 25, 2020
This doesn't seem to work currently ... https://doc.rust-lang.org/std/?search=OsString%20-%3E%20String doesn't give anything.
Related: rust-lang/docs.rs#494 (comment)
GuillaumeGomez commentedon Jul 26, 2020
Very likely. I didn't enforce tests on this part and focused on the others so it's likely that it's broken.
Rollup merge of rust-lang#81557 - GuillaumeGomez:primitive-search, r=…
Auto merge of rust-lang#81557 - GuillaumeGomez:primitive-search, r=ol…
rustdoc: search for slices and arrays by type with `[]`
6 remaining items
Rollup merge of rust-lang#119676 - notriddle:notriddle/rustdoc-search…
Rollup merge of rust-lang#119676 - notriddle:notriddle/rustdoc-search…
Rollup merge of rust-lang#119676 - notriddle:notriddle/rustdoc-search…
Rollup merge of rust-lang#119676 - notriddle:notriddle/rustdoc-search…
Rollup merge of rust-lang#119676 - notriddle:notriddle/rustdoc-search…
Rollup merge of rust-lang#119676 - notriddle:notriddle/rustdoc-search…
Unrolled build for rust-lang#119676
Rollup merge of #119676 - notriddle:notriddle/rustdoc-search-hof, r=G…
Rollup merge of rust-lang#124148 - notriddle:notriddle/reference, r=G…
Unrolled build for rust-lang#124148
Rollup merge of #124148 - notriddle:notriddle/reference, r=GuillaumeG…
lolbinarycat commentedon Aug 24, 2025
support for raw pointers was added in #145731, and slices and tuples seem to have been added a while ago. unsure if there are any primitive types still not supported.
ijackson commentedon Aug 25, 2026
AFAICT arrays are still not fully supported. Eg https://doc.rust-lang.org/stable/std/index.html?search=%5BT%3B%20N%5D%20-%3E%20_
GuillaumeGomez commentedon Aug 25, 2026
So arrays are still not supported, noted.