Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,14 @@ PathIdentSegment ->
IDENTIFIER | `super` | `self` | `Self` | `crate` | `$crate`

GenericArgs ->
`<` `>`
| `<` ( GenericArg `,` )* GenericArg `,`? `>`
`<` GenericArgList? `>`
| `(` TypeList? `)` (`->` TypeNoBounds)?

GenericArgList ->
( GenericArg `,` )* GenericArg `,`?

TypeList ->
( Type `,` )* Type `,`?

GenericArg ->
Lifetime | Type | GenericArgsConst | GenericArgsBinding | GenericArgsBounds
Expand All @@ -65,10 +71,10 @@ GenericArgsConst ->
| SimplePathSegment

GenericArgsBinding ->
IDENTIFIER GenericArgs? `=` Type
TypePathSegment `=` Type

GenericArgsBounds ->
IDENTIFIER GenericArgs? `:` Bounds
TypePathSegment `:` Bounds
```

r[paths.expr.intro]
Expand Down Expand Up @@ -154,11 +160,7 @@ r[paths.type.syntax]
```grammar,paths
TypePath -> `::`? TypePathSegment (`::` TypePathSegment)*

TypePathSegment -> PathIdentSegment (`::`? (GenericArgs | TypePathFn))?

TypePathFn -> `(` TypePathFnInputs? `)` (`->` TypeNoBounds)?

TypePathFnInputs -> Type (`,` Type)* `,`?
TypePathSegment -> PathIdentSegment (`::`? GenericArgs)?
```

r[paths.type.intro]
Expand Down
Loading