@@ -147,45 +147,20 @@ will match these queries:
147
147
* ` Read -> Result<Vec<u8>, Error> `
148
148
* ` Read -> Result<Error, Vec> `
149
149
* ` Read -> Result<Vec<u8>> `
150
+ * ` Read -> u8 `
150
151
151
152
But it * does not* match ` Result<Vec, u8> ` or ` Result<u8<Vec>> ` .
152
153
153
154
### Primitives with Special Syntax
154
155
155
- <table >
156
- <thead >
157
- <tr >
158
- <th>Shorthand</th>
159
- <th>Explicit names</th>
160
- </tr >
161
- </thead >
162
- <tbody >
163
- <tr >
164
- <td><code>[]</code></td>
165
- <td><code>primitive:slice</code> and/or <code>primitive:array</code></td>
166
- </tr >
167
- <tr >
168
- <td><code>[T]</code></td>
169
- <td><code>primitive:slice<T></code> and/or <code>primitive:array<T></code></td>
170
- </tr >
171
- <tr >
172
- <td><code>()</code></td>
173
- <td><code>primitive:unit</code> and/or <code>primitive:tuple</code></td>
174
- </tr >
175
- <tr >
176
- <td><code>(T)</code></td>
177
- <td><code>T</code></td>
178
- </tr >
179
- <tr >
180
- <td><code>(T,)</code></td>
181
- <td><code>primitive:tuple<T></code></td>
182
- </tr >
183
- <tr >
184
- <td><code>!</code></td>
185
- <td><code>primitive:never</code></td>
186
- </tr >
187
- </tbody >
188
- </table >
156
+ | Shorthand | Explicit names |
157
+ | --------- | ------------------------------------------------ |
158
+ | ` [] ` | ` primitive:slice ` and/or ` primitive:array ` |
159
+ | ` [T] ` | ` primitive:slice<T> ` and/or ` primitive:array<T> ` |
160
+ | ` () ` | ` primitive:unit ` and/or ` primitive:tuple ` |
161
+ | ` (T) ` | ` T ` |
162
+ | ` (T,) ` | ` primitive:tuple<T> ` |
163
+ | ` ! ` | ` primitive:never ` |
189
164
190
165
When searching for ` [] ` , Rustdoc will return search results with either slices
191
166
or arrays. If you know which one you want, you can force it to return results
@@ -200,6 +175,11 @@ since parens act as the grouping operator. If they're empty, though, they will
200
175
match both ` unit ` and ` tuple ` , and if there's more than one type (or a trailing
201
176
or leading comma) it is the same as ` primitive:tuple<...> ` .
202
177
178
+ However, since items can be left out of the query, ` (T) ` will still return
179
+ results for types that match tuples, even though it also matches the type on
180
+ its own. That is, ` (u32) ` matches ` (u32,) ` for the exact same reason that it
181
+ also matches ` Result<u32, Error> ` .
182
+
203
183
### Limitations and quirks of type-based search
204
184
205
185
Type-based search is still a buggy, experimental, work-in-progress feature.
0 commit comments