diff options
Diffstat (limited to 'xtask/src')
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 1 | ||||
-rw-r--r-- | xtask/src/codegen/rust.ungram | 16 |
2 files changed, 8 insertions, 9 deletions
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) { | |||
660 | ("GenericParamsOwner", &["generic_param_list", "where_clause"]), | 660 | ("GenericParamsOwner", &["generic_param_list", "where_clause"]), |
661 | ("TypeBoundsOwner", &["type_bound_list", "colon_token"]), | 661 | ("TypeBoundsOwner", &["type_bound_list", "colon_token"]), |
662 | ("ModuleItemOwner", &["items"]), | 662 | ("ModuleItemOwner", &["items"]), |
663 | ("TypeAscriptionOwner", &["ascribed_type"]), | ||
664 | ("LoopBodyOwner", &["label", "loop_body"]), | 663 | ("LoopBodyOwner", &["label", "loop_body"]), |
665 | ("ArgListOwner", &["arg_list"]), | 664 | ("ArgListOwner", &["arg_list"]), |
666 | ]; | 665 | ]; |
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 = | |||
61 | SelfParam = | 61 | SelfParam = |
62 | Attr* ( | 62 | Attr* ( |
63 | ('&' 'lifetime'?)? 'mut'? 'self' | 63 | ('&' 'lifetime'?)? 'mut'? 'self' |
64 | | 'mut'? 'self' ':' ascribed_type:TypeRef | 64 | | 'mut'? 'self' ':' ty:TypeRef |
65 | ) | 65 | ) |
66 | 66 | ||
67 | Param = | 67 | Param = |
68 | Attr* ( | 68 | Attr* ( |
69 | Pat (':' ascribed_type:TypeRef) | 69 | Pat (':' ty:TypeRef) |
70 | | ascribed_type:TypeRef | 70 | | ty:TypeRef |
71 | | '...' | 71 | | '...' |
72 | ) | 72 | ) |
73 | 73 | ||
@@ -88,7 +88,7 @@ RecordFieldList = | |||
88 | '{' fields:(RecordField (',' RecordField)* ','?)? '}' | 88 | '{' fields:(RecordField (',' RecordField)* ','?)? '}' |
89 | 89 | ||
90 | RecordField = | 90 | RecordField = |
91 | Attr* Visibility? Name ':' ascribed_type:TypeRef | 91 | Attr* Visibility? Name ':' ty:TypeRef |
92 | 92 | ||
93 | TupleFieldList = | 93 | TupleFieldList = |
94 | '(' fields:(TupleField (',' TupleField)* ','?)? ')' | 94 | '(' fields:(TupleField (',' TupleField)* ','?)? ')' |
@@ -115,11 +115,11 @@ Union = | |||
115 | RecordFieldList | 115 | RecordFieldList |
116 | 116 | ||
117 | Const = | 117 | Const = |
118 | Attr* Visibility? 'default'? 'const' (Name | '_') ':' ascribed_type:TypeRef | 118 | Attr* Visibility? 'default'? 'const' (Name | '_') ':' ty:TypeRef |
119 | '=' body:Expr ';' | 119 | '=' body:Expr ';' |
120 | 120 | ||
121 | Static = | 121 | Static = |
122 | Attr* Visibility? 'static'? 'mut'? Name ':' ascribed_type:TypeRef | 122 | Attr* Visibility? 'static'? 'mut'? Name ':' ty:TypeRef |
123 | '=' body:Expr ';' | 123 | '=' body:Expr ';' |
124 | 124 | ||
125 | Trait = | 125 | Trait = |
@@ -166,7 +166,7 @@ TypeParam = | |||
166 | ('=' default_type:TypeRef)? | 166 | ('=' default_type:TypeRef)? |
167 | 167 | ||
168 | ConstParam = | 168 | ConstParam = |
169 | Attr* 'const' Name ':' ascribed_type:TypeRef | 169 | Attr* 'const' Name ':' ty:TypeRef |
170 | ('=' default_val:Expr)? | 170 | ('=' default_val:Expr)? |
171 | 171 | ||
172 | LifetimeParam = | 172 | LifetimeParam = |
@@ -439,7 +439,7 @@ ExprStmt = | |||
439 | Attr* Expr ';' | 439 | Attr* Expr ';' |
440 | 440 | ||
441 | LetStmt = | 441 | LetStmt = |
442 | Attr* 'let' Pat (':' ascribed_type:TypeRef) | 442 | Attr* 'let' Pat (':' ty:TypeRef) |
443 | '=' initializer:Expr ';' | 443 | '=' initializer:Expr ';' |
444 | 444 | ||
445 | Path = | 445 | Path = |