@@ -146,6 +146,7 @@ and number of matches. For example, a function with the signature
146
146
` fn read_all(&mut self: impl Read) -> Result<Vec<u8>, Error> `
147
147
will match these queries:
148
148
149
+ * ` &mut Read -> Result<Vec<u8>, Error> `
149
150
* ` Read -> Result<Vec<u8>, Error> `
150
151
* ` Read -> Result<Error, Vec> `
151
152
* ` Read -> Result<Vec<u8>> `
@@ -166,6 +167,10 @@ but you need to know which one you want.
166
167
167
168
| Shorthand | Explicit names |
168
169
| ---------------- | ------------------------------------------------- |
170
+ | ` & ` | ` primitive:reference ` |
171
+ | ` &T ` | ` primitive:reference<T> ` |
172
+ | ` &mut ` | ` primitive:reference<keyword:mut> ` |
173
+ | ` &mut T ` | ` primitive:reference<keyword:mut, T> ` |
169
174
| ` [] ` | ` primitive:slice ` and/or ` primitive:array ` |
170
175
| ` [T] ` | ` primitive:slice<T> ` and/or ` primitive:array<T> ` |
171
176
| ` () ` | ` primitive:unit ` and/or ` primitive:tuple ` |
@@ -253,7 +258,8 @@ ident = *(ALPHA / DIGIT / "_")
253
258
path = ident *(DOUBLE-COLON ident) [BANG]
254
259
slice-like = OPEN-SQUARE-BRACKET [ nonempty-arg-list ] CLOSE-SQUARE-BRACKET
255
260
tuple-like = OPEN-PAREN [ nonempty-arg-list ] CLOSE-PAREN
256
- arg = [type-filter *WS COLON *WS] (path [generics] / slice-like / tuple-like)
261
+ borrow-ref = AMP *WS [MUT] *WS [arg]
262
+ arg = [type-filter *WS COLON *WS] (path [generics] / slice-like / tuple-like / borrow-ref)
257
263
type-sep = COMMA/WS *(COMMA/WS)
258
264
nonempty-arg-list = *(type-sep) arg *(type-sep arg) *(type-sep) [ return-args ]
259
265
generic-arg-list = *(type-sep) arg [ EQUAL arg ] *(type-sep arg [ EQUAL arg ]) *(type-sep)
@@ -310,6 +316,8 @@ COMMA = ","
310
316
RETURN-ARROW = "->"
311
317
EQUAL = "="
312
318
BANG = "!"
319
+ AMP = "&"
320
+ MUT = "mut"
313
321
314
322
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
315
323
DIGIT = %x30-39
0 commit comments