diff options
| author | Michael Howell <michael@notriddle.com> | 2023-03-03 10:38:58 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2023-03-20 22:41:58 -0700 |
| commit | cae43859d3149234fc65d5dac5df11e336b850ad (patch) | |
| tree | 90a5fa5170b5f42b5e5247c312ac7b07926ef218 | |
| parent | e600c0ba0e0b8153e68c4cead3d92b2c52ca8914 (diff) | |
| download | rust-cae43859d3149234fc65d5dac5df11e336b850ad.tar.gz rust-cae43859d3149234fc65d5dac5df11e336b850ad.zip | |
doc: add generics improvements to rustdoc book
| -rw-r--r-- | src/doc/rustdoc/src/how-to-read-rustdoc.md | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/doc/rustdoc/src/how-to-read-rustdoc.md b/src/doc/rustdoc/src/how-to-read-rustdoc.md index 28a004a9253..2957916d56c 100644 --- a/src/doc/rustdoc/src/how-to-read-rustdoc.md +++ b/src/doc/rustdoc/src/how-to-read-rustdoc.md @@ -80,13 +80,20 @@ functions, and "In Return Types" shows matches in the return types of functions. Both are very useful when looking for a function whose name you can't quite bring to mind when you know the type you have or want. -When typing in the search bar, you can prefix your search term with a type -followed by a colon (such as `mod:`) to restrict the results to just that -kind of item. (The available items are listed in the help popup.) - -Searching for `println!` will search for a macro named `println`, just like +Names in the search interface can be prefixed with an item type followed by a +colon (such as `mod:`) to restrict the results to just that kind of item. Also, +searching for `println!` will search for a macro named `println`, just like searching for `macro:println` does. +Function signature searches can query generics, wrapped in angle brackets, and +traits are normalized like types in the search engine. For example, a function +with the signature `fn my_function<I: Iterator<Item=u32>>(input: I) -> usize` +can be matched with the following queries: + +* `Iterator<u32> -> usize` +* `trait:Iterator<primitive:u32> -> primitive:usize` +* `Iterator -> usize` + ### Changing displayed theme You can change the displayed theme by opening the settings menu (the gear |
