@@ -146,6 +146,7 @@ and number of matches. For example, a function with the signature
146146` fn read_all(&mut self: impl Read) -> Result<Vec<u8>, Error> `
147147will match these queries:
148148
149+ * ` &mut Read -> Result<Vec<u8>, Error> `
149150* ` Read -> Result<Vec<u8>, Error> `
150151* ` Read -> Result<Error, Vec> `
151152* ` Read -> Result<Vec<u8>> `
@@ -166,6 +167,10 @@ but you need to know which one you want.
166167
167168| Shorthand | Explicit names |
168169| ---------------- | ------------------------------------------------- |
170+ | ` & ` | ` primitive:reference ` |
171+ | ` &T ` | ` primitive:reference<T> ` |
172+ | ` &mut ` | ` primitive:reference<keyword:mut> ` |
173+ | ` &mut T ` | ` primitive:reference<keyword:mut, T> ` |
169174| ` [] ` | ` primitive:slice ` and/or ` primitive:array ` |
170175| ` [T] ` | ` primitive:slice<T> ` and/or ` primitive:array<T> ` |
171176| ` () ` | ` primitive:unit ` and/or ` primitive:tuple ` |
@@ -253,7 +258,8 @@ ident = *(ALPHA / DIGIT / "_")
253258path = ident *(DOUBLE-COLON ident) [BANG]
254259slice-like = OPEN-SQUARE-BRACKET [ nonempty-arg-list ] CLOSE-SQUARE-BRACKET
255260tuple-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)
257263type-sep = COMMA/WS *(COMMA/WS)
258264nonempty-arg-list = *(type-sep) arg *(type-sep arg) *(type-sep) [ return-args ]
259265generic-arg-list = *(type-sep) arg [ EQUAL arg ] *(type-sep arg [ EQUAL arg ]) *(type-sep)
@@ -310,6 +316,8 @@ COMMA = ","
310316RETURN-ARROW = "->"
311317EQUAL = "="
312318BANG = "!"
319+ AMP = "&"
320+ MUT = "mut"
313321
314322ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
315323DIGIT = %x30-39
0 commit comments