Skip to content

Commit 5f50100

Browse files
committed
Fix the grammar of generic arguments in expressions and patterns
1 parent 581920f commit 5f50100

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/paths.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ PathIdentSegment ->
5252
IDENTIFIER | `super` | `self` | `Self` | `crate` | `$crate`
5353
5454
GenericArgs ->
55-
`<` `>`
56-
| `<` ( GenericArg `,` )* GenericArg `,`? `>`
55+
`<` ( ( GenericArg `,` )* GenericArg `,`? )? `>`
56+
| `(` ( ( Type `,` )* Type `,`? )? `)` (`->` TypeNoBounds)?
5757
5858
GenericArg ->
5959
Lifetime | Type | GenericArgsConst | GenericArgsBinding | GenericArgsBounds
@@ -154,11 +154,7 @@ r[paths.type.syntax]
154154
```grammar,paths
155155
TypePath -> `::`? TypePathSegment (`::` TypePathSegment)*
156156
157-
TypePathSegment -> PathIdentSegment (`::`? (GenericArgs | TypePathFn))?
158-
159-
TypePathFn -> `(` TypePathFnInputs? `)` (`->` TypeNoBounds)?
160-
161-
TypePathFnInputs -> Type (`,` Type)* `,`?
157+
TypePathSegment -> PathIdentSegment (`::`? GenericArgs)?
162158
```
163159

164160
r[paths.type.intro]

0 commit comments

Comments
 (0)