about summary refs log tree commit diff
path: root/src/doc/rustdoc
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-12-13 11:05:48 -0700
committerMichael Howell <michael@notriddle.com>2024-12-13 11:05:48 -0700
commit0be3ed0d8fe9e74963117db7c2d93d383cfcacc4 (patch)
tree0d01d3ad8d9d9dcfe8c3094cbaea7f41d8988ec4 /src/doc/rustdoc
parent246835eda4a89bb09842ebc67776fedb6e3aba78 (diff)
downloadrust-0be3ed0d8fe9e74963117db7c2d93d383cfcacc4.tar.gz
rust-0be3ed0d8fe9e74963117db7c2d93d383cfcacc4.zip
rustdoc-search: update documentation with notes about unboxing
Diffstat (limited to 'src/doc/rustdoc')
-rw-r--r--src/doc/rustdoc/src/read-documentation/search.md25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/doc/rustdoc/src/read-documentation/search.md b/src/doc/rustdoc/src/read-documentation/search.md
index 718d2201c3a..e06dcdb7ed2 100644
--- a/src/doc/rustdoc/src/read-documentation/search.md
+++ b/src/doc/rustdoc/src/read-documentation/search.md
@@ -149,12 +149,16 @@ will match these queries:
 * `&mut Read -> Result<Vec<u8>, Error>`
 * `Read -> Result<Vec<u8>, Error>`
 * `Read -> Result<Vec<u8>>`
-* `Read -> u8`
+* `Read -> Vec<u8>`
 
 But it *does not* match `Result<Vec, u8>` or `Result<u8<Vec>>`,
 because those are nested incorrectly, and it does not match
 `Result<Error, Vec<u8>>` or `Result<Error>`, because those are
-in the wrong order.
+in the wrong order. It also does not match `Read -> u8`, because
+only [certain generic wrapper types] can be left out, and `Vec` isn't
+one of them.
+
+[certain generic wrapper types]: #wrappers-that-can-be-omitted
 
 To search for a function that accepts a function as a parameter,
 like `Iterator::all`, wrap the nested signature in parenthesis,
@@ -165,6 +169,18 @@ but you need to know which one you want.
 
 [iterator-all]: ../../std/vec/struct.Vec.html?search=Iterator<T>%2C+(T+->+bool)+->+bool&filter-crate=std
 
+### Wrappers that can be omitted
+
+* References
+* Box
+* Rc
+* Arc
+* Option
+* Result
+* From
+* Into
+* Future
+
 ### Primitives with Special Syntax
 
 | Shorthand        | Explicit names                                    |
@@ -234,11 +250,6 @@ Most of these limitations should be addressed in future version of Rustdoc.
     that you don't want a type parameter, you can force it to match
     something else by giving it a different prefix like `struct:T`.
 
-  * It's impossible to search for references or pointers. The
-    wrapped types can be searched for, so a function that takes `&File` can
-    be found with `File`, but you'll get a parse error when typing an `&`
-    into the search field.
-
   * Searching for lifetimes is not supported.
 
   * It's impossible to search based on the length of an array.