Skip to content

Commit cae4385

Browse files
committed
doc: add generics improvements to rustdoc book
1 parent e600c0b commit cae4385

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Diff for: src/doc/rustdoc/src/how-to-read-rustdoc.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,20 @@ functions, and "In Return Types" shows matches in the return types of functions.
8080
Both are very useful when looking for a function whose name you can't quite
8181
bring to mind when you know the type you have or want.
8282

83-
When typing in the search bar, you can prefix your search term with a type
84-
followed by a colon (such as `mod:`) to restrict the results to just that
85-
kind of item. (The available items are listed in the help popup.)
86-
87-
Searching for `println!` will search for a macro named `println`, just like
83+
Names in the search interface can be prefixed with an item type followed by a
84+
colon (such as `mod:`) to restrict the results to just that kind of item. Also,
85+
searching for `println!` will search for a macro named `println`, just like
8886
searching for `macro:println` does.
8987

88+
Function signature searches can query generics, wrapped in angle brackets, and
89+
traits are normalized like types in the search engine. For example, a function
90+
with the signature `fn my_function<I: Iterator<Item=u32>>(input: I) -> usize`
91+
can be matched with the following queries:
92+
93+
* `Iterator<u32> -> usize`
94+
* `trait:Iterator<primitive:u32> -> primitive:usize`
95+
* `Iterator -> usize`
96+
9097
### Changing displayed theme
9198

9299
You can change the displayed theme by opening the settings menu (the gear

0 commit comments

Comments
 (0)