From 81359af733f7b13e0bd2196191f2ab294e1b57aa Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 20:22:20 +0200 Subject: Simplify trait gramamr --- xtask/src/codegen/gen_syntax.rs | 2 ++ xtask/src/codegen/rust.ungram | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'xtask/src/codegen') diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index e6231ece2..4602ff1d7 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs @@ -591,6 +591,8 @@ fn lower_rule(acc: &mut Vec, grammar: &Grammar, label: Option<&String>, r | "index" | "base" | "value" + | "target_type" + | "target_trait" ); if manually_implemented { return; diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 7685f4f06..25d6f7a20 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -194,12 +194,11 @@ AssocItem = | TypeAlias Impl = - Attr* Visibility? - 'default'? 'unsafe'? 'impl' 'const'? GenericParamList? ( - Type - | '!'? Type 'for' Type - ) WhereClause? - AssocItemList + Attr* Visibility? + 'default'? 'unsafe'? 'impl' 'const'? GenericParamList? + ('!'? target_trait:Type 'for')? target_type:Type + WhereClause? + AssocItemList ExternBlock = Attr* Abi ExternItemList -- cgit v1.2.3