about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-24 01:22:03 +0100
committerGitHub <noreply@github.com>2023-03-24 01:22:03 +0100
commiteb46afb21683bc54f86c556bacff7c9bd82f9933 (patch)
tree00fad42a4e13076775241171fe17d4b8ede31f01 /src/doc
parent1459b3128e288a85fcc4dd1fee7ada2cdcf28794 (diff)
parentcae43859d3149234fc65d5dac5df11e336b850ad (diff)
downloadrust-eb46afb21683bc54f86c556bacff7c9bd82f9933.tar.gz
rust-eb46afb21683bc54f86c556bacff7c9bd82f9933.zip
Rollup merge of #108629 - notriddle:notriddle/item-type-advanced, r=GuillaumeGomez
rustdoc: add support for type filters in arguments and generics

This makes sense, since the search index has the information in it, and it's more useful for function signature searches since a function signature search's item type is, by definition, some type of function (there's more than one, but not very many).
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/rustdoc/src/how-to-read-rustdoc.md17
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