Skip to content

Commit 400cb4b

Browse files
committed
Fix the grammar of parameter patterns in function pointer types
It's not just (common) identifiers or underscores, it's more complex.
1 parent 9319118 commit 400cb4b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/types/function-pointer.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ MaybeNamedFunctionParameters ->
1616
| (SelfParam `,`)? MaybeNamedParam ( `,` MaybeNamedParam )* `,`?
1717
1818
MaybeNamedParam ->
19-
OuterAttribute* ( ( IDENTIFIER | `_` ) `:` )? ( Type | `...` )
19+
OuterAttribute* ( MaybeNamedPattern `:` )? ( Type | `...` )
20+
21+
MaybeNamedPattern ->
22+
`mut`? IDENTIFIER | ( `&` | `&&` )? ( `_` | `false` | `true` )
2023
```
2124

2225
r[type.fn-pointer.intro]

0 commit comments

Comments
 (0)