From 2e2642efccd5855e4158b01a006e7884a96982bb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 20:51:43 +0200 Subject: Remove TypeAscriptionOwner --- xtask/src/codegen/gen_syntax.rs | 1 - xtask/src/codegen/rust.ungram | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index e993a750c..45b788bdb 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs @@ -660,7 +660,6 @@ fn extract_struct_traits(ast: &mut AstSrc) { ("GenericParamsOwner", &["generic_param_list", "where_clause"]), ("TypeBoundsOwner", &["type_bound_list", "colon_token"]), ("ModuleItemOwner", &["items"]), - ("TypeAscriptionOwner", &["ascribed_type"]), ("LoopBodyOwner", &["label", "loop_body"]), ("ArgListOwner", &["arg_list"]), ]; diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 8c4f953b0..e09bc875a 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -61,13 +61,13 @@ ParamList = SelfParam = Attr* ( ('&' 'lifetime'?)? 'mut'? 'self' - | 'mut'? 'self' ':' ascribed_type:TypeRef + | 'mut'? 'self' ':' ty:TypeRef ) Param = Attr* ( - Pat (':' ascribed_type:TypeRef) - | ascribed_type:TypeRef + Pat (':' ty:TypeRef) + | ty:TypeRef | '...' ) @@ -88,7 +88,7 @@ RecordFieldList = '{' fields:(RecordField (',' RecordField)* ','?)? '}' RecordField = - Attr* Visibility? Name ':' ascribed_type:TypeRef + Attr* Visibility? Name ':' ty:TypeRef TupleFieldList = '(' fields:(TupleField (',' TupleField)* ','?)? ')' @@ -115,11 +115,11 @@ Union = RecordFieldList Const = - Attr* Visibility? 'default'? 'const' (Name | '_') ':' ascribed_type:TypeRef + Attr* Visibility? 'default'? 'const' (Name | '_') ':' ty:TypeRef '=' body:Expr ';' Static = - Attr* Visibility? 'static'? 'mut'? Name ':' ascribed_type:TypeRef + Attr* Visibility? 'static'? 'mut'? Name ':' ty:TypeRef '=' body:Expr ';' Trait = @@ -166,7 +166,7 @@ TypeParam = ('=' default_type:TypeRef)? ConstParam = - Attr* 'const' Name ':' ascribed_type:TypeRef + Attr* 'const' Name ':' ty:TypeRef ('=' default_val:Expr)? LifetimeParam = @@ -439,7 +439,7 @@ ExprStmt = Attr* Expr ';' LetStmt = - Attr* 'let' Pat (':' ascribed_type:TypeRef) + Attr* 'let' Pat (':' ty:TypeRef) '=' initializer:Expr ';' Path = -- cgit v1.2.3