diff --git a/src/paths.md b/src/paths.md index cb36f3af20..98cff23007 100644 --- a/src/paths.md +++ b/src/paths.md @@ -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 @@ -65,10 +71,10 @@ GenericArgsConst -> | SimplePathSegment GenericArgsBinding -> - IDENTIFIER GenericArgs? `=` Type + TypePathSegment `=` Type GenericArgsBounds -> - IDENTIFIER GenericArgs? `:` Bounds + TypePathSegment `:` Bounds ``` r[paths.expr.intro] @@ -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]