diff options
Diffstat (limited to 'crates/ra_syntax/src/ast/generated/nodes.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 865 |
1 files changed, 432 insertions, 433 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index be657699f..00a70fce0 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -28,32 +28,33 @@ impl Attr { | |||
28 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } | 28 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
29 | } | 29 | } |
30 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 30 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
31 | pub struct ConstDef { | 31 | pub struct Const { |
32 | pub(crate) syntax: SyntaxNode, | 32 | pub(crate) syntax: SyntaxNode, |
33 | } | 33 | } |
34 | impl ast::AttrsOwner for ConstDef {} | 34 | impl ast::AttrsOwner for Const {} |
35 | impl ast::NameOwner for ConstDef {} | 35 | impl ast::NameOwner for Const {} |
36 | impl ast::VisibilityOwner for ConstDef {} | 36 | impl ast::VisibilityOwner for Const {} |
37 | impl ast::TypeAscriptionOwner for ConstDef {} | 37 | impl ast::TypeAscriptionOwner for Const {} |
38 | impl ConstDef { | 38 | impl Const { |
39 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 39 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
40 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | 40 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
41 | pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } | ||
41 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 42 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
42 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 43 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
43 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 44 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
44 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 45 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
45 | } | 46 | } |
46 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 47 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
47 | pub struct EnumDef { | 48 | pub struct Enum { |
48 | pub(crate) syntax: SyntaxNode, | 49 | pub(crate) syntax: SyntaxNode, |
49 | } | 50 | } |
50 | impl ast::AttrsOwner for EnumDef {} | 51 | impl ast::AttrsOwner for Enum {} |
51 | impl ast::NameOwner for EnumDef {} | 52 | impl ast::NameOwner for Enum {} |
52 | impl ast::VisibilityOwner for EnumDef {} | 53 | impl ast::VisibilityOwner for Enum {} |
53 | impl ast::TypeParamsOwner for EnumDef {} | 54 | impl ast::GenericParamsOwner for Enum {} |
54 | impl EnumDef { | 55 | impl Enum { |
55 | pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) } | 56 | pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) } |
56 | pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) } | 57 | pub fn variant_list(&self) -> Option<VariantList> { support::child(&self.syntax) } |
57 | } | 58 | } |
58 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 59 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
59 | pub struct ExternBlock { | 60 | pub struct ExternBlock { |
@@ -79,19 +80,19 @@ impl ExternCrate { | |||
79 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 80 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
80 | } | 81 | } |
81 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 82 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
82 | pub struct FnDef { | 83 | pub struct Fn { |
83 | pub(crate) syntax: SyntaxNode, | 84 | pub(crate) syntax: SyntaxNode, |
84 | } | 85 | } |
85 | impl ast::AttrsOwner for FnDef {} | 86 | impl ast::AttrsOwner for Fn {} |
86 | impl ast::NameOwner for FnDef {} | 87 | impl ast::NameOwner for Fn {} |
87 | impl ast::VisibilityOwner for FnDef {} | 88 | impl ast::VisibilityOwner for Fn {} |
88 | impl ast::TypeParamsOwner for FnDef {} | 89 | impl ast::GenericParamsOwner for Fn {} |
89 | impl FnDef { | 90 | impl Fn { |
90 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | ||
91 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | ||
92 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 91 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
93 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } | 92 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } |
93 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | ||
94 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } | 94 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
95 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | ||
95 | pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) } | 96 | pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) } |
96 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 97 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
97 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 98 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
@@ -104,7 +105,7 @@ pub struct ImplDef { | |||
104 | } | 105 | } |
105 | impl ast::AttrsOwner for ImplDef {} | 106 | impl ast::AttrsOwner for ImplDef {} |
106 | impl ast::VisibilityOwner for ImplDef {} | 107 | impl ast::VisibilityOwner for ImplDef {} |
107 | impl ast::TypeParamsOwner for ImplDef {} | 108 | impl ast::GenericParamsOwner for ImplDef {} |
108 | impl ImplDef { | 109 | impl ImplDef { |
109 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | 110 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
110 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 111 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
@@ -139,14 +140,14 @@ impl Module { | |||
139 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 140 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
140 | } | 141 | } |
141 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 142 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
142 | pub struct StaticDef { | 143 | pub struct Static { |
143 | pub(crate) syntax: SyntaxNode, | 144 | pub(crate) syntax: SyntaxNode, |
144 | } | 145 | } |
145 | impl ast::AttrsOwner for StaticDef {} | 146 | impl ast::AttrsOwner for Static {} |
146 | impl ast::NameOwner for StaticDef {} | 147 | impl ast::NameOwner for Static {} |
147 | impl ast::VisibilityOwner for StaticDef {} | 148 | impl ast::VisibilityOwner for Static {} |
148 | impl ast::TypeAscriptionOwner for StaticDef {} | 149 | impl ast::TypeAscriptionOwner for Static {} |
149 | impl StaticDef { | 150 | impl Static { |
150 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } | 151 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } |
151 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | 152 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
152 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 153 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
@@ -155,17 +156,17 @@ impl StaticDef { | |||
155 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 156 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
156 | } | 157 | } |
157 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 158 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
158 | pub struct StructDef { | 159 | pub struct Struct { |
159 | pub(crate) syntax: SyntaxNode, | 160 | pub(crate) syntax: SyntaxNode, |
160 | } | 161 | } |
161 | impl ast::AttrsOwner for StructDef {} | 162 | impl ast::AttrsOwner for Struct {} |
162 | impl ast::NameOwner for StructDef {} | 163 | impl ast::NameOwner for Struct {} |
163 | impl ast::VisibilityOwner for StructDef {} | 164 | impl ast::VisibilityOwner for Struct {} |
164 | impl ast::TypeParamsOwner for StructDef {} | 165 | impl ast::GenericParamsOwner for Struct {} |
165 | impl StructDef { | 166 | impl Struct { |
166 | pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) } | 167 | pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) } |
167 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 168 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
168 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } | 169 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } |
169 | } | 170 | } |
170 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 171 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
171 | pub struct TraitDef { | 172 | pub struct TraitDef { |
@@ -174,7 +175,7 @@ pub struct TraitDef { | |||
174 | impl ast::AttrsOwner for TraitDef {} | 175 | impl ast::AttrsOwner for TraitDef {} |
175 | impl ast::NameOwner for TraitDef {} | 176 | impl ast::NameOwner for TraitDef {} |
176 | impl ast::VisibilityOwner for TraitDef {} | 177 | impl ast::VisibilityOwner for TraitDef {} |
177 | impl ast::TypeParamsOwner for TraitDef {} | 178 | impl ast::GenericParamsOwner for TraitDef {} |
178 | impl ast::TypeBoundsOwner for TraitDef {} | 179 | impl ast::TypeBoundsOwner for TraitDef {} |
179 | impl TraitDef { | 180 | impl TraitDef { |
180 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } | 181 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
@@ -183,15 +184,15 @@ impl TraitDef { | |||
183 | pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } | 184 | pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } |
184 | } | 185 | } |
185 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 186 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
186 | pub struct TypeAliasDef { | 187 | pub struct TypeAlias { |
187 | pub(crate) syntax: SyntaxNode, | 188 | pub(crate) syntax: SyntaxNode, |
188 | } | 189 | } |
189 | impl ast::AttrsOwner for TypeAliasDef {} | 190 | impl ast::AttrsOwner for TypeAlias {} |
190 | impl ast::NameOwner for TypeAliasDef {} | 191 | impl ast::NameOwner for TypeAlias {} |
191 | impl ast::VisibilityOwner for TypeAliasDef {} | 192 | impl ast::VisibilityOwner for TypeAlias {} |
192 | impl ast::TypeParamsOwner for TypeAliasDef {} | 193 | impl ast::GenericParamsOwner for TypeAlias {} |
193 | impl ast::TypeBoundsOwner for TypeAliasDef {} | 194 | impl ast::TypeBoundsOwner for TypeAlias {} |
194 | impl TypeAliasDef { | 195 | impl TypeAlias { |
195 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 196 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
196 | pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) } | 197 | pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) } |
197 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 198 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
@@ -199,18 +200,16 @@ impl TypeAliasDef { | |||
199 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 200 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
200 | } | 201 | } |
201 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 202 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
202 | pub struct UnionDef { | 203 | pub struct Union { |
203 | pub(crate) syntax: SyntaxNode, | 204 | pub(crate) syntax: SyntaxNode, |
204 | } | 205 | } |
205 | impl ast::AttrsOwner for UnionDef {} | 206 | impl ast::AttrsOwner for Union {} |
206 | impl ast::NameOwner for UnionDef {} | 207 | impl ast::NameOwner for Union {} |
207 | impl ast::VisibilityOwner for UnionDef {} | 208 | impl ast::VisibilityOwner for Union {} |
208 | impl ast::TypeParamsOwner for UnionDef {} | 209 | impl ast::GenericParamsOwner for Union {} |
209 | impl UnionDef { | 210 | impl Union { |
210 | pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) } | 211 | pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) } |
211 | pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> { | 212 | pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) } |
212 | support::child(&self.syntax) | ||
213 | } | ||
214 | } | 213 | } |
215 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 214 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
216 | pub struct Use { | 215 | pub struct Use { |
@@ -303,12 +302,14 @@ impl UseTreeList { | |||
303 | pub struct Abi { | 302 | pub struct Abi { |
304 | pub(crate) syntax: SyntaxNode, | 303 | pub(crate) syntax: SyntaxNode, |
305 | } | 304 | } |
306 | impl Abi {} | 305 | impl Abi { |
306 | pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) } | ||
307 | } | ||
307 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 308 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
308 | pub struct TypeParamList { | 309 | pub struct GenericParamList { |
309 | pub(crate) syntax: SyntaxNode, | 310 | pub(crate) syntax: SyntaxNode, |
310 | } | 311 | } |
311 | impl TypeParamList { | 312 | impl GenericParamList { |
312 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } | 313 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } |
313 | pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) } | 314 | pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) } |
314 | pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) } | 315 | pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) } |
@@ -321,8 +322,9 @@ pub struct ParamList { | |||
321 | } | 322 | } |
322 | impl ParamList { | 323 | impl ParamList { |
323 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } | 324 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
324 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } | ||
325 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } | 325 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } |
326 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } | ||
327 | pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) } | ||
326 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } | 328 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
327 | } | 329 | } |
328 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 330 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
@@ -355,73 +357,98 @@ impl BlockExpr { | |||
355 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 357 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
356 | } | 358 | } |
357 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 359 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
358 | pub struct RecordFieldDefList { | 360 | pub struct Param { |
361 | pub(crate) syntax: SyntaxNode, | ||
362 | } | ||
363 | impl ast::AttrsOwner for Param {} | ||
364 | impl ast::TypeAscriptionOwner for Param {} | ||
365 | impl Param { | ||
366 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | ||
367 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | ||
368 | pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) } | ||
369 | } | ||
370 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
371 | pub struct SelfParam { | ||
372 | pub(crate) syntax: SyntaxNode, | ||
373 | } | ||
374 | impl ast::AttrsOwner for SelfParam {} | ||
375 | impl ast::TypeAscriptionOwner for SelfParam {} | ||
376 | impl SelfParam { | ||
377 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } | ||
378 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | ||
379 | support::token(&self.syntax, T![lifetime]) | ||
380 | } | ||
381 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | ||
382 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
383 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | ||
384 | } | ||
385 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
386 | pub struct TypeBoundList { | ||
387 | pub(crate) syntax: SyntaxNode, | ||
388 | } | ||
389 | impl TypeBoundList { | ||
390 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } | ||
391 | } | ||
392 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
393 | pub struct RecordFieldList { | ||
359 | pub(crate) syntax: SyntaxNode, | 394 | pub(crate) syntax: SyntaxNode, |
360 | } | 395 | } |
361 | impl RecordFieldDefList { | 396 | impl RecordFieldList { |
362 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | 397 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
363 | pub fn fields(&self) -> AstChildren<RecordFieldDef> { support::children(&self.syntax) } | 398 | pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) } |
364 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 399 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
365 | } | 400 | } |
366 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 401 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
367 | pub struct TupleFieldDefList { | 402 | pub struct TupleFieldList { |
368 | pub(crate) syntax: SyntaxNode, | 403 | pub(crate) syntax: SyntaxNode, |
369 | } | 404 | } |
370 | impl TupleFieldDefList { | 405 | impl TupleFieldList { |
371 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } | 406 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
372 | pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) } | 407 | pub fn fields(&self) -> AstChildren<TupleField> { support::children(&self.syntax) } |
373 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } | 408 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
374 | } | 409 | } |
375 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 410 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
376 | pub struct RecordFieldDef { | 411 | pub struct RecordField { |
377 | pub(crate) syntax: SyntaxNode, | 412 | pub(crate) syntax: SyntaxNode, |
378 | } | 413 | } |
379 | impl ast::AttrsOwner for RecordFieldDef {} | 414 | impl ast::AttrsOwner for RecordField {} |
380 | impl ast::NameOwner for RecordFieldDef {} | 415 | impl ast::NameOwner for RecordField {} |
381 | impl ast::VisibilityOwner for RecordFieldDef {} | 416 | impl ast::VisibilityOwner for RecordField {} |
382 | impl ast::TypeAscriptionOwner for RecordFieldDef {} | 417 | impl ast::TypeAscriptionOwner for RecordField {} |
383 | impl RecordFieldDef { | 418 | impl RecordField { |
384 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 419 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
385 | } | 420 | } |
386 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 421 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
387 | pub struct TupleFieldDef { | 422 | pub struct TupleField { |
388 | pub(crate) syntax: SyntaxNode, | 423 | pub(crate) syntax: SyntaxNode, |
389 | } | 424 | } |
390 | impl ast::AttrsOwner for TupleFieldDef {} | 425 | impl ast::AttrsOwner for TupleField {} |
391 | impl ast::NameOwner for TupleFieldDef {} | 426 | impl ast::VisibilityOwner for TupleField {} |
392 | impl ast::VisibilityOwner for TupleFieldDef {} | 427 | impl TupleField { |
393 | impl TupleFieldDef { | ||
394 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 428 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
395 | } | 429 | } |
396 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 430 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
397 | pub struct EnumVariantList { | 431 | pub struct VariantList { |
398 | pub(crate) syntax: SyntaxNode, | 432 | pub(crate) syntax: SyntaxNode, |
399 | } | 433 | } |
400 | impl EnumVariantList { | 434 | impl VariantList { |
401 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | 435 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
402 | pub fn variants(&self) -> AstChildren<EnumVariant> { support::children(&self.syntax) } | 436 | pub fn variants(&self) -> AstChildren<Variant> { support::children(&self.syntax) } |
403 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 437 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
404 | } | 438 | } |
405 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 439 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
406 | pub struct EnumVariant { | 440 | pub struct Variant { |
407 | pub(crate) syntax: SyntaxNode, | 441 | pub(crate) syntax: SyntaxNode, |
408 | } | 442 | } |
409 | impl ast::AttrsOwner for EnumVariant {} | 443 | impl ast::AttrsOwner for Variant {} |
410 | impl ast::NameOwner for EnumVariant {} | 444 | impl ast::NameOwner for Variant {} |
411 | impl ast::VisibilityOwner for EnumVariant {} | 445 | impl ast::VisibilityOwner for Variant {} |
412 | impl EnumVariant { | 446 | impl Variant { |
413 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } | 447 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } |
414 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 448 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
415 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 449 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
416 | } | 450 | } |
417 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 451 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
418 | pub struct TypeBoundList { | ||
419 | pub(crate) syntax: SyntaxNode, | ||
420 | } | ||
421 | impl TypeBoundList { | ||
422 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } | ||
423 | } | ||
424 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
425 | pub struct AssocItemList { | 452 | pub struct AssocItemList { |
426 | pub(crate) syntax: SyntaxNode, | 453 | pub(crate) syntax: SyntaxNode, |
427 | } | 454 | } |
@@ -528,7 +555,7 @@ pub struct ForType { | |||
528 | } | 555 | } |
529 | impl ForType { | 556 | impl ForType { |
530 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } | 557 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
531 | pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) } | 558 | pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) } |
532 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 559 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
533 | } | 560 | } |
534 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 561 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
@@ -880,30 +907,32 @@ impl MatchGuard { | |||
880 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 907 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
881 | } | 908 | } |
882 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 909 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
883 | pub struct RecordLit { | 910 | pub struct RecordExpr { |
884 | pub(crate) syntax: SyntaxNode, | 911 | pub(crate) syntax: SyntaxNode, |
885 | } | 912 | } |
886 | impl RecordLit { | 913 | impl RecordExpr { |
887 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 914 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
888 | pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) } | 915 | pub fn record_expr_field_list(&self) -> Option<RecordExprFieldList> { |
916 | support::child(&self.syntax) | ||
917 | } | ||
889 | } | 918 | } |
890 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 919 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
891 | pub struct RecordFieldList { | 920 | pub struct RecordExprFieldList { |
892 | pub(crate) syntax: SyntaxNode, | 921 | pub(crate) syntax: SyntaxNode, |
893 | } | 922 | } |
894 | impl RecordFieldList { | 923 | impl RecordExprFieldList { |
895 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | 924 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
896 | pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) } | 925 | pub fn fields(&self) -> AstChildren<RecordExprField> { support::children(&self.syntax) } |
897 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } | 926 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } |
898 | pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) } | 927 | pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) } |
899 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 928 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
900 | } | 929 | } |
901 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 930 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
902 | pub struct RecordField { | 931 | pub struct RecordExprField { |
903 | pub(crate) syntax: SyntaxNode, | 932 | pub(crate) syntax: SyntaxNode, |
904 | } | 933 | } |
905 | impl ast::AttrsOwner for RecordField {} | 934 | impl ast::AttrsOwner for RecordExprField {} |
906 | impl RecordField { | 935 | impl RecordExprField { |
907 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 936 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
908 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 937 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
909 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 938 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
@@ -1143,7 +1172,7 @@ pub struct WherePred { | |||
1143 | impl ast::TypeBoundsOwner for WherePred {} | 1172 | impl ast::TypeBoundsOwner for WherePred {} |
1144 | impl WherePred { | 1173 | impl WherePred { |
1145 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } | 1174 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
1146 | pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) } | 1175 | pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) } |
1147 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | 1176 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
1148 | support::token(&self.syntax, T![lifetime]) | 1177 | support::token(&self.syntax, T![lifetime]) |
1149 | } | 1178 | } |
@@ -1173,32 +1202,6 @@ impl LetStmt { | |||
1173 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 1202 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
1174 | } | 1203 | } |
1175 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1204 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1176 | pub struct SelfParam { | ||
1177 | pub(crate) syntax: SyntaxNode, | ||
1178 | } | ||
1179 | impl ast::AttrsOwner for SelfParam {} | ||
1180 | impl ast::TypeAscriptionOwner for SelfParam {} | ||
1181 | impl SelfParam { | ||
1182 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } | ||
1183 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | ||
1184 | support::token(&self.syntax, T![lifetime]) | ||
1185 | } | ||
1186 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | ||
1187 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
1188 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | ||
1189 | } | ||
1190 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1191 | pub struct Param { | ||
1192 | pub(crate) syntax: SyntaxNode, | ||
1193 | } | ||
1194 | impl ast::AttrsOwner for Param {} | ||
1195 | impl ast::TypeAscriptionOwner for Param {} | ||
1196 | impl Param { | ||
1197 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | ||
1198 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | ||
1199 | pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) } | ||
1200 | } | ||
1201 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1202 | pub struct PathSegment { | 1205 | pub struct PathSegment { |
1203 | pub(crate) syntax: SyntaxNode, | 1206 | pub(crate) syntax: SyntaxNode, |
1204 | } | 1207 | } |
@@ -1270,19 +1273,19 @@ impl MetaItem { | |||
1270 | } | 1273 | } |
1271 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1274 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1272 | pub enum Item { | 1275 | pub enum Item { |
1273 | ConstDef(ConstDef), | 1276 | Const(Const), |
1274 | EnumDef(EnumDef), | 1277 | Enum(Enum), |
1275 | ExternBlock(ExternBlock), | 1278 | ExternBlock(ExternBlock), |
1276 | ExternCrate(ExternCrate), | 1279 | ExternCrate(ExternCrate), |
1277 | FnDef(FnDef), | 1280 | Fn(Fn), |
1278 | ImplDef(ImplDef), | 1281 | ImplDef(ImplDef), |
1279 | MacroCall(MacroCall), | 1282 | MacroCall(MacroCall), |
1280 | Module(Module), | 1283 | Module(Module), |
1281 | StaticDef(StaticDef), | 1284 | Static(Static), |
1282 | StructDef(StructDef), | 1285 | Struct(Struct), |
1283 | TraitDef(TraitDef), | 1286 | TraitDef(TraitDef), |
1284 | TypeAliasDef(TypeAliasDef), | 1287 | TypeAlias(TypeAlias), |
1285 | UnionDef(UnionDef), | 1288 | Union(Union), |
1286 | Use(Use), | 1289 | Use(Use), |
1287 | } | 1290 | } |
1288 | impl ast::AttrsOwner for Item {} | 1291 | impl ast::AttrsOwner for Item {} |
@@ -1303,9 +1306,27 @@ pub enum TypeRef { | |||
1303 | DynTraitType(DynTraitType), | 1306 | DynTraitType(DynTraitType), |
1304 | } | 1307 | } |
1305 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1308 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1306 | pub enum FieldDefList { | 1309 | pub enum Pat { |
1307 | RecordFieldDefList(RecordFieldDefList), | 1310 | OrPat(OrPat), |
1308 | TupleFieldDefList(TupleFieldDefList), | 1311 | ParenPat(ParenPat), |
1312 | RefPat(RefPat), | ||
1313 | BoxPat(BoxPat), | ||
1314 | BindPat(BindPat), | ||
1315 | PlaceholderPat(PlaceholderPat), | ||
1316 | DotDotPat(DotDotPat), | ||
1317 | PathPat(PathPat), | ||
1318 | RecordPat(RecordPat), | ||
1319 | TupleStructPat(TupleStructPat), | ||
1320 | TuplePat(TuplePat), | ||
1321 | SlicePat(SlicePat), | ||
1322 | RangePat(RangePat), | ||
1323 | LiteralPat(LiteralPat), | ||
1324 | MacroPat(MacroPat), | ||
1325 | } | ||
1326 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1327 | pub enum FieldList { | ||
1328 | RecordFieldList(RecordFieldList), | ||
1329 | TupleFieldList(TupleFieldList), | ||
1309 | } | 1330 | } |
1310 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1331 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1311 | pub enum Expr { | 1332 | pub enum Expr { |
@@ -1324,7 +1345,7 @@ pub enum Expr { | |||
1324 | BlockExpr(BlockExpr), | 1345 | BlockExpr(BlockExpr), |
1325 | ReturnExpr(ReturnExpr), | 1346 | ReturnExpr(ReturnExpr), |
1326 | MatchExpr(MatchExpr), | 1347 | MatchExpr(MatchExpr), |
1327 | RecordLit(RecordLit), | 1348 | RecordExpr(RecordExpr), |
1328 | CallExpr(CallExpr), | 1349 | CallExpr(CallExpr), |
1329 | IndexExpr(IndexExpr), | 1350 | IndexExpr(IndexExpr), |
1330 | MethodCallExpr(MethodCallExpr), | 1351 | MethodCallExpr(MethodCallExpr), |
@@ -1343,32 +1364,14 @@ pub enum Expr { | |||
1343 | } | 1364 | } |
1344 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1365 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1345 | pub enum AssocItem { | 1366 | pub enum AssocItem { |
1346 | FnDef(FnDef), | 1367 | Fn(Fn), |
1347 | TypeAliasDef(TypeAliasDef), | 1368 | TypeAlias(TypeAlias), |
1348 | ConstDef(ConstDef), | 1369 | Const(Const), |
1349 | MacroCall(MacroCall), | 1370 | MacroCall(MacroCall), |
1350 | } | 1371 | } |
1351 | impl ast::AttrsOwner for AssocItem {} | 1372 | impl ast::AttrsOwner for AssocItem {} |
1352 | impl ast::NameOwner for AssocItem {} | 1373 | impl ast::NameOwner for AssocItem {} |
1353 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1374 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1354 | pub enum Pat { | ||
1355 | OrPat(OrPat), | ||
1356 | ParenPat(ParenPat), | ||
1357 | RefPat(RefPat), | ||
1358 | BoxPat(BoxPat), | ||
1359 | BindPat(BindPat), | ||
1360 | PlaceholderPat(PlaceholderPat), | ||
1361 | DotDotPat(DotDotPat), | ||
1362 | PathPat(PathPat), | ||
1363 | RecordPat(RecordPat), | ||
1364 | TupleStructPat(TupleStructPat), | ||
1365 | TuplePat(TuplePat), | ||
1366 | SlicePat(SlicePat), | ||
1367 | RangePat(RangePat), | ||
1368 | LiteralPat(LiteralPat), | ||
1369 | MacroPat(MacroPat), | ||
1370 | } | ||
1371 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1372 | pub enum Stmt { | 1375 | pub enum Stmt { |
1373 | LetStmt(LetStmt), | 1376 | LetStmt(LetStmt), |
1374 | ExprStmt(ExprStmt), | 1377 | ExprStmt(ExprStmt), |
@@ -1381,21 +1384,21 @@ pub enum AttrInput { | |||
1381 | } | 1384 | } |
1382 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1385 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1383 | pub enum ExternItem { | 1386 | pub enum ExternItem { |
1384 | FnDef(FnDef), | 1387 | Fn(Fn), |
1385 | StaticDef(StaticDef), | 1388 | Static(Static), |
1386 | } | 1389 | } |
1387 | impl ast::AttrsOwner for ExternItem {} | 1390 | impl ast::AttrsOwner for ExternItem {} |
1388 | impl ast::NameOwner for ExternItem {} | 1391 | impl ast::NameOwner for ExternItem {} |
1389 | impl ast::VisibilityOwner for ExternItem {} | 1392 | impl ast::VisibilityOwner for ExternItem {} |
1390 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1393 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1391 | pub enum AdtDef { | 1394 | pub enum AdtDef { |
1392 | StructDef(StructDef), | 1395 | Struct(Struct), |
1393 | EnumDef(EnumDef), | 1396 | Enum(Enum), |
1394 | UnionDef(UnionDef), | 1397 | Union(Union), |
1395 | } | 1398 | } |
1396 | impl ast::AttrsOwner for AdtDef {} | 1399 | impl ast::AttrsOwner for AdtDef {} |
1400 | impl ast::GenericParamsOwner for AdtDef {} | ||
1397 | impl ast::NameOwner for AdtDef {} | 1401 | impl ast::NameOwner for AdtDef {} |
1398 | impl ast::TypeParamsOwner for AdtDef {} | ||
1399 | impl ast::VisibilityOwner for AdtDef {} | 1402 | impl ast::VisibilityOwner for AdtDef {} |
1400 | impl AstNode for SourceFile { | 1403 | impl AstNode for SourceFile { |
1401 | fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE } | 1404 | fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE } |
@@ -1419,8 +1422,8 @@ impl AstNode for Attr { | |||
1419 | } | 1422 | } |
1420 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1423 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1421 | } | 1424 | } |
1422 | impl AstNode for ConstDef { | 1425 | impl AstNode for Const { |
1423 | fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_DEF } | 1426 | fn can_cast(kind: SyntaxKind) -> bool { kind == CONST } |
1424 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1427 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1425 | if Self::can_cast(syntax.kind()) { | 1428 | if Self::can_cast(syntax.kind()) { |
1426 | Some(Self { syntax }) | 1429 | Some(Self { syntax }) |
@@ -1430,8 +1433,8 @@ impl AstNode for ConstDef { | |||
1430 | } | 1433 | } |
1431 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1434 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1432 | } | 1435 | } |
1433 | impl AstNode for EnumDef { | 1436 | impl AstNode for Enum { |
1434 | fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_DEF } | 1437 | fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM } |
1435 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1438 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1436 | if Self::can_cast(syntax.kind()) { | 1439 | if Self::can_cast(syntax.kind()) { |
1437 | Some(Self { syntax }) | 1440 | Some(Self { syntax }) |
@@ -1463,8 +1466,8 @@ impl AstNode for ExternCrate { | |||
1463 | } | 1466 | } |
1464 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1467 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1465 | } | 1468 | } |
1466 | impl AstNode for FnDef { | 1469 | impl AstNode for Fn { |
1467 | fn can_cast(kind: SyntaxKind) -> bool { kind == FN_DEF } | 1470 | fn can_cast(kind: SyntaxKind) -> bool { kind == FN } |
1468 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1471 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1469 | if Self::can_cast(syntax.kind()) { | 1472 | if Self::can_cast(syntax.kind()) { |
1470 | Some(Self { syntax }) | 1473 | Some(Self { syntax }) |
@@ -1507,8 +1510,8 @@ impl AstNode for Module { | |||
1507 | } | 1510 | } |
1508 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1511 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1509 | } | 1512 | } |
1510 | impl AstNode for StaticDef { | 1513 | impl AstNode for Static { |
1511 | fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC_DEF } | 1514 | fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC } |
1512 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1515 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1513 | if Self::can_cast(syntax.kind()) { | 1516 | if Self::can_cast(syntax.kind()) { |
1514 | Some(Self { syntax }) | 1517 | Some(Self { syntax }) |
@@ -1518,8 +1521,8 @@ impl AstNode for StaticDef { | |||
1518 | } | 1521 | } |
1519 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1522 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1520 | } | 1523 | } |
1521 | impl AstNode for StructDef { | 1524 | impl AstNode for Struct { |
1522 | fn can_cast(kind: SyntaxKind) -> bool { kind == STRUCT_DEF } | 1525 | fn can_cast(kind: SyntaxKind) -> bool { kind == STRUCT } |
1523 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1526 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1524 | if Self::can_cast(syntax.kind()) { | 1527 | if Self::can_cast(syntax.kind()) { |
1525 | Some(Self { syntax }) | 1528 | Some(Self { syntax }) |
@@ -1540,8 +1543,8 @@ impl AstNode for TraitDef { | |||
1540 | } | 1543 | } |
1541 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1544 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1542 | } | 1545 | } |
1543 | impl AstNode for TypeAliasDef { | 1546 | impl AstNode for TypeAlias { |
1544 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ALIAS_DEF } | 1547 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ALIAS } |
1545 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1548 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1546 | if Self::can_cast(syntax.kind()) { | 1549 | if Self::can_cast(syntax.kind()) { |
1547 | Some(Self { syntax }) | 1550 | Some(Self { syntax }) |
@@ -1551,8 +1554,8 @@ impl AstNode for TypeAliasDef { | |||
1551 | } | 1554 | } |
1552 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1555 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1553 | } | 1556 | } |
1554 | impl AstNode for UnionDef { | 1557 | impl AstNode for Union { |
1555 | fn can_cast(kind: SyntaxKind) -> bool { kind == UNION_DEF } | 1558 | fn can_cast(kind: SyntaxKind) -> bool { kind == UNION } |
1556 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1559 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1557 | if Self::can_cast(syntax.kind()) { | 1560 | if Self::can_cast(syntax.kind()) { |
1558 | Some(Self { syntax }) | 1561 | Some(Self { syntax }) |
@@ -1672,8 +1675,8 @@ impl AstNode for Abi { | |||
1672 | } | 1675 | } |
1673 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1676 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1674 | } | 1677 | } |
1675 | impl AstNode for TypeParamList { | 1678 | impl AstNode for GenericParamList { |
1676 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_PARAM_LIST } | 1679 | fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_PARAM_LIST } |
1677 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1680 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1678 | if Self::can_cast(syntax.kind()) { | 1681 | if Self::can_cast(syntax.kind()) { |
1679 | Some(Self { syntax }) | 1682 | Some(Self { syntax }) |
@@ -1727,8 +1730,8 @@ impl AstNode for BlockExpr { | |||
1727 | } | 1730 | } |
1728 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1731 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1729 | } | 1732 | } |
1730 | impl AstNode for RecordFieldDefList { | 1733 | impl AstNode for Param { |
1731 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_DEF_LIST } | 1734 | fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM } |
1732 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1735 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1733 | if Self::can_cast(syntax.kind()) { | 1736 | if Self::can_cast(syntax.kind()) { |
1734 | Some(Self { syntax }) | 1737 | Some(Self { syntax }) |
@@ -1738,8 +1741,8 @@ impl AstNode for RecordFieldDefList { | |||
1738 | } | 1741 | } |
1739 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1742 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1740 | } | 1743 | } |
1741 | impl AstNode for TupleFieldDefList { | 1744 | impl AstNode for SelfParam { |
1742 | fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD_DEF_LIST } | 1745 | fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM } |
1743 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1746 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1744 | if Self::can_cast(syntax.kind()) { | 1747 | if Self::can_cast(syntax.kind()) { |
1745 | Some(Self { syntax }) | 1748 | Some(Self { syntax }) |
@@ -1749,8 +1752,8 @@ impl AstNode for TupleFieldDefList { | |||
1749 | } | 1752 | } |
1750 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1753 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1751 | } | 1754 | } |
1752 | impl AstNode for RecordFieldDef { | 1755 | impl AstNode for TypeBoundList { |
1753 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_DEF } | 1756 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST } |
1754 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1757 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1755 | if Self::can_cast(syntax.kind()) { | 1758 | if Self::can_cast(syntax.kind()) { |
1756 | Some(Self { syntax }) | 1759 | Some(Self { syntax }) |
@@ -1760,8 +1763,8 @@ impl AstNode for RecordFieldDef { | |||
1760 | } | 1763 | } |
1761 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1764 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1762 | } | 1765 | } |
1763 | impl AstNode for TupleFieldDef { | 1766 | impl AstNode for RecordFieldList { |
1764 | fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD_DEF } | 1767 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_LIST } |
1765 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1768 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1766 | if Self::can_cast(syntax.kind()) { | 1769 | if Self::can_cast(syntax.kind()) { |
1767 | Some(Self { syntax }) | 1770 | Some(Self { syntax }) |
@@ -1771,8 +1774,8 @@ impl AstNode for TupleFieldDef { | |||
1771 | } | 1774 | } |
1772 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1775 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1773 | } | 1776 | } |
1774 | impl AstNode for EnumVariantList { | 1777 | impl AstNode for TupleFieldList { |
1775 | fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VARIANT_LIST } | 1778 | fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD_LIST } |
1776 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1779 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1777 | if Self::can_cast(syntax.kind()) { | 1780 | if Self::can_cast(syntax.kind()) { |
1778 | Some(Self { syntax }) | 1781 | Some(Self { syntax }) |
@@ -1782,8 +1785,8 @@ impl AstNode for EnumVariantList { | |||
1782 | } | 1785 | } |
1783 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1786 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1784 | } | 1787 | } |
1785 | impl AstNode for EnumVariant { | 1788 | impl AstNode for RecordField { |
1786 | fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VARIANT } | 1789 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD } |
1787 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1790 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1788 | if Self::can_cast(syntax.kind()) { | 1791 | if Self::can_cast(syntax.kind()) { |
1789 | Some(Self { syntax }) | 1792 | Some(Self { syntax }) |
@@ -1793,8 +1796,30 @@ impl AstNode for EnumVariant { | |||
1793 | } | 1796 | } |
1794 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1797 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1795 | } | 1798 | } |
1796 | impl AstNode for TypeBoundList { | 1799 | impl AstNode for TupleField { |
1797 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST } | 1800 | fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD } |
1801 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
1802 | if Self::can_cast(syntax.kind()) { | ||
1803 | Some(Self { syntax }) | ||
1804 | } else { | ||
1805 | None | ||
1806 | } | ||
1807 | } | ||
1808 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
1809 | } | ||
1810 | impl AstNode for VariantList { | ||
1811 | fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT_LIST } | ||
1812 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
1813 | if Self::can_cast(syntax.kind()) { | ||
1814 | Some(Self { syntax }) | ||
1815 | } else { | ||
1816 | None | ||
1817 | } | ||
1818 | } | ||
1819 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
1820 | } | ||
1821 | impl AstNode for Variant { | ||
1822 | fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT } | ||
1798 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1823 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1799 | if Self::can_cast(syntax.kind()) { | 1824 | if Self::can_cast(syntax.kind()) { |
1800 | Some(Self { syntax }) | 1825 | Some(Self { syntax }) |
@@ -2332,8 +2357,8 @@ impl AstNode for MatchGuard { | |||
2332 | } | 2357 | } |
2333 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2358 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2334 | } | 2359 | } |
2335 | impl AstNode for RecordLit { | 2360 | impl AstNode for RecordExpr { |
2336 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_LIT } | 2361 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR } |
2337 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2362 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2338 | if Self::can_cast(syntax.kind()) { | 2363 | if Self::can_cast(syntax.kind()) { |
2339 | Some(Self { syntax }) | 2364 | Some(Self { syntax }) |
@@ -2343,8 +2368,8 @@ impl AstNode for RecordLit { | |||
2343 | } | 2368 | } |
2344 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2369 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2345 | } | 2370 | } |
2346 | impl AstNode for RecordFieldList { | 2371 | impl AstNode for RecordExprFieldList { |
2347 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_LIST } | 2372 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD_LIST } |
2348 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2373 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2349 | if Self::can_cast(syntax.kind()) { | 2374 | if Self::can_cast(syntax.kind()) { |
2350 | Some(Self { syntax }) | 2375 | Some(Self { syntax }) |
@@ -2354,8 +2379,8 @@ impl AstNode for RecordFieldList { | |||
2354 | } | 2379 | } |
2355 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2380 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2356 | } | 2381 | } |
2357 | impl AstNode for RecordField { | 2382 | impl AstNode for RecordExprField { |
2358 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD } | 2383 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD } |
2359 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2384 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2360 | if Self::can_cast(syntax.kind()) { | 2385 | if Self::can_cast(syntax.kind()) { |
2361 | Some(Self { syntax }) | 2386 | Some(Self { syntax }) |
@@ -2673,28 +2698,6 @@ impl AstNode for LetStmt { | |||
2673 | } | 2698 | } |
2674 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2699 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2675 | } | 2700 | } |
2676 | impl AstNode for SelfParam { | ||
2677 | fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM } | ||
2678 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
2679 | if Self::can_cast(syntax.kind()) { | ||
2680 | Some(Self { syntax }) | ||
2681 | } else { | ||
2682 | None | ||
2683 | } | ||
2684 | } | ||
2685 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
2686 | } | ||
2687 | impl AstNode for Param { | ||
2688 | fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM } | ||
2689 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
2690 | if Self::can_cast(syntax.kind()) { | ||
2691 | Some(Self { syntax }) | ||
2692 | } else { | ||
2693 | None | ||
2694 | } | ||
2695 | } | ||
2696 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
2697 | } | ||
2698 | impl AstNode for PathSegment { | 2701 | impl AstNode for PathSegment { |
2699 | fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT } | 2702 | fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT } |
2700 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2703 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
@@ -2772,11 +2775,11 @@ impl AstNode for MetaItem { | |||
2772 | } | 2775 | } |
2773 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2776 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2774 | } | 2777 | } |
2775 | impl From<ConstDef> for Item { | 2778 | impl From<Const> for Item { |
2776 | fn from(node: ConstDef) -> Item { Item::ConstDef(node) } | 2779 | fn from(node: Const) -> Item { Item::Const(node) } |
2777 | } | 2780 | } |
2778 | impl From<EnumDef> for Item { | 2781 | impl From<Enum> for Item { |
2779 | fn from(node: EnumDef) -> Item { Item::EnumDef(node) } | 2782 | fn from(node: Enum) -> Item { Item::Enum(node) } |
2780 | } | 2783 | } |
2781 | impl From<ExternBlock> for Item { | 2784 | impl From<ExternBlock> for Item { |
2782 | fn from(node: ExternBlock) -> Item { Item::ExternBlock(node) } | 2785 | fn from(node: ExternBlock) -> Item { Item::ExternBlock(node) } |
@@ -2784,8 +2787,8 @@ impl From<ExternBlock> for Item { | |||
2784 | impl From<ExternCrate> for Item { | 2787 | impl From<ExternCrate> for Item { |
2785 | fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) } | 2788 | fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) } |
2786 | } | 2789 | } |
2787 | impl From<FnDef> for Item { | 2790 | impl From<Fn> for Item { |
2788 | fn from(node: FnDef) -> Item { Item::FnDef(node) } | 2791 | fn from(node: Fn) -> Item { Item::Fn(node) } |
2789 | } | 2792 | } |
2790 | impl From<ImplDef> for Item { | 2793 | impl From<ImplDef> for Item { |
2791 | fn from(node: ImplDef) -> Item { Item::ImplDef(node) } | 2794 | fn from(node: ImplDef) -> Item { Item::ImplDef(node) } |
@@ -2796,20 +2799,20 @@ impl From<MacroCall> for Item { | |||
2796 | impl From<Module> for Item { | 2799 | impl From<Module> for Item { |
2797 | fn from(node: Module) -> Item { Item::Module(node) } | 2800 | fn from(node: Module) -> Item { Item::Module(node) } |
2798 | } | 2801 | } |
2799 | impl From<StaticDef> for Item { | 2802 | impl From<Static> for Item { |
2800 | fn from(node: StaticDef) -> Item { Item::StaticDef(node) } | 2803 | fn from(node: Static) -> Item { Item::Static(node) } |
2801 | } | 2804 | } |
2802 | impl From<StructDef> for Item { | 2805 | impl From<Struct> for Item { |
2803 | fn from(node: StructDef) -> Item { Item::StructDef(node) } | 2806 | fn from(node: Struct) -> Item { Item::Struct(node) } |
2804 | } | 2807 | } |
2805 | impl From<TraitDef> for Item { | 2808 | impl From<TraitDef> for Item { |
2806 | fn from(node: TraitDef) -> Item { Item::TraitDef(node) } | 2809 | fn from(node: TraitDef) -> Item { Item::TraitDef(node) } |
2807 | } | 2810 | } |
2808 | impl From<TypeAliasDef> for Item { | 2811 | impl From<TypeAlias> for Item { |
2809 | fn from(node: TypeAliasDef) -> Item { Item::TypeAliasDef(node) } | 2812 | fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) } |
2810 | } | 2813 | } |
2811 | impl From<UnionDef> for Item { | 2814 | impl From<Union> for Item { |
2812 | fn from(node: UnionDef) -> Item { Item::UnionDef(node) } | 2815 | fn from(node: Union) -> Item { Item::Union(node) } |
2813 | } | 2816 | } |
2814 | impl From<Use> for Item { | 2817 | impl From<Use> for Item { |
2815 | fn from(node: Use) -> Item { Item::Use(node) } | 2818 | fn from(node: Use) -> Item { Item::Use(node) } |
@@ -2817,28 +2820,26 @@ impl From<Use> for Item { | |||
2817 | impl AstNode for Item { | 2820 | impl AstNode for Item { |
2818 | fn can_cast(kind: SyntaxKind) -> bool { | 2821 | fn can_cast(kind: SyntaxKind) -> bool { |
2819 | match kind { | 2822 | match kind { |
2820 | CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN_DEF | IMPL_DEF | MACRO_CALL | 2823 | CONST | ENUM | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL | MODULE |
2821 | | MODULE | STATIC_DEF | STRUCT_DEF | TRAIT_DEF | TYPE_ALIAS_DEF | UNION_DEF | USE => { | 2824 | | STATIC | STRUCT | TRAIT_DEF | TYPE_ALIAS | UNION | USE => true, |
2822 | true | ||
2823 | } | ||
2824 | _ => false, | 2825 | _ => false, |
2825 | } | 2826 | } |
2826 | } | 2827 | } |
2827 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2828 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2828 | let res = match syntax.kind() { | 2829 | let res = match syntax.kind() { |
2829 | CONST_DEF => Item::ConstDef(ConstDef { syntax }), | 2830 | CONST => Item::Const(Const { syntax }), |
2830 | ENUM_DEF => Item::EnumDef(EnumDef { syntax }), | 2831 | ENUM => Item::Enum(Enum { syntax }), |
2831 | EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), | 2832 | EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), |
2832 | EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), | 2833 | EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), |
2833 | FN_DEF => Item::FnDef(FnDef { syntax }), | 2834 | FN => Item::Fn(Fn { syntax }), |
2834 | IMPL_DEF => Item::ImplDef(ImplDef { syntax }), | 2835 | IMPL_DEF => Item::ImplDef(ImplDef { syntax }), |
2835 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), | 2836 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), |
2836 | MODULE => Item::Module(Module { syntax }), | 2837 | MODULE => Item::Module(Module { syntax }), |
2837 | STATIC_DEF => Item::StaticDef(StaticDef { syntax }), | 2838 | STATIC => Item::Static(Static { syntax }), |
2838 | STRUCT_DEF => Item::StructDef(StructDef { syntax }), | 2839 | STRUCT => Item::Struct(Struct { syntax }), |
2839 | TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), | 2840 | TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), |
2840 | TYPE_ALIAS_DEF => Item::TypeAliasDef(TypeAliasDef { syntax }), | 2841 | TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }), |
2841 | UNION_DEF => Item::UnionDef(UnionDef { syntax }), | 2842 | UNION => Item::Union(Union { syntax }), |
2842 | USE => Item::Use(Use { syntax }), | 2843 | USE => Item::Use(Use { syntax }), |
2843 | _ => return None, | 2844 | _ => return None, |
2844 | }; | 2845 | }; |
@@ -2846,19 +2847,19 @@ impl AstNode for Item { | |||
2846 | } | 2847 | } |
2847 | fn syntax(&self) -> &SyntaxNode { | 2848 | fn syntax(&self) -> &SyntaxNode { |
2848 | match self { | 2849 | match self { |
2849 | Item::ConstDef(it) => &it.syntax, | 2850 | Item::Const(it) => &it.syntax, |
2850 | Item::EnumDef(it) => &it.syntax, | 2851 | Item::Enum(it) => &it.syntax, |
2851 | Item::ExternBlock(it) => &it.syntax, | 2852 | Item::ExternBlock(it) => &it.syntax, |
2852 | Item::ExternCrate(it) => &it.syntax, | 2853 | Item::ExternCrate(it) => &it.syntax, |
2853 | Item::FnDef(it) => &it.syntax, | 2854 | Item::Fn(it) => &it.syntax, |
2854 | Item::ImplDef(it) => &it.syntax, | 2855 | Item::ImplDef(it) => &it.syntax, |
2855 | Item::MacroCall(it) => &it.syntax, | 2856 | Item::MacroCall(it) => &it.syntax, |
2856 | Item::Module(it) => &it.syntax, | 2857 | Item::Module(it) => &it.syntax, |
2857 | Item::StaticDef(it) => &it.syntax, | 2858 | Item::Static(it) => &it.syntax, |
2858 | Item::StructDef(it) => &it.syntax, | 2859 | Item::Struct(it) => &it.syntax, |
2859 | Item::TraitDef(it) => &it.syntax, | 2860 | Item::TraitDef(it) => &it.syntax, |
2860 | Item::TypeAliasDef(it) => &it.syntax, | 2861 | Item::TypeAlias(it) => &it.syntax, |
2861 | Item::UnionDef(it) => &it.syntax, | 2862 | Item::Union(it) => &it.syntax, |
2862 | Item::Use(it) => &it.syntax, | 2863 | Item::Use(it) => &it.syntax, |
2863 | } | 2864 | } |
2864 | } | 2865 | } |
@@ -2948,33 +2949,126 @@ impl AstNode for TypeRef { | |||
2948 | } | 2949 | } |
2949 | } | 2950 | } |
2950 | } | 2951 | } |
2951 | impl From<RecordFieldDefList> for FieldDefList { | 2952 | impl From<OrPat> for Pat { |
2952 | fn from(node: RecordFieldDefList) -> FieldDefList { FieldDefList::RecordFieldDefList(node) } | 2953 | fn from(node: OrPat) -> Pat { Pat::OrPat(node) } |
2954 | } | ||
2955 | impl From<ParenPat> for Pat { | ||
2956 | fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) } | ||
2957 | } | ||
2958 | impl From<RefPat> for Pat { | ||
2959 | fn from(node: RefPat) -> Pat { Pat::RefPat(node) } | ||
2960 | } | ||
2961 | impl From<BoxPat> for Pat { | ||
2962 | fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) } | ||
2963 | } | ||
2964 | impl From<BindPat> for Pat { | ||
2965 | fn from(node: BindPat) -> Pat { Pat::BindPat(node) } | ||
2966 | } | ||
2967 | impl From<PlaceholderPat> for Pat { | ||
2968 | fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) } | ||
2969 | } | ||
2970 | impl From<DotDotPat> for Pat { | ||
2971 | fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) } | ||
2972 | } | ||
2973 | impl From<PathPat> for Pat { | ||
2974 | fn from(node: PathPat) -> Pat { Pat::PathPat(node) } | ||
2975 | } | ||
2976 | impl From<RecordPat> for Pat { | ||
2977 | fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) } | ||
2978 | } | ||
2979 | impl From<TupleStructPat> for Pat { | ||
2980 | fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) } | ||
2981 | } | ||
2982 | impl From<TuplePat> for Pat { | ||
2983 | fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) } | ||
2984 | } | ||
2985 | impl From<SlicePat> for Pat { | ||
2986 | fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) } | ||
2987 | } | ||
2988 | impl From<RangePat> for Pat { | ||
2989 | fn from(node: RangePat) -> Pat { Pat::RangePat(node) } | ||
2990 | } | ||
2991 | impl From<LiteralPat> for Pat { | ||
2992 | fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) } | ||
2993 | } | ||
2994 | impl From<MacroPat> for Pat { | ||
2995 | fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) } | ||
2996 | } | ||
2997 | impl AstNode for Pat { | ||
2998 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2999 | match kind { | ||
3000 | OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT | ||
3001 | | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT | ||
3002 | | LITERAL_PAT | MACRO_PAT => true, | ||
3003 | _ => false, | ||
3004 | } | ||
3005 | } | ||
3006 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
3007 | let res = match syntax.kind() { | ||
3008 | OR_PAT => Pat::OrPat(OrPat { syntax }), | ||
3009 | PAREN_PAT => Pat::ParenPat(ParenPat { syntax }), | ||
3010 | REF_PAT => Pat::RefPat(RefPat { syntax }), | ||
3011 | BOX_PAT => Pat::BoxPat(BoxPat { syntax }), | ||
3012 | BIND_PAT => Pat::BindPat(BindPat { syntax }), | ||
3013 | PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }), | ||
3014 | DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }), | ||
3015 | PATH_PAT => Pat::PathPat(PathPat { syntax }), | ||
3016 | RECORD_PAT => Pat::RecordPat(RecordPat { syntax }), | ||
3017 | TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }), | ||
3018 | TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }), | ||
3019 | SLICE_PAT => Pat::SlicePat(SlicePat { syntax }), | ||
3020 | RANGE_PAT => Pat::RangePat(RangePat { syntax }), | ||
3021 | LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }), | ||
3022 | MACRO_PAT => Pat::MacroPat(MacroPat { syntax }), | ||
3023 | _ => return None, | ||
3024 | }; | ||
3025 | Some(res) | ||
3026 | } | ||
3027 | fn syntax(&self) -> &SyntaxNode { | ||
3028 | match self { | ||
3029 | Pat::OrPat(it) => &it.syntax, | ||
3030 | Pat::ParenPat(it) => &it.syntax, | ||
3031 | Pat::RefPat(it) => &it.syntax, | ||
3032 | Pat::BoxPat(it) => &it.syntax, | ||
3033 | Pat::BindPat(it) => &it.syntax, | ||
3034 | Pat::PlaceholderPat(it) => &it.syntax, | ||
3035 | Pat::DotDotPat(it) => &it.syntax, | ||
3036 | Pat::PathPat(it) => &it.syntax, | ||
3037 | Pat::RecordPat(it) => &it.syntax, | ||
3038 | Pat::TupleStructPat(it) => &it.syntax, | ||
3039 | Pat::TuplePat(it) => &it.syntax, | ||
3040 | Pat::SlicePat(it) => &it.syntax, | ||
3041 | Pat::RangePat(it) => &it.syntax, | ||
3042 | Pat::LiteralPat(it) => &it.syntax, | ||
3043 | Pat::MacroPat(it) => &it.syntax, | ||
3044 | } | ||
3045 | } | ||
3046 | } | ||
3047 | impl From<RecordFieldList> for FieldList { | ||
3048 | fn from(node: RecordFieldList) -> FieldList { FieldList::RecordFieldList(node) } | ||
2953 | } | 3049 | } |
2954 | impl From<TupleFieldDefList> for FieldDefList { | 3050 | impl From<TupleFieldList> for FieldList { |
2955 | fn from(node: TupleFieldDefList) -> FieldDefList { FieldDefList::TupleFieldDefList(node) } | 3051 | fn from(node: TupleFieldList) -> FieldList { FieldList::TupleFieldList(node) } |
2956 | } | 3052 | } |
2957 | impl AstNode for FieldDefList { | 3053 | impl AstNode for FieldList { |
2958 | fn can_cast(kind: SyntaxKind) -> bool { | 3054 | fn can_cast(kind: SyntaxKind) -> bool { |
2959 | match kind { | 3055 | match kind { |
2960 | RECORD_FIELD_DEF_LIST | TUPLE_FIELD_DEF_LIST => true, | 3056 | RECORD_FIELD_LIST | TUPLE_FIELD_LIST => true, |
2961 | _ => false, | 3057 | _ => false, |
2962 | } | 3058 | } |
2963 | } | 3059 | } |
2964 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 3060 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2965 | let res = match syntax.kind() { | 3061 | let res = match syntax.kind() { |
2966 | RECORD_FIELD_DEF_LIST => { | 3062 | RECORD_FIELD_LIST => FieldList::RecordFieldList(RecordFieldList { syntax }), |
2967 | FieldDefList::RecordFieldDefList(RecordFieldDefList { syntax }) | 3063 | TUPLE_FIELD_LIST => FieldList::TupleFieldList(TupleFieldList { syntax }), |
2968 | } | ||
2969 | TUPLE_FIELD_DEF_LIST => FieldDefList::TupleFieldDefList(TupleFieldDefList { syntax }), | ||
2970 | _ => return None, | 3064 | _ => return None, |
2971 | }; | 3065 | }; |
2972 | Some(res) | 3066 | Some(res) |
2973 | } | 3067 | } |
2974 | fn syntax(&self) -> &SyntaxNode { | 3068 | fn syntax(&self) -> &SyntaxNode { |
2975 | match self { | 3069 | match self { |
2976 | FieldDefList::RecordFieldDefList(it) => &it.syntax, | 3070 | FieldList::RecordFieldList(it) => &it.syntax, |
2977 | FieldDefList::TupleFieldDefList(it) => &it.syntax, | 3071 | FieldList::TupleFieldList(it) => &it.syntax, |
2978 | } | 3072 | } |
2979 | } | 3073 | } |
2980 | } | 3074 | } |
@@ -3023,8 +3117,8 @@ impl From<ReturnExpr> for Expr { | |||
3023 | impl From<MatchExpr> for Expr { | 3117 | impl From<MatchExpr> for Expr { |
3024 | fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) } | 3118 | fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) } |
3025 | } | 3119 | } |
3026 | impl From<RecordLit> for Expr { | 3120 | impl From<RecordExpr> for Expr { |
3027 | fn from(node: RecordLit) -> Expr { Expr::RecordLit(node) } | 3121 | fn from(node: RecordExpr) -> Expr { Expr::RecordExpr(node) } |
3028 | } | 3122 | } |
3029 | impl From<CallExpr> for Expr { | 3123 | impl From<CallExpr> for Expr { |
3030 | fn from(node: CallExpr) -> Expr { Expr::CallExpr(node) } | 3124 | fn from(node: CallExpr) -> Expr { Expr::CallExpr(node) } |
@@ -3076,7 +3170,7 @@ impl AstNode for Expr { | |||
3076 | match kind { | 3170 | match kind { |
3077 | TUPLE_EXPR | ARRAY_EXPR | PAREN_EXPR | PATH_EXPR | LAMBDA_EXPR | IF_EXPR | 3171 | TUPLE_EXPR | ARRAY_EXPR | PAREN_EXPR | PATH_EXPR | LAMBDA_EXPR | IF_EXPR |
3078 | | LOOP_EXPR | FOR_EXPR | WHILE_EXPR | CONTINUE_EXPR | BREAK_EXPR | LABEL | 3172 | | LOOP_EXPR | FOR_EXPR | WHILE_EXPR | CONTINUE_EXPR | BREAK_EXPR | LABEL |
3079 | | BLOCK_EXPR | RETURN_EXPR | MATCH_EXPR | RECORD_LIT | CALL_EXPR | INDEX_EXPR | 3173 | | BLOCK_EXPR | RETURN_EXPR | MATCH_EXPR | RECORD_EXPR | CALL_EXPR | INDEX_EXPR |
3080 | | METHOD_CALL_EXPR | FIELD_EXPR | AWAIT_EXPR | TRY_EXPR | EFFECT_EXPR | CAST_EXPR | 3174 | | METHOD_CALL_EXPR | FIELD_EXPR | AWAIT_EXPR | TRY_EXPR | EFFECT_EXPR | CAST_EXPR |
3081 | | REF_EXPR | PREFIX_EXPR | RANGE_EXPR | BIN_EXPR | LITERAL | MACRO_CALL | BOX_EXPR => { | 3175 | | REF_EXPR | PREFIX_EXPR | RANGE_EXPR | BIN_EXPR | LITERAL | MACRO_CALL | BOX_EXPR => { |
3082 | true | 3176 | true |
@@ -3101,7 +3195,7 @@ impl AstNode for Expr { | |||
3101 | BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }), | 3195 | BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }), |
3102 | RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }), | 3196 | RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }), |
3103 | MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }), | 3197 | MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }), |
3104 | RECORD_LIT => Expr::RecordLit(RecordLit { syntax }), | 3198 | RECORD_EXPR => Expr::RecordExpr(RecordExpr { syntax }), |
3105 | CALL_EXPR => Expr::CallExpr(CallExpr { syntax }), | 3199 | CALL_EXPR => Expr::CallExpr(CallExpr { syntax }), |
3106 | INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }), | 3200 | INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }), |
3107 | METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }), | 3201 | METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }), |
@@ -3138,7 +3232,7 @@ impl AstNode for Expr { | |||
3138 | Expr::BlockExpr(it) => &it.syntax, | 3232 | Expr::BlockExpr(it) => &it.syntax, |
3139 | Expr::ReturnExpr(it) => &it.syntax, | 3233 | Expr::ReturnExpr(it) => &it.syntax, |
3140 | Expr::MatchExpr(it) => &it.syntax, | 3234 | Expr::MatchExpr(it) => &it.syntax, |
3141 | Expr::RecordLit(it) => &it.syntax, | 3235 | Expr::RecordExpr(it) => &it.syntax, |
3142 | Expr::CallExpr(it) => &it.syntax, | 3236 | Expr::CallExpr(it) => &it.syntax, |
3143 | Expr::IndexExpr(it) => &it.syntax, | 3237 | Expr::IndexExpr(it) => &it.syntax, |
3144 | Expr::MethodCallExpr(it) => &it.syntax, | 3238 | Expr::MethodCallExpr(it) => &it.syntax, |
@@ -3157,14 +3251,14 @@ impl AstNode for Expr { | |||
3157 | } | 3251 | } |
3158 | } | 3252 | } |
3159 | } | 3253 | } |
3160 | impl From<FnDef> for AssocItem { | 3254 | impl From<Fn> for AssocItem { |
3161 | fn from(node: FnDef) -> AssocItem { AssocItem::FnDef(node) } | 3255 | fn from(node: Fn) -> AssocItem { AssocItem::Fn(node) } |
3162 | } | 3256 | } |
3163 | impl From<TypeAliasDef> for AssocItem { | 3257 | impl From<TypeAlias> for AssocItem { |
3164 | fn from(node: TypeAliasDef) -> AssocItem { AssocItem::TypeAliasDef(node) } | 3258 | fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) } |
3165 | } | 3259 | } |
3166 | impl From<ConstDef> for AssocItem { | 3260 | impl From<Const> for AssocItem { |
3167 | fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) } | 3261 | fn from(node: Const) -> AssocItem { AssocItem::Const(node) } |
3168 | } | 3262 | } |
3169 | impl From<MacroCall> for AssocItem { | 3263 | impl From<MacroCall> for AssocItem { |
3170 | fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) } | 3264 | fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) } |
@@ -3172,15 +3266,15 @@ impl From<MacroCall> for AssocItem { | |||
3172 | impl AstNode for AssocItem { | 3266 | impl AstNode for AssocItem { |
3173 | fn can_cast(kind: SyntaxKind) -> bool { | 3267 | fn can_cast(kind: SyntaxKind) -> bool { |
3174 | match kind { | 3268 | match kind { |
3175 | FN_DEF | TYPE_ALIAS_DEF | CONST_DEF | MACRO_CALL => true, | 3269 | FN | TYPE_ALIAS | CONST | MACRO_CALL => true, |
3176 | _ => false, | 3270 | _ => false, |
3177 | } | 3271 | } |
3178 | } | 3272 | } |
3179 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 3273 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
3180 | let res = match syntax.kind() { | 3274 | let res = match syntax.kind() { |
3181 | FN_DEF => AssocItem::FnDef(FnDef { syntax }), | 3275 | FN => AssocItem::Fn(Fn { syntax }), |
3182 | TYPE_ALIAS_DEF => AssocItem::TypeAliasDef(TypeAliasDef { syntax }), | 3276 | TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }), |
3183 | CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), | 3277 | CONST => AssocItem::Const(Const { syntax }), |
3184 | MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), | 3278 | MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), |
3185 | _ => return None, | 3279 | _ => return None, |
3186 | }; | 3280 | }; |
@@ -3188,108 +3282,13 @@ impl AstNode for AssocItem { | |||
3188 | } | 3282 | } |
3189 | fn syntax(&self) -> &SyntaxNode { | 3283 | fn syntax(&self) -> &SyntaxNode { |
3190 | match self { | 3284 | match self { |
3191 | AssocItem::FnDef(it) => &it.syntax, | 3285 | AssocItem::Fn(it) => &it.syntax, |
3192 | AssocItem::TypeAliasDef(it) => &it.syntax, | 3286 | AssocItem::TypeAlias(it) => &it.syntax, |
3193 | AssocItem::ConstDef(it) => &it.syntax, | 3287 | AssocItem::Const(it) => &it.syntax, |
3194 | AssocItem::MacroCall(it) => &it.syntax, | 3288 | AssocItem::MacroCall(it) => &it.syntax, |
3195 | } | 3289 | } |
3196 | } | 3290 | } |
3197 | } | 3291 | } |
3198 | impl From<OrPat> for Pat { | ||
3199 | fn from(node: OrPat) -> Pat { Pat::OrPat(node) } | ||
3200 | } | ||
3201 | impl From<ParenPat> for Pat { | ||
3202 | fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) } | ||
3203 | } | ||
3204 | impl From<RefPat> for Pat { | ||
3205 | fn from(node: RefPat) -> Pat { Pat::RefPat(node) } | ||
3206 | } | ||
3207 | impl From<BoxPat> for Pat { | ||
3208 | fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) } | ||
3209 | } | ||
3210 | impl From<BindPat> for Pat { | ||
3211 | fn from(node: BindPat) -> Pat { Pat::BindPat(node) } | ||
3212 | } | ||
3213 | impl From<PlaceholderPat> for Pat { | ||
3214 | fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) } | ||
3215 | } | ||
3216 | impl From<DotDotPat> for Pat { | ||
3217 | fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) } | ||
3218 | } | ||
3219 | impl From<PathPat> for Pat { | ||
3220 | fn from(node: PathPat) -> Pat { Pat::PathPat(node) } | ||
3221 | } | ||
3222 | impl From<RecordPat> for Pat { | ||
3223 | fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) } | ||
3224 | } | ||
3225 | impl From<TupleStructPat> for Pat { | ||
3226 | fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) } | ||
3227 | } | ||
3228 | impl From<TuplePat> for Pat { | ||
3229 | fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) } | ||
3230 | } | ||
3231 | impl From<SlicePat> for Pat { | ||
3232 | fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) } | ||
3233 | } | ||
3234 | impl From<RangePat> for Pat { | ||
3235 | fn from(node: RangePat) -> Pat { Pat::RangePat(node) } | ||
3236 | } | ||
3237 | impl From<LiteralPat> for Pat { | ||
3238 | fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) } | ||
3239 | } | ||
3240 | impl From<MacroPat> for Pat { | ||
3241 | fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) } | ||
3242 | } | ||
3243 | impl AstNode for Pat { | ||
3244 | fn can_cast(kind: SyntaxKind) -> bool { | ||
3245 | match kind { | ||
3246 | OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT | ||
3247 | | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT | ||
3248 | | LITERAL_PAT | MACRO_PAT => true, | ||
3249 | _ => false, | ||
3250 | } | ||
3251 | } | ||
3252 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
3253 | let res = match syntax.kind() { | ||
3254 | OR_PAT => Pat::OrPat(OrPat { syntax }), | ||
3255 | PAREN_PAT => Pat::ParenPat(ParenPat { syntax }), | ||
3256 | REF_PAT => Pat::RefPat(RefPat { syntax }), | ||
3257 | BOX_PAT => Pat::BoxPat(BoxPat { syntax }), | ||
3258 | BIND_PAT => Pat::BindPat(BindPat { syntax }), | ||
3259 | PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }), | ||
3260 | DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }), | ||
3261 | PATH_PAT => Pat::PathPat(PathPat { syntax }), | ||
3262 | RECORD_PAT => Pat::RecordPat(RecordPat { syntax }), | ||
3263 | TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }), | ||
3264 | TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }), | ||
3265 | SLICE_PAT => Pat::SlicePat(SlicePat { syntax }), | ||
3266 | RANGE_PAT => Pat::RangePat(RangePat { syntax }), | ||
3267 | LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }), | ||
3268 | MACRO_PAT => Pat::MacroPat(MacroPat { syntax }), | ||
3269 | _ => return None, | ||
3270 | }; | ||
3271 | Some(res) | ||
3272 | } | ||
3273 | fn syntax(&self) -> &SyntaxNode { | ||
3274 | match self { | ||
3275 | Pat::OrPat(it) => &it.syntax, | ||
3276 | Pat::ParenPat(it) => &it.syntax, | ||
3277 | Pat::RefPat(it) => &it.syntax, | ||
3278 | Pat::BoxPat(it) => &it.syntax, | ||
3279 | Pat::BindPat(it) => &it.syntax, | ||
3280 | Pat::PlaceholderPat(it) => &it.syntax, | ||
3281 | Pat::DotDotPat(it) => &it.syntax, | ||
3282 | Pat::PathPat(it) => &it.syntax, | ||
3283 | Pat::RecordPat(it) => &it.syntax, | ||
3284 | Pat::TupleStructPat(it) => &it.syntax, | ||
3285 | Pat::TuplePat(it) => &it.syntax, | ||
3286 | Pat::SlicePat(it) => &it.syntax, | ||
3287 | Pat::RangePat(it) => &it.syntax, | ||
3288 | Pat::LiteralPat(it) => &it.syntax, | ||
3289 | Pat::MacroPat(it) => &it.syntax, | ||
3290 | } | ||
3291 | } | ||
3292 | } | ||
3293 | impl From<LetStmt> for Stmt { | 3292 | impl From<LetStmt> for Stmt { |
3294 | fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) } | 3293 | fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) } |
3295 | } | 3294 | } |
@@ -3346,64 +3345,64 @@ impl AstNode for AttrInput { | |||
3346 | } | 3345 | } |
3347 | } | 3346 | } |
3348 | } | 3347 | } |
3349 | impl From<FnDef> for ExternItem { | 3348 | impl From<Fn> for ExternItem { |
3350 | fn from(node: FnDef) -> ExternItem { ExternItem::FnDef(node) } | 3349 | fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) } |
3351 | } | 3350 | } |
3352 | impl From<StaticDef> for ExternItem { | 3351 | impl From<Static> for ExternItem { |
3353 | fn from(node: StaticDef) -> ExternItem { ExternItem::StaticDef(node) } | 3352 | fn from(node: Static) -> ExternItem { ExternItem::Static(node) } |
3354 | } | 3353 | } |
3355 | impl AstNode for ExternItem { | 3354 | impl AstNode for ExternItem { |
3356 | fn can_cast(kind: SyntaxKind) -> bool { | 3355 | fn can_cast(kind: SyntaxKind) -> bool { |
3357 | match kind { | 3356 | match kind { |
3358 | FN_DEF | STATIC_DEF => true, | 3357 | FN | STATIC => true, |
3359 | _ => false, | 3358 | _ => false, |
3360 | } | 3359 | } |
3361 | } | 3360 | } |
3362 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 3361 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
3363 | let res = match syntax.kind() { | 3362 | let res = match syntax.kind() { |
3364 | FN_DEF => ExternItem::FnDef(FnDef { syntax }), | 3363 | FN => ExternItem::Fn(Fn { syntax }), |
3365 | STATIC_DEF => ExternItem::StaticDef(StaticDef { syntax }), | 3364 | STATIC => ExternItem::Static(Static { syntax }), |
3366 | _ => return None, | 3365 | _ => return None, |
3367 | }; | 3366 | }; |
3368 | Some(res) | 3367 | Some(res) |
3369 | } | 3368 | } |
3370 | fn syntax(&self) -> &SyntaxNode { | 3369 | fn syntax(&self) -> &SyntaxNode { |
3371 | match self { | 3370 | match self { |
3372 | ExternItem::FnDef(it) => &it.syntax, | 3371 | ExternItem::Fn(it) => &it.syntax, |
3373 | ExternItem::StaticDef(it) => &it.syntax, | 3372 | ExternItem::Static(it) => &it.syntax, |
3374 | } | 3373 | } |
3375 | } | 3374 | } |
3376 | } | 3375 | } |
3377 | impl From<StructDef> for AdtDef { | 3376 | impl From<Struct> for AdtDef { |
3378 | fn from(node: StructDef) -> AdtDef { AdtDef::StructDef(node) } | 3377 | fn from(node: Struct) -> AdtDef { AdtDef::Struct(node) } |
3379 | } | 3378 | } |
3380 | impl From<EnumDef> for AdtDef { | 3379 | impl From<Enum> for AdtDef { |
3381 | fn from(node: EnumDef) -> AdtDef { AdtDef::EnumDef(node) } | 3380 | fn from(node: Enum) -> AdtDef { AdtDef::Enum(node) } |
3382 | } | 3381 | } |
3383 | impl From<UnionDef> for AdtDef { | 3382 | impl From<Union> for AdtDef { |
3384 | fn from(node: UnionDef) -> AdtDef { AdtDef::UnionDef(node) } | 3383 | fn from(node: Union) -> AdtDef { AdtDef::Union(node) } |
3385 | } | 3384 | } |
3386 | impl AstNode for AdtDef { | 3385 | impl AstNode for AdtDef { |
3387 | fn can_cast(kind: SyntaxKind) -> bool { | 3386 | fn can_cast(kind: SyntaxKind) -> bool { |
3388 | match kind { | 3387 | match kind { |
3389 | STRUCT_DEF | ENUM_DEF | UNION_DEF => true, | 3388 | STRUCT | ENUM | UNION => true, |
3390 | _ => false, | 3389 | _ => false, |
3391 | } | 3390 | } |
3392 | } | 3391 | } |
3393 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 3392 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
3394 | let res = match syntax.kind() { | 3393 | let res = match syntax.kind() { |
3395 | STRUCT_DEF => AdtDef::StructDef(StructDef { syntax }), | 3394 | STRUCT => AdtDef::Struct(Struct { syntax }), |
3396 | ENUM_DEF => AdtDef::EnumDef(EnumDef { syntax }), | 3395 | ENUM => AdtDef::Enum(Enum { syntax }), |
3397 | UNION_DEF => AdtDef::UnionDef(UnionDef { syntax }), | 3396 | UNION => AdtDef::Union(Union { syntax }), |
3398 | _ => return None, | 3397 | _ => return None, |
3399 | }; | 3398 | }; |
3400 | Some(res) | 3399 | Some(res) |
3401 | } | 3400 | } |
3402 | fn syntax(&self) -> &SyntaxNode { | 3401 | fn syntax(&self) -> &SyntaxNode { |
3403 | match self { | 3402 | match self { |
3404 | AdtDef::StructDef(it) => &it.syntax, | 3403 | AdtDef::Struct(it) => &it.syntax, |
3405 | AdtDef::EnumDef(it) => &it.syntax, | 3404 | AdtDef::Enum(it) => &it.syntax, |
3406 | AdtDef::UnionDef(it) => &it.syntax, | 3405 | AdtDef::Union(it) => &it.syntax, |
3407 | } | 3406 | } |
3408 | } | 3407 | } |
3409 | } | 3408 | } |
@@ -3417,22 +3416,22 @@ impl std::fmt::Display for TypeRef { | |||
3417 | std::fmt::Display::fmt(self.syntax(), f) | 3416 | std::fmt::Display::fmt(self.syntax(), f) |
3418 | } | 3417 | } |
3419 | } | 3418 | } |
3420 | impl std::fmt::Display for FieldDefList { | 3419 | impl std::fmt::Display for Pat { |
3421 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3420 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3422 | std::fmt::Display::fmt(self.syntax(), f) | 3421 | std::fmt::Display::fmt(self.syntax(), f) |
3423 | } | 3422 | } |
3424 | } | 3423 | } |
3425 | impl std::fmt::Display for Expr { | 3424 | impl std::fmt::Display for FieldList { |
3426 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3425 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3427 | std::fmt::Display::fmt(self.syntax(), f) | 3426 | std::fmt::Display::fmt(self.syntax(), f) |
3428 | } | 3427 | } |
3429 | } | 3428 | } |
3430 | impl std::fmt::Display for AssocItem { | 3429 | impl std::fmt::Display for Expr { |
3431 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3430 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3432 | std::fmt::Display::fmt(self.syntax(), f) | 3431 | std::fmt::Display::fmt(self.syntax(), f) |
3433 | } | 3432 | } |
3434 | } | 3433 | } |
3435 | impl std::fmt::Display for Pat { | 3434 | impl std::fmt::Display for AssocItem { |
3436 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3435 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3437 | std::fmt::Display::fmt(self.syntax(), f) | 3436 | std::fmt::Display::fmt(self.syntax(), f) |
3438 | } | 3437 | } |
@@ -3467,12 +3466,12 @@ impl std::fmt::Display for Attr { | |||
3467 | std::fmt::Display::fmt(self.syntax(), f) | 3466 | std::fmt::Display::fmt(self.syntax(), f) |
3468 | } | 3467 | } |
3469 | } | 3468 | } |
3470 | impl std::fmt::Display for ConstDef { | 3469 | impl std::fmt::Display for Const { |
3471 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3470 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3472 | std::fmt::Display::fmt(self.syntax(), f) | 3471 | std::fmt::Display::fmt(self.syntax(), f) |
3473 | } | 3472 | } |
3474 | } | 3473 | } |
3475 | impl std::fmt::Display for EnumDef { | 3474 | impl std::fmt::Display for Enum { |
3476 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3475 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3477 | std::fmt::Display::fmt(self.syntax(), f) | 3476 | std::fmt::Display::fmt(self.syntax(), f) |
3478 | } | 3477 | } |
@@ -3487,7 +3486,7 @@ impl std::fmt::Display for ExternCrate { | |||
3487 | std::fmt::Display::fmt(self.syntax(), f) | 3486 | std::fmt::Display::fmt(self.syntax(), f) |
3488 | } | 3487 | } |
3489 | } | 3488 | } |
3490 | impl std::fmt::Display for FnDef { | 3489 | impl std::fmt::Display for Fn { |
3491 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3490 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3492 | std::fmt::Display::fmt(self.syntax(), f) | 3491 | std::fmt::Display::fmt(self.syntax(), f) |
3493 | } | 3492 | } |
@@ -3507,12 +3506,12 @@ impl std::fmt::Display for Module { | |||
3507 | std::fmt::Display::fmt(self.syntax(), f) | 3506 | std::fmt::Display::fmt(self.syntax(), f) |
3508 | } | 3507 | } |
3509 | } | 3508 | } |
3510 | impl std::fmt::Display for StaticDef { | 3509 | impl std::fmt::Display for Static { |
3511 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3510 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3512 | std::fmt::Display::fmt(self.syntax(), f) | 3511 | std::fmt::Display::fmt(self.syntax(), f) |
3513 | } | 3512 | } |
3514 | } | 3513 | } |
3515 | impl std::fmt::Display for StructDef { | 3514 | impl std::fmt::Display for Struct { |
3516 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3515 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3517 | std::fmt::Display::fmt(self.syntax(), f) | 3516 | std::fmt::Display::fmt(self.syntax(), f) |
3518 | } | 3517 | } |
@@ -3522,12 +3521,12 @@ impl std::fmt::Display for TraitDef { | |||
3522 | std::fmt::Display::fmt(self.syntax(), f) | 3521 | std::fmt::Display::fmt(self.syntax(), f) |
3523 | } | 3522 | } |
3524 | } | 3523 | } |
3525 | impl std::fmt::Display for TypeAliasDef { | 3524 | impl std::fmt::Display for TypeAlias { |
3526 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3525 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3527 | std::fmt::Display::fmt(self.syntax(), f) | 3526 | std::fmt::Display::fmt(self.syntax(), f) |
3528 | } | 3527 | } |
3529 | } | 3528 | } |
3530 | impl std::fmt::Display for UnionDef { | 3529 | impl std::fmt::Display for Union { |
3531 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3530 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3532 | std::fmt::Display::fmt(self.syntax(), f) | 3531 | std::fmt::Display::fmt(self.syntax(), f) |
3533 | } | 3532 | } |
@@ -3582,7 +3581,7 @@ impl std::fmt::Display for Abi { | |||
3582 | std::fmt::Display::fmt(self.syntax(), f) | 3581 | std::fmt::Display::fmt(self.syntax(), f) |
3583 | } | 3582 | } |
3584 | } | 3583 | } |
3585 | impl std::fmt::Display for TypeParamList { | 3584 | impl std::fmt::Display for GenericParamList { |
3586 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3585 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3587 | std::fmt::Display::fmt(self.syntax(), f) | 3586 | std::fmt::Display::fmt(self.syntax(), f) |
3588 | } | 3587 | } |
@@ -3607,37 +3606,47 @@ impl std::fmt::Display for BlockExpr { | |||
3607 | std::fmt::Display::fmt(self.syntax(), f) | 3606 | std::fmt::Display::fmt(self.syntax(), f) |
3608 | } | 3607 | } |
3609 | } | 3608 | } |
3610 | impl std::fmt::Display for RecordFieldDefList { | 3609 | impl std::fmt::Display for Param { |
3611 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3610 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3612 | std::fmt::Display::fmt(self.syntax(), f) | 3611 | std::fmt::Display::fmt(self.syntax(), f) |
3613 | } | 3612 | } |
3614 | } | 3613 | } |
3615 | impl std::fmt::Display for TupleFieldDefList { | 3614 | impl std::fmt::Display for SelfParam { |
3616 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3615 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3617 | std::fmt::Display::fmt(self.syntax(), f) | 3616 | std::fmt::Display::fmt(self.syntax(), f) |
3618 | } | 3617 | } |
3619 | } | 3618 | } |
3620 | impl std::fmt::Display for RecordFieldDef { | 3619 | impl std::fmt::Display for TypeBoundList { |
3621 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3620 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3622 | std::fmt::Display::fmt(self.syntax(), f) | 3621 | std::fmt::Display::fmt(self.syntax(), f) |
3623 | } | 3622 | } |
3624 | } | 3623 | } |
3625 | impl std::fmt::Display for TupleFieldDef { | 3624 | impl std::fmt::Display for RecordFieldList { |
3626 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3625 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3627 | std::fmt::Display::fmt(self.syntax(), f) | 3626 | std::fmt::Display::fmt(self.syntax(), f) |
3628 | } | 3627 | } |
3629 | } | 3628 | } |
3630 | impl std::fmt::Display for EnumVariantList { | 3629 | impl std::fmt::Display for TupleFieldList { |
3631 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3630 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3632 | std::fmt::Display::fmt(self.syntax(), f) | 3631 | std::fmt::Display::fmt(self.syntax(), f) |
3633 | } | 3632 | } |
3634 | } | 3633 | } |
3635 | impl std::fmt::Display for EnumVariant { | 3634 | impl std::fmt::Display for RecordField { |
3636 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3635 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3637 | std::fmt::Display::fmt(self.syntax(), f) | 3636 | std::fmt::Display::fmt(self.syntax(), f) |
3638 | } | 3637 | } |
3639 | } | 3638 | } |
3640 | impl std::fmt::Display for TypeBoundList { | 3639 | impl std::fmt::Display for TupleField { |
3640 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
3641 | std::fmt::Display::fmt(self.syntax(), f) | ||
3642 | } | ||
3643 | } | ||
3644 | impl std::fmt::Display for VariantList { | ||
3645 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
3646 | std::fmt::Display::fmt(self.syntax(), f) | ||
3647 | } | ||
3648 | } | ||
3649 | impl std::fmt::Display for Variant { | ||
3641 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3650 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3642 | std::fmt::Display::fmt(self.syntax(), f) | 3651 | std::fmt::Display::fmt(self.syntax(), f) |
3643 | } | 3652 | } |
@@ -3882,17 +3891,17 @@ impl std::fmt::Display for MatchGuard { | |||
3882 | std::fmt::Display::fmt(self.syntax(), f) | 3891 | std::fmt::Display::fmt(self.syntax(), f) |
3883 | } | 3892 | } |
3884 | } | 3893 | } |
3885 | impl std::fmt::Display for RecordLit { | 3894 | impl std::fmt::Display for RecordExpr { |
3886 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3895 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3887 | std::fmt::Display::fmt(self.syntax(), f) | 3896 | std::fmt::Display::fmt(self.syntax(), f) |
3888 | } | 3897 | } |
3889 | } | 3898 | } |
3890 | impl std::fmt::Display for RecordFieldList { | 3899 | impl std::fmt::Display for RecordExprFieldList { |
3891 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3900 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3892 | std::fmt::Display::fmt(self.syntax(), f) | 3901 | std::fmt::Display::fmt(self.syntax(), f) |
3893 | } | 3902 | } |
3894 | } | 3903 | } |
3895 | impl std::fmt::Display for RecordField { | 3904 | impl std::fmt::Display for RecordExprField { |
3896 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3905 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3897 | std::fmt::Display::fmt(self.syntax(), f) | 3906 | std::fmt::Display::fmt(self.syntax(), f) |
3898 | } | 3907 | } |
@@ -4037,16 +4046,6 @@ impl std::fmt::Display for LetStmt { | |||
4037 | std::fmt::Display::fmt(self.syntax(), f) | 4046 | std::fmt::Display::fmt(self.syntax(), f) |
4038 | } | 4047 | } |
4039 | } | 4048 | } |
4040 | impl std::fmt::Display for SelfParam { | ||
4041 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
4042 | std::fmt::Display::fmt(self.syntax(), f) | ||
4043 | } | ||
4044 | } | ||
4045 | impl std::fmt::Display for Param { | ||
4046 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
4047 | std::fmt::Display::fmt(self.syntax(), f) | ||
4048 | } | ||
4049 | } | ||
4050 | impl std::fmt::Display for PathSegment { | 4049 | impl std::fmt::Display for PathSegment { |
4051 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 4050 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4052 | std::fmt::Display::fmt(self.syntax(), f) | 4051 | std::fmt::Display::fmt(self.syntax(), f) |