Skip to content

Commit 8878bcd

Browse files
authored
Fix grammar of ConstParam
The grammar for `ConstParam` in https://doc.rust-lang.org/reference/items/generics.html#grammar-ConstParam was specified as: ```grammar ConstParam → 'const' IDENTIFIER : Type ( '=' BlockExpression | IDENTIFIER | '-'? LiteralExpression )? ``` This implies that `IDENTIFIER` and `'-'? LiteralExpression` may not be preceded by `=`, but this is obviously not the case.
1 parent 06ef608 commit 8878bcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/items/generics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ TypeParam -> IDENTIFIER ( `:` TypeParamBounds? )? ( `=` Type )?
1313
1414
ConstParam ->
1515
`const` IDENTIFIER `:` Type
16-
( `=` BlockExpression | IDENTIFIER | `-`?LiteralExpression )?
16+
( `=` ( BlockExpression | IDENTIFIER | `-`?LiteralExpression ) )?
1717
```
1818

1919
r[items.generics.syntax.intro]

0 commit comments

Comments
 (0)