From b217e6179bf756e7ae91aee002743e965f583536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=C3=B3n=20Orell=20Valerian=20Liehr?= Date: Sat, 2 May 2026 12:16:32 +0200 Subject: [PATCH 1/2] Fix the grammar of generic arguments in expressions and patterns --- src/paths.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/paths.md b/src/paths.md index cb36f3af20..fe68d6ff0c 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 @@ -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] From 3496d7e386cfcb5c44ec84cd40db0c9465ac45ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=C3=B3n=20Orell=20Valerian=20Liehr?= Date: Tue, 5 May 2026 09:17:20 +0200 Subject: [PATCH 2/2] Admit turbofish and path-segment keywords in associated item constraints --- src/paths.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/paths.md b/src/paths.md index fe68d6ff0c..98cff23007 100644 --- a/src/paths.md +++ b/src/paths.md @@ -71,10 +71,10 @@ GenericArgsConst -> | SimplePathSegment GenericArgsBinding -> - IDENTIFIER GenericArgs? `=` Type + TypePathSegment `=` Type GenericArgsBounds -> - IDENTIFIER GenericArgs? `:` Bounds + TypePathSegment `:` Bounds ``` r[paths.expr.intro]