Skip to content

Commit b217e61

Browse files
committed
Fix the grammar of generic arguments in expressions and patterns
1 parent cf0e391 commit b217e61

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/paths.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ PathIdentSegment ->
5252
IDENTIFIER | `super` | `self` | `Self` | `crate` | `$crate`
5353
5454
GenericArgs ->
55-
`<` `>`
56-
| `<` ( GenericArg `,` )* GenericArg `,`? `>`
55+
`<` GenericArgList? `>`
56+
| `(` TypeList? `)` (`->` TypeNoBounds)?
57+
58+
GenericArgList ->
59+
( GenericArg `,` )* GenericArg `,`?
60+
61+
TypeList ->
62+
( Type `,` )* Type `,`?
5763
5864
GenericArg ->
5965
Lifetime | Type | GenericArgsConst | GenericArgsBinding | GenericArgsBounds
@@ -154,11 +160,7 @@ r[paths.type.syntax]
154160
```grammar,paths
155161
TypePath -> `::`? TypePathSegment (`::` TypePathSegment)*
156162
157-
TypePathSegment -> PathIdentSegment (`::`? (GenericArgs | TypePathFn))?
158-
159-
TypePathFn -> `(` TypePathFnInputs? `)` (`->` TypeNoBounds)?
160-
161-
TypePathFnInputs -> Type (`,` Type)* `,`?
163+
TypePathSegment -> PathIdentSegment (`::`? GenericArgs)?
162164
```
163165

164166
r[paths.type.intro]

0 commit comments

Comments
 (0)