1#![allow(non_snake_case)]
4use crate::{
5 ast::{self, support, AstChildren, AstNode},
6 SyntaxKind::{self, *},
7 SyntaxNode, SyntaxToken, T,
8};
9use std::{fmt, hash};
10pub struct Abi {
11 pub(crate) syntax: SyntaxNode,
12}
13impl Abi {
14 #[inline]
15 pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
16 #[inline]
17 pub fn string_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![string]) }
18}
19pub struct ArgList {
20 pub(crate) syntax: SyntaxNode,
21}
22impl ArgList {
23 #[inline]
24 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
25 #[inline]
26 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
27}
28pub struct ArrayExpr {
29 pub(crate) syntax: SyntaxNode,
30}
31impl ast::HasAttrs for ArrayExpr {}
32impl ArrayExpr {
33 #[inline]
34 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
35 #[inline]
36 pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
37 #[inline]
38 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
39 #[inline]
40 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
41 #[inline]
42 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
43}
44pub struct ArrayType {
45 pub(crate) syntax: SyntaxNode,
46}
47impl ArrayType {
48 #[inline]
49 pub fn const_arg(&self) -> Option<ConstArg> { support::child(&self.syntax) }
50 #[inline]
51 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
52 #[inline]
53 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
54 #[inline]
55 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
56 #[inline]
57 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
58}
59pub struct AsmClobberAbi {
60 pub(crate) syntax: SyntaxNode,
61}
62impl AsmClobberAbi {
63 #[inline]
64 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
65 #[inline]
66 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
67 #[inline]
68 pub fn clobber_abi_token(&self) -> Option<SyntaxToken> {
69 support::token(&self.syntax, T![clobber_abi])
70 }
71 #[inline]
72 pub fn string_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![string]) }
73}
74pub struct AsmConst {
75 pub(crate) syntax: SyntaxNode,
76}
77impl AsmConst {
78 #[inline]
79 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
80 #[inline]
81 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
82}
83pub struct AsmDirSpec {
84 pub(crate) syntax: SyntaxNode,
85}
86impl AsmDirSpec {
87 #[inline]
88 pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
89 #[inline]
90 pub fn inlateout_token(&self) -> Option<SyntaxToken> {
91 support::token(&self.syntax, T![inlateout])
92 }
93 #[inline]
94 pub fn inout_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![inout]) }
95 #[inline]
96 pub fn lateout_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![lateout]) }
97 #[inline]
98 pub fn out_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![out]) }
99}
100pub struct AsmExpr {
101 pub(crate) syntax: SyntaxNode,
102}
103impl ast::HasAttrs for AsmExpr {}
104impl AsmExpr {
105 #[inline]
106 pub fn asm_pieces(&self) -> AstChildren<AsmPiece> { support::children(&self.syntax) }
107 #[inline]
108 pub fn template(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
109 #[inline]
110 pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
111 #[inline]
112 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
113 #[inline]
114 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
115 #[inline]
116 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
117 #[inline]
118 pub fn asm_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![asm]) }
119 #[inline]
120 pub fn builtin_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![builtin]) }
121}
122pub struct AsmLabel {
123 pub(crate) syntax: SyntaxNode,
124}
125impl AsmLabel {
126 #[inline]
127 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
128 #[inline]
129 pub fn label_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![label]) }
130}
131pub struct AsmOperandExpr {
132 pub(crate) syntax: SyntaxNode,
133}
134impl AsmOperandExpr {
135 #[inline]
136 pub fn in_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
137 #[inline]
138 pub fn out_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
139 #[inline]
140 pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) }
141}
142pub struct AsmOperandNamed {
143 pub(crate) syntax: SyntaxNode,
144}
145impl ast::HasName for AsmOperandNamed {}
146impl AsmOperandNamed {
147 #[inline]
148 pub fn asm_operand(&self) -> Option<AsmOperand> { support::child(&self.syntax) }
149 #[inline]
150 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
151}
152pub struct AsmOption {
153 pub(crate) syntax: SyntaxNode,
154}
155impl AsmOption {
156 #[inline]
157 pub fn att_syntax_token(&self) -> Option<SyntaxToken> {
158 support::token(&self.syntax, T![att_syntax])
159 }
160 #[inline]
161 pub fn may_unwind_token(&self) -> Option<SyntaxToken> {
162 support::token(&self.syntax, T![may_unwind])
163 }
164 #[inline]
165 pub fn nomem_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![nomem]) }
166 #[inline]
167 pub fn noreturn_token(&self) -> Option<SyntaxToken> {
168 support::token(&self.syntax, T![noreturn])
169 }
170 #[inline]
171 pub fn nostack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![nostack]) }
172 #[inline]
173 pub fn preserves_flags_token(&self) -> Option<SyntaxToken> {
174 support::token(&self.syntax, T![preserves_flags])
175 }
176 #[inline]
177 pub fn pure_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![pure]) }
178 #[inline]
179 pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) }
180 #[inline]
181 pub fn readonly_token(&self) -> Option<SyntaxToken> {
182 support::token(&self.syntax, T![readonly])
183 }
184}
185pub struct AsmOptions {
186 pub(crate) syntax: SyntaxNode,
187}
188impl AsmOptions {
189 #[inline]
190 pub fn asm_options(&self) -> AstChildren<AsmOption> { support::children(&self.syntax) }
191 #[inline]
192 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
193 #[inline]
194 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
195 #[inline]
196 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
197 #[inline]
198 pub fn options_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![options]) }
199}
200pub struct AsmRegOperand {
201 pub(crate) syntax: SyntaxNode,
202}
203impl AsmRegOperand {
204 #[inline]
205 pub fn asm_dir_spec(&self) -> Option<AsmDirSpec> { support::child(&self.syntax) }
206 #[inline]
207 pub fn asm_operand_expr(&self) -> Option<AsmOperandExpr> { support::child(&self.syntax) }
208 #[inline]
209 pub fn asm_reg_spec(&self) -> Option<AsmRegSpec> { support::child(&self.syntax) }
210 #[inline]
211 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
212 #[inline]
213 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
214}
215pub struct AsmRegSpec {
216 pub(crate) syntax: SyntaxNode,
217}
218impl AsmRegSpec {
219 #[inline]
220 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
221 #[inline]
222 pub fn string_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![string]) }
223}
224pub struct AsmSym {
225 pub(crate) syntax: SyntaxNode,
226}
227impl AsmSym {
228 #[inline]
229 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
230 #[inline]
231 pub fn sym_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![sym]) }
232}
233pub struct AssocItemList {
234 pub(crate) syntax: SyntaxNode,
235}
236impl ast::HasAttrs for AssocItemList {}
237impl AssocItemList {
238 #[inline]
239 pub fn assoc_items(&self) -> AstChildren<AssocItem> { support::children(&self.syntax) }
240 #[inline]
241 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
242 #[inline]
243 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
244}
245pub struct AssocTypeArg {
246 pub(crate) syntax: SyntaxNode,
247}
248impl ast::HasGenericArgs for AssocTypeArg {}
249impl ast::HasTypeBounds for AssocTypeArg {}
250impl AssocTypeArg {
251 #[inline]
252 pub fn const_arg(&self) -> Option<ConstArg> { support::child(&self.syntax) }
253 #[inline]
254 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
255 #[inline]
256 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
257 #[inline]
258 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
259 #[inline]
260 pub fn return_type_syntax(&self) -> Option<ReturnTypeSyntax> { support::child(&self.syntax) }
261 #[inline]
262 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
263 #[inline]
264 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
265}
266pub struct Attr {
267 pub(crate) syntax: SyntaxNode,
268}
269impl Attr {
270 #[inline]
271 pub fn meta(&self) -> Option<Meta> { support::child(&self.syntax) }
272 #[inline]
273 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
274 #[inline]
275 pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
276 #[inline]
277 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
278 #[inline]
279 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
280}
281pub struct AwaitExpr {
282 pub(crate) syntax: SyntaxNode,
283}
284impl ast::HasAttrs for AwaitExpr {}
285impl AwaitExpr {
286 #[inline]
287 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
288 #[inline]
289 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
290 #[inline]
291 pub fn await_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![await]) }
292}
293pub struct BecomeExpr {
294 pub(crate) syntax: SyntaxNode,
295}
296impl ast::HasAttrs for BecomeExpr {}
297impl BecomeExpr {
298 #[inline]
299 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
300 #[inline]
301 pub fn become_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![become]) }
302}
303pub struct BinExpr {
304 pub(crate) syntax: SyntaxNode,
305}
306impl ast::HasAttrs for BinExpr {}
307impl BinExpr {}
308pub struct BlockExpr {
309 pub(crate) syntax: SyntaxNode,
310}
311impl ast::HasAttrs for BlockExpr {}
312impl BlockExpr {
313 #[inline]
314 pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
315 #[inline]
316 pub fn stmt_list(&self) -> Option<StmtList> { support::child(&self.syntax) }
317 #[inline]
318 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
319 #[inline]
320 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
321 #[inline]
322 pub fn gen_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![gen]) }
323 #[inline]
324 pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
325 #[inline]
326 pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) }
327 #[inline]
328 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
329}
330pub struct BoxPat {
331 pub(crate) syntax: SyntaxNode,
332}
333impl BoxPat {
334 #[inline]
335 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
336 #[inline]
337 pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) }
338}
339pub struct BreakExpr {
340 pub(crate) syntax: SyntaxNode,
341}
342impl ast::HasAttrs for BreakExpr {}
343impl BreakExpr {
344 #[inline]
345 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
346 #[inline]
347 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
348 #[inline]
349 pub fn break_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![break]) }
350}
351pub struct CallExpr {
352 pub(crate) syntax: SyntaxNode,
353}
354impl ast::HasArgList for CallExpr {}
355impl ast::HasAttrs for CallExpr {}
356impl CallExpr {
357 #[inline]
358 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
359}
360pub struct CastExpr {
361 pub(crate) syntax: SyntaxNode,
362}
363impl ast::HasAttrs for CastExpr {}
364impl CastExpr {
365 #[inline]
366 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
367 #[inline]
368 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
369 #[inline]
370 pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
371}
372pub struct ClosureBinder {
373 pub(crate) syntax: SyntaxNode,
374}
375impl ClosureBinder {
376 #[inline]
377 pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
378 #[inline]
379 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
380}
381pub struct ClosureExpr {
382 pub(crate) syntax: SyntaxNode,
383}
384impl ast::HasAttrs for ClosureExpr {}
385impl ClosureExpr {
386 #[inline]
387 pub fn closure_binder(&self) -> Option<ClosureBinder> { support::child(&self.syntax) }
388 #[inline]
389 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
390 #[inline]
391 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
392 #[inline]
393 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
394 #[inline]
395 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
396 #[inline]
397 pub fn gen_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![gen]) }
398 #[inline]
399 pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
400 #[inline]
401 pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
402}
403pub struct Const {
404 pub(crate) syntax: SyntaxNode,
405}
406impl ast::HasAttrs for Const {}
407impl ast::HasDocComments for Const {}
408impl ast::HasGenericParams for Const {}
409impl ast::HasName for Const {}
410impl ast::HasVisibility for Const {}
411impl Const {
412 #[inline]
413 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
414 #[inline]
415 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
416 #[inline]
417 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
418 #[inline]
419 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
420 #[inline]
421 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
422 #[inline]
423 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
424 #[inline]
425 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
426}
427pub struct ConstArg {
428 pub(crate) syntax: SyntaxNode,
429}
430impl ConstArg {
431 #[inline]
432 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
433}
434pub struct ConstBlockPat {
435 pub(crate) syntax: SyntaxNode,
436}
437impl ConstBlockPat {
438 #[inline]
439 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
440 #[inline]
441 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
442}
443pub struct ConstParam {
444 pub(crate) syntax: SyntaxNode,
445}
446impl ast::HasAttrs for ConstParam {}
447impl ast::HasName for ConstParam {}
448impl ConstParam {
449 #[inline]
450 pub fn default_val(&self) -> Option<ConstArg> { support::child(&self.syntax) }
451 #[inline]
452 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
453 #[inline]
454 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
455 #[inline]
456 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
457 #[inline]
458 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
459}
460pub struct ContinueExpr {
461 pub(crate) syntax: SyntaxNode,
462}
463impl ast::HasAttrs for ContinueExpr {}
464impl ContinueExpr {
465 #[inline]
466 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
467 #[inline]
468 pub fn continue_token(&self) -> Option<SyntaxToken> {
469 support::token(&self.syntax, T![continue])
470 }
471}
472pub struct DynTraitType {
473 pub(crate) syntax: SyntaxNode,
474}
475impl DynTraitType {
476 #[inline]
477 pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
478 #[inline]
479 pub fn dyn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![dyn]) }
480}
481pub struct Enum {
482 pub(crate) syntax: SyntaxNode,
483}
484impl ast::HasAttrs for Enum {}
485impl ast::HasDocComments for Enum {}
486impl ast::HasGenericParams for Enum {}
487impl ast::HasName for Enum {}
488impl ast::HasVisibility for Enum {}
489impl Enum {
490 #[inline]
491 pub fn variant_list(&self) -> Option<VariantList> { support::child(&self.syntax) }
492 #[inline]
493 pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) }
494}
495pub struct ExprStmt {
496 pub(crate) syntax: SyntaxNode,
497}
498impl ExprStmt {
499 #[inline]
500 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
501 #[inline]
502 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
503}
504pub struct ExternBlock {
505 pub(crate) syntax: SyntaxNode,
506}
507impl ast::HasAttrs for ExternBlock {}
508impl ast::HasDocComments for ExternBlock {}
509impl ExternBlock {
510 #[inline]
511 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
512 #[inline]
513 pub fn extern_item_list(&self) -> Option<ExternItemList> { support::child(&self.syntax) }
514 #[inline]
515 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
516}
517pub struct ExternCrate {
518 pub(crate) syntax: SyntaxNode,
519}
520impl ast::HasAttrs for ExternCrate {}
521impl ast::HasDocComments for ExternCrate {}
522impl ast::HasVisibility for ExternCrate {}
523impl ExternCrate {
524 #[inline]
525 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
526 #[inline]
527 pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) }
528 #[inline]
529 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
530 #[inline]
531 pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
532 #[inline]
533 pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
534}
535pub struct ExternItemList {
536 pub(crate) syntax: SyntaxNode,
537}
538impl ast::HasAttrs for ExternItemList {}
539impl ExternItemList {
540 #[inline]
541 pub fn extern_items(&self) -> AstChildren<ExternItem> { support::children(&self.syntax) }
542 #[inline]
543 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
544 #[inline]
545 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
546}
547pub struct FieldExpr {
548 pub(crate) syntax: SyntaxNode,
549}
550impl ast::HasAttrs for FieldExpr {}
551impl FieldExpr {
552 #[inline]
553 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
554 #[inline]
555 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
556 #[inline]
557 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
558}
559pub struct Fn {
560 pub(crate) syntax: SyntaxNode,
561}
562impl ast::HasAttrs for Fn {}
563impl ast::HasDocComments for Fn {}
564impl ast::HasGenericParams for Fn {}
565impl ast::HasName for Fn {}
566impl ast::HasVisibility for Fn {}
567impl Fn {
568 #[inline]
569 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
570 #[inline]
571 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
572 #[inline]
573 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
574 #[inline]
575 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
576 #[inline]
577 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
578 #[inline]
579 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
580 #[inline]
581 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
582 #[inline]
583 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
584 #[inline]
585 pub fn gen_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![gen]) }
586 #[inline]
587 pub fn safe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![safe]) }
588 #[inline]
589 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
590}
591pub struct FnPtrType {
592 pub(crate) syntax: SyntaxNode,
593}
594impl FnPtrType {
595 #[inline]
596 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
597 #[inline]
598 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
599 #[inline]
600 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
601 #[inline]
602 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
603 #[inline]
604 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
605 #[inline]
606 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
607 #[inline]
608 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
609}
610pub struct ForExpr {
611 pub(crate) syntax: SyntaxNode,
612}
613impl ast::HasAttrs for ForExpr {}
614impl ForExpr {
615 #[inline]
616 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
617 #[inline]
618 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
619 #[inline]
620 pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
621}
622pub struct ForType {
623 pub(crate) syntax: SyntaxNode,
624}
625impl ForType {
626 #[inline]
627 pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
628 #[inline]
629 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
630 #[inline]
631 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
632}
633pub struct FormatArgsArg {
634 pub(crate) syntax: SyntaxNode,
635}
636impl ast::HasName for FormatArgsArg {}
637impl FormatArgsArg {
638 #[inline]
639 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
640 #[inline]
641 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
642}
643pub struct FormatArgsExpr {
644 pub(crate) syntax: SyntaxNode,
645}
646impl ast::HasAttrs for FormatArgsExpr {}
647impl FormatArgsExpr {
648 #[inline]
649 pub fn template(&self) -> Option<Expr> { support::child(&self.syntax) }
650 #[inline]
651 pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
652 #[inline]
653 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
654 #[inline]
655 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
656 #[inline]
657 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
658 #[inline]
659 pub fn builtin_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![builtin]) }
660 #[inline]
661 pub fn format_args_token(&self) -> Option<SyntaxToken> {
662 support::token(&self.syntax, T![format_args])
663 }
664}
665pub struct GenericArgList {
666 pub(crate) syntax: SyntaxNode,
667}
668impl GenericArgList {
669 #[inline]
670 pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) }
671 #[inline]
672 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
673 #[inline]
674 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
675 #[inline]
676 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
677}
678pub struct GenericParamList {
679 pub(crate) syntax: SyntaxNode,
680}
681impl GenericParamList {
682 #[inline]
683 pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) }
684 #[inline]
685 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
686 #[inline]
687 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
688}
689pub struct IdentPat {
690 pub(crate) syntax: SyntaxNode,
691}
692impl ast::HasAttrs for IdentPat {}
693impl ast::HasName for IdentPat {}
694impl IdentPat {
695 #[inline]
696 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
697 #[inline]
698 pub fn at_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![@]) }
699 #[inline]
700 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
701 #[inline]
702 pub fn ref_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ref]) }
703}
704pub struct IfExpr {
705 pub(crate) syntax: SyntaxNode,
706}
707impl ast::HasAttrs for IfExpr {}
708impl IfExpr {
709 #[inline]
710 pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
711 #[inline]
712 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
713}
714pub struct Impl {
715 pub(crate) syntax: SyntaxNode,
716}
717impl ast::HasAttrs for Impl {}
718impl ast::HasDocComments for Impl {}
719impl ast::HasGenericParams for Impl {}
720impl ast::HasVisibility for Impl {}
721impl Impl {
722 #[inline]
723 pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
724 #[inline]
725 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
726 #[inline]
727 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
728 #[inline]
729 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
730 #[inline]
731 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
732 #[inline]
733 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
734 #[inline]
735 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
736}
737pub struct ImplTraitType {
738 pub(crate) syntax: SyntaxNode,
739}
740impl ImplTraitType {
741 #[inline]
742 pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
743 #[inline]
744 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
745}
746pub struct IndexExpr {
747 pub(crate) syntax: SyntaxNode,
748}
749impl ast::HasAttrs for IndexExpr {}
750impl IndexExpr {
751 #[inline]
752 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
753 #[inline]
754 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
755}
756pub struct InferType {
757 pub(crate) syntax: SyntaxNode,
758}
759impl InferType {
760 #[inline]
761 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
762}
763pub struct ItemList {
764 pub(crate) syntax: SyntaxNode,
765}
766impl ast::HasAttrs for ItemList {}
767impl ast::HasModuleItem for ItemList {}
768impl ItemList {
769 #[inline]
770 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
771 #[inline]
772 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
773}
774pub struct Label {
775 pub(crate) syntax: SyntaxNode,
776}
777impl Label {
778 #[inline]
779 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
780 #[inline]
781 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
782}
783pub struct LetElse {
784 pub(crate) syntax: SyntaxNode,
785}
786impl LetElse {
787 #[inline]
788 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
789 #[inline]
790 pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
791}
792pub struct LetExpr {
793 pub(crate) syntax: SyntaxNode,
794}
795impl ast::HasAttrs for LetExpr {}
796impl LetExpr {
797 #[inline]
798 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
799 #[inline]
800 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
801 #[inline]
802 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
803 #[inline]
804 pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) }
805}
806pub struct LetStmt {
807 pub(crate) syntax: SyntaxNode,
808}
809impl ast::HasAttrs for LetStmt {}
810impl LetStmt {
811 #[inline]
812 pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) }
813 #[inline]
814 pub fn let_else(&self) -> Option<LetElse> { support::child(&self.syntax) }
815 #[inline]
816 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
817 #[inline]
818 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
819 #[inline]
820 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
821 #[inline]
822 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
823 #[inline]
824 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
825 #[inline]
826 pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) }
827 #[inline]
828 pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) }
829}
830pub struct Lifetime {
831 pub(crate) syntax: SyntaxNode,
832}
833impl Lifetime {
834 #[inline]
835 pub fn lifetime_ident_token(&self) -> Option<SyntaxToken> {
836 support::token(&self.syntax, T![lifetime_ident])
837 }
838}
839pub struct LifetimeArg {
840 pub(crate) syntax: SyntaxNode,
841}
842impl LifetimeArg {
843 #[inline]
844 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
845}
846pub struct LifetimeParam {
847 pub(crate) syntax: SyntaxNode,
848}
849impl ast::HasAttrs for LifetimeParam {}
850impl ast::HasTypeBounds for LifetimeParam {}
851impl LifetimeParam {
852 #[inline]
853 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
854}
855pub struct Literal {
856 pub(crate) syntax: SyntaxNode,
857}
858impl ast::HasAttrs for Literal {}
859impl Literal {}
860pub struct LiteralPat {
861 pub(crate) syntax: SyntaxNode,
862}
863impl LiteralPat {
864 #[inline]
865 pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) }
866 #[inline]
867 pub fn minus_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![-]) }
868}
869pub struct LoopExpr {
870 pub(crate) syntax: SyntaxNode,
871}
872impl ast::HasAttrs for LoopExpr {}
873impl ast::HasLoopBody for LoopExpr {}
874impl LoopExpr {
875 #[inline]
876 pub fn loop_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![loop]) }
877}
878pub struct MacroCall {
879 pub(crate) syntax: SyntaxNode,
880}
881impl ast::HasAttrs for MacroCall {}
882impl ast::HasDocComments for MacroCall {}
883impl MacroCall {
884 #[inline]
885 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
886 #[inline]
887 pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
888 #[inline]
889 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
890 #[inline]
891 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
892}
893pub struct MacroDef {
894 pub(crate) syntax: SyntaxNode,
895}
896impl ast::HasAttrs for MacroDef {}
897impl ast::HasDocComments for MacroDef {}
898impl ast::HasName for MacroDef {}
899impl ast::HasVisibility for MacroDef {}
900impl MacroDef {
901 #[inline]
902 pub fn macro_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![macro]) }
903}
904pub struct MacroExpr {
905 pub(crate) syntax: SyntaxNode,
906}
907impl MacroExpr {
908 #[inline]
909 pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
910}
911pub struct MacroItems {
912 pub(crate) syntax: SyntaxNode,
913}
914impl ast::HasModuleItem for MacroItems {}
915impl MacroItems {}
916pub struct MacroPat {
917 pub(crate) syntax: SyntaxNode,
918}
919impl MacroPat {
920 #[inline]
921 pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
922}
923pub struct MacroRules {
924 pub(crate) syntax: SyntaxNode,
925}
926impl ast::HasAttrs for MacroRules {}
927impl ast::HasDocComments for MacroRules {}
928impl ast::HasName for MacroRules {}
929impl ast::HasVisibility for MacroRules {}
930impl MacroRules {
931 #[inline]
932 pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
933 #[inline]
934 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
935 #[inline]
936 pub fn macro_rules_token(&self) -> Option<SyntaxToken> {
937 support::token(&self.syntax, T![macro_rules])
938 }
939}
940pub struct MacroStmts {
941 pub(crate) syntax: SyntaxNode,
942}
943impl MacroStmts {
944 #[inline]
945 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
946 #[inline]
947 pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
948}
949pub struct MacroType {
950 pub(crate) syntax: SyntaxNode,
951}
952impl MacroType {
953 #[inline]
954 pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
955}
956pub struct MatchArm {
957 pub(crate) syntax: SyntaxNode,
958}
959impl ast::HasAttrs for MatchArm {}
960impl MatchArm {
961 #[inline]
962 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
963 #[inline]
964 pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) }
965 #[inline]
966 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
967 #[inline]
968 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
969 #[inline]
970 pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) }
971}
972pub struct MatchArmList {
973 pub(crate) syntax: SyntaxNode,
974}
975impl ast::HasAttrs for MatchArmList {}
976impl MatchArmList {
977 #[inline]
978 pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) }
979 #[inline]
980 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
981 #[inline]
982 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
983}
984pub struct MatchExpr {
985 pub(crate) syntax: SyntaxNode,
986}
987impl ast::HasAttrs for MatchExpr {}
988impl MatchExpr {
989 #[inline]
990 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
991 #[inline]
992 pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) }
993 #[inline]
994 pub fn match_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![match]) }
995}
996pub struct MatchGuard {
997 pub(crate) syntax: SyntaxNode,
998}
999impl MatchGuard {
1000 #[inline]
1001 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
1002}
1003pub struct Meta {
1004 pub(crate) syntax: SyntaxNode,
1005}
1006impl Meta {
1007 #[inline]
1008 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1009 #[inline]
1010 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1011 #[inline]
1012 pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
1013 #[inline]
1014 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1015 #[inline]
1016 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1017 #[inline]
1018 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1019 #[inline]
1020 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
1021}
1022pub struct MethodCallExpr {
1023 pub(crate) syntax: SyntaxNode,
1024}
1025impl ast::HasArgList for MethodCallExpr {}
1026impl ast::HasAttrs for MethodCallExpr {}
1027impl ast::HasGenericArgs for MethodCallExpr {}
1028impl MethodCallExpr {
1029 #[inline]
1030 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
1031 #[inline]
1032 pub fn receiver(&self) -> Option<Expr> { support::child(&self.syntax) }
1033 #[inline]
1034 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
1035}
1036pub struct Module {
1037 pub(crate) syntax: SyntaxNode,
1038}
1039impl ast::HasAttrs for Module {}
1040impl ast::HasDocComments for Module {}
1041impl ast::HasName for Module {}
1042impl ast::HasVisibility for Module {}
1043impl Module {
1044 #[inline]
1045 pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
1046 #[inline]
1047 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1048 #[inline]
1049 pub fn mod_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mod]) }
1050}
1051pub struct Name {
1052 pub(crate) syntax: SyntaxNode,
1053}
1054impl Name {
1055 #[inline]
1056 pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
1057 #[inline]
1058 pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
1059}
1060pub struct NameRef {
1061 pub(crate) syntax: SyntaxNode,
1062}
1063impl NameRef {
1064 #[inline]
1065 pub fn Self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![Self]) }
1066 #[inline]
1067 pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
1068 #[inline]
1069 pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
1070 #[inline]
1071 pub fn int_number_token(&self) -> Option<SyntaxToken> {
1072 support::token(&self.syntax, T![int_number])
1073 }
1074 #[inline]
1075 pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
1076 #[inline]
1077 pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) }
1078}
1079pub struct NeverType {
1080 pub(crate) syntax: SyntaxNode,
1081}
1082impl NeverType {
1083 #[inline]
1084 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
1085}
1086pub struct OffsetOfExpr {
1087 pub(crate) syntax: SyntaxNode,
1088}
1089impl ast::HasAttrs for OffsetOfExpr {}
1090impl OffsetOfExpr {
1091 #[inline]
1092 pub fn fields(&self) -> AstChildren<NameRef> { support::children(&self.syntax) }
1093 #[inline]
1094 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1095 #[inline]
1096 pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
1097 #[inline]
1098 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1099 #[inline]
1100 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1101 #[inline]
1102 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
1103 #[inline]
1104 pub fn builtin_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![builtin]) }
1105 #[inline]
1106 pub fn offset_of_token(&self) -> Option<SyntaxToken> {
1107 support::token(&self.syntax, T![offset_of])
1108 }
1109}
1110pub struct OrPat {
1111 pub(crate) syntax: SyntaxNode,
1112}
1113impl OrPat {
1114 #[inline]
1115 pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
1116 #[inline]
1117 pub fn pipe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![|]) }
1118}
1119pub struct Param {
1120 pub(crate) syntax: SyntaxNode,
1121}
1122impl ast::HasAttrs for Param {}
1123impl Param {
1124 #[inline]
1125 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1126 #[inline]
1127 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1128 #[inline]
1129 pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) }
1130 #[inline]
1131 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1132}
1133pub struct ParamList {
1134 pub(crate) syntax: SyntaxNode,
1135}
1136impl ParamList {
1137 #[inline]
1138 pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) }
1139 #[inline]
1140 pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
1141 #[inline]
1142 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1143 #[inline]
1144 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1145 #[inline]
1146 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
1147 #[inline]
1148 pub fn pipe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![|]) }
1149}
1150pub struct ParenExpr {
1151 pub(crate) syntax: SyntaxNode,
1152}
1153impl ast::HasAttrs for ParenExpr {}
1154impl ParenExpr {
1155 #[inline]
1156 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1157 #[inline]
1158 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1159 #[inline]
1160 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1161}
1162pub struct ParenPat {
1163 pub(crate) syntax: SyntaxNode,
1164}
1165impl ParenPat {
1166 #[inline]
1167 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1168 #[inline]
1169 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1170 #[inline]
1171 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1172}
1173pub struct ParenType {
1174 pub(crate) syntax: SyntaxNode,
1175}
1176impl ParenType {
1177 #[inline]
1178 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1179 #[inline]
1180 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1181 #[inline]
1182 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1183}
1184pub struct ParenthesizedArgList {
1185 pub(crate) syntax: SyntaxNode,
1186}
1187impl ParenthesizedArgList {
1188 #[inline]
1189 pub fn type_args(&self) -> AstChildren<TypeArg> { support::children(&self.syntax) }
1190 #[inline]
1191 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1192 #[inline]
1193 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1194 #[inline]
1195 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
1196}
1197pub struct Path {
1198 pub(crate) syntax: SyntaxNode,
1199}
1200impl Path {
1201 #[inline]
1202 pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) }
1203 #[inline]
1204 pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) }
1205 #[inline]
1206 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
1207}
1208pub struct PathExpr {
1209 pub(crate) syntax: SyntaxNode,
1210}
1211impl ast::HasAttrs for PathExpr {}
1212impl PathExpr {
1213 #[inline]
1214 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1215}
1216pub struct PathPat {
1217 pub(crate) syntax: SyntaxNode,
1218}
1219impl PathPat {
1220 #[inline]
1221 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1222}
1223pub struct PathSegment {
1224 pub(crate) syntax: SyntaxNode,
1225}
1226impl ast::HasGenericArgs for PathSegment {}
1227impl PathSegment {
1228 #[inline]
1229 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
1230 #[inline]
1231 pub fn parenthesized_arg_list(&self) -> Option<ParenthesizedArgList> {
1232 support::child(&self.syntax)
1233 }
1234 #[inline]
1235 pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) }
1236 #[inline]
1237 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
1238 #[inline]
1239 pub fn return_type_syntax(&self) -> Option<ReturnTypeSyntax> { support::child(&self.syntax) }
1240 #[inline]
1241 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1242 #[inline]
1243 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
1244 #[inline]
1245 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
1246 #[inline]
1247 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
1248 #[inline]
1249 pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
1250}
1251pub struct PathType {
1252 pub(crate) syntax: SyntaxNode,
1253}
1254impl PathType {
1255 #[inline]
1256 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1257}
1258pub struct PrefixExpr {
1259 pub(crate) syntax: SyntaxNode,
1260}
1261impl ast::HasAttrs for PrefixExpr {}
1262impl PrefixExpr {
1263 #[inline]
1264 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1265}
1266pub struct PtrType {
1267 pub(crate) syntax: SyntaxNode,
1268}
1269impl PtrType {
1270 #[inline]
1271 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1272 #[inline]
1273 pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) }
1274 #[inline]
1275 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
1276 #[inline]
1277 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1278}
1279pub struct RangeExpr {
1280 pub(crate) syntax: SyntaxNode,
1281}
1282impl ast::HasAttrs for RangeExpr {}
1283impl RangeExpr {}
1284pub struct RangePat {
1285 pub(crate) syntax: SyntaxNode,
1286}
1287impl RangePat {}
1288pub struct RecordExpr {
1289 pub(crate) syntax: SyntaxNode,
1290}
1291impl RecordExpr {
1292 #[inline]
1293 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1294 #[inline]
1295 pub fn record_expr_field_list(&self) -> Option<RecordExprFieldList> {
1296 support::child(&self.syntax)
1297 }
1298}
1299pub struct RecordExprField {
1300 pub(crate) syntax: SyntaxNode,
1301}
1302impl ast::HasAttrs for RecordExprField {}
1303impl RecordExprField {
1304 #[inline]
1305 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1306 #[inline]
1307 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
1308 #[inline]
1309 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1310}
1311pub struct RecordExprFieldList {
1312 pub(crate) syntax: SyntaxNode,
1313}
1314impl ast::HasAttrs for RecordExprFieldList {}
1315impl RecordExprFieldList {
1316 #[inline]
1317 pub fn fields(&self) -> AstChildren<RecordExprField> { support::children(&self.syntax) }
1318 #[inline]
1319 pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) }
1320 #[inline]
1321 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1322 #[inline]
1323 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1324 #[inline]
1325 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
1326}
1327pub struct RecordField {
1328 pub(crate) syntax: SyntaxNode,
1329}
1330impl ast::HasAttrs for RecordField {}
1331impl ast::HasDocComments for RecordField {}
1332impl ast::HasName for RecordField {}
1333impl ast::HasVisibility for RecordField {}
1334impl RecordField {
1335 #[inline]
1336 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1337 #[inline]
1338 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1339 #[inline]
1340 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1341 #[inline]
1342 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1343 #[inline]
1344 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
1345}
1346pub struct RecordFieldList {
1347 pub(crate) syntax: SyntaxNode,
1348}
1349impl RecordFieldList {
1350 #[inline]
1351 pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) }
1352 #[inline]
1353 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1354 #[inline]
1355 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1356}
1357pub struct RecordPat {
1358 pub(crate) syntax: SyntaxNode,
1359}
1360impl RecordPat {
1361 #[inline]
1362 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1363 #[inline]
1364 pub fn record_pat_field_list(&self) -> Option<RecordPatFieldList> {
1365 support::child(&self.syntax)
1366 }
1367}
1368pub struct RecordPatField {
1369 pub(crate) syntax: SyntaxNode,
1370}
1371impl ast::HasAttrs for RecordPatField {}
1372impl RecordPatField {
1373 #[inline]
1374 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
1375 #[inline]
1376 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1377 #[inline]
1378 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1379}
1380pub struct RecordPatFieldList {
1381 pub(crate) syntax: SyntaxNode,
1382}
1383impl RecordPatFieldList {
1384 #[inline]
1385 pub fn fields(&self) -> AstChildren<RecordPatField> { support::children(&self.syntax) }
1386 #[inline]
1387 pub fn rest_pat(&self) -> Option<RestPat> { support::child(&self.syntax) }
1388 #[inline]
1389 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1390 #[inline]
1391 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1392}
1393pub struct RefExpr {
1394 pub(crate) syntax: SyntaxNode,
1395}
1396impl ast::HasAttrs for RefExpr {}
1397impl RefExpr {
1398 #[inline]
1399 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1400 #[inline]
1401 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1402 #[inline]
1403 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
1404 #[inline]
1405 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1406 #[inline]
1407 pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) }
1408}
1409pub struct RefPat {
1410 pub(crate) syntax: SyntaxNode,
1411}
1412impl RefPat {
1413 #[inline]
1414 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1415 #[inline]
1416 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1417 #[inline]
1418 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1419}
1420pub struct RefType {
1421 pub(crate) syntax: SyntaxNode,
1422}
1423impl RefType {
1424 #[inline]
1425 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
1426 #[inline]
1427 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1428 #[inline]
1429 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1430 #[inline]
1431 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1432}
1433pub struct Rename {
1434 pub(crate) syntax: SyntaxNode,
1435}
1436impl ast::HasName for Rename {}
1437impl Rename {
1438 #[inline]
1439 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
1440 #[inline]
1441 pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
1442}
1443pub struct RestPat {
1444 pub(crate) syntax: SyntaxNode,
1445}
1446impl ast::HasAttrs for RestPat {}
1447impl RestPat {
1448 #[inline]
1449 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
1450}
1451pub struct RetType {
1452 pub(crate) syntax: SyntaxNode,
1453}
1454impl RetType {
1455 #[inline]
1456 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1457 #[inline]
1458 pub fn thin_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![->]) }
1459}
1460pub struct ReturnExpr {
1461 pub(crate) syntax: SyntaxNode,
1462}
1463impl ast::HasAttrs for ReturnExpr {}
1464impl ReturnExpr {
1465 #[inline]
1466 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1467 #[inline]
1468 pub fn return_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![return]) }
1469}
1470pub struct ReturnTypeSyntax {
1471 pub(crate) syntax: SyntaxNode,
1472}
1473impl ReturnTypeSyntax {
1474 #[inline]
1475 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1476 #[inline]
1477 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1478 #[inline]
1479 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
1480}
1481pub struct SelfParam {
1482 pub(crate) syntax: SyntaxNode,
1483}
1484impl ast::HasAttrs for SelfParam {}
1485impl ast::HasName for SelfParam {}
1486impl SelfParam {
1487 #[inline]
1488 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
1489 #[inline]
1490 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1491 #[inline]
1492 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1493 #[inline]
1494 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1495 #[inline]
1496 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1497}
1498pub struct SlicePat {
1499 pub(crate) syntax: SyntaxNode,
1500}
1501impl SlicePat {
1502 #[inline]
1503 pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
1504 #[inline]
1505 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
1506 #[inline]
1507 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
1508}
1509pub struct SliceType {
1510 pub(crate) syntax: SyntaxNode,
1511}
1512impl SliceType {
1513 #[inline]
1514 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1515 #[inline]
1516 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
1517 #[inline]
1518 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
1519}
1520pub struct SourceFile {
1521 pub(crate) syntax: SyntaxNode,
1522}
1523impl ast::HasAttrs for SourceFile {}
1524impl ast::HasDocComments for SourceFile {}
1525impl ast::HasModuleItem for SourceFile {}
1526impl SourceFile {
1527 #[inline]
1528 pub fn frontmatter_token(&self) -> Option<SyntaxToken> {
1529 support::token(&self.syntax, T![frontmatter])
1530 }
1531 #[inline]
1532 pub fn shebang_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![shebang]) }
1533}
1534pub struct Static {
1535 pub(crate) syntax: SyntaxNode,
1536}
1537impl ast::HasAttrs for Static {}
1538impl ast::HasDocComments for Static {}
1539impl ast::HasName for Static {}
1540impl ast::HasVisibility for Static {}
1541impl Static {
1542 #[inline]
1543 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1544 #[inline]
1545 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
1546 #[inline]
1547 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1548 #[inline]
1549 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1550 #[inline]
1551 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1552 #[inline]
1553 pub fn safe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![safe]) }
1554 #[inline]
1555 pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
1556 #[inline]
1557 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
1558}
1559pub struct StmtList {
1560 pub(crate) syntax: SyntaxNode,
1561}
1562impl ast::HasAttrs for StmtList {}
1563impl StmtList {
1564 #[inline]
1565 pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
1566 #[inline]
1567 pub fn tail_expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1568 #[inline]
1569 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1570 #[inline]
1571 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1572}
1573pub struct Struct {
1574 pub(crate) syntax: SyntaxNode,
1575}
1576impl ast::HasAttrs for Struct {}
1577impl ast::HasDocComments for Struct {}
1578impl ast::HasGenericParams for Struct {}
1579impl ast::HasName for Struct {}
1580impl ast::HasVisibility for Struct {}
1581impl Struct {
1582 #[inline]
1583 pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) }
1584 #[inline]
1585 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1586 #[inline]
1587 pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) }
1588}
1589pub struct TokenTree {
1590 pub(crate) syntax: SyntaxNode,
1591}
1592impl TokenTree {
1593 #[inline]
1594 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1595 #[inline]
1596 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1597 #[inline]
1598 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
1599 #[inline]
1600 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
1601 #[inline]
1602 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1603 #[inline]
1604 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1605}
1606pub struct Trait {
1607 pub(crate) syntax: SyntaxNode,
1608}
1609impl ast::HasAttrs for Trait {}
1610impl ast::HasDocComments for Trait {}
1611impl ast::HasGenericParams for Trait {}
1612impl ast::HasName for Trait {}
1613impl ast::HasTypeBounds for Trait {}
1614impl ast::HasVisibility for Trait {}
1615impl Trait {
1616 #[inline]
1617 pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
1618 #[inline]
1619 pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) }
1620 #[inline]
1621 pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) }
1622 #[inline]
1623 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
1624}
1625pub struct TraitAlias {
1626 pub(crate) syntax: SyntaxNode,
1627}
1628impl ast::HasAttrs for TraitAlias {}
1629impl ast::HasDocComments for TraitAlias {}
1630impl ast::HasGenericParams for TraitAlias {}
1631impl ast::HasName for TraitAlias {}
1632impl ast::HasVisibility for TraitAlias {}
1633impl TraitAlias {
1634 #[inline]
1635 pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
1636 #[inline]
1637 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1638 #[inline]
1639 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1640 #[inline]
1641 pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) }
1642}
1643pub struct TryExpr {
1644 pub(crate) syntax: SyntaxNode,
1645}
1646impl ast::HasAttrs for TryExpr {}
1647impl TryExpr {
1648 #[inline]
1649 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1650 #[inline]
1651 pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
1652}
1653pub struct TupleExpr {
1654 pub(crate) syntax: SyntaxNode,
1655}
1656impl ast::HasAttrs for TupleExpr {}
1657impl TupleExpr {
1658 #[inline]
1659 pub fn fields(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
1660 #[inline]
1661 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1662 #[inline]
1663 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1664}
1665pub struct TupleField {
1666 pub(crate) syntax: SyntaxNode,
1667}
1668impl ast::HasAttrs for TupleField {}
1669impl ast::HasDocComments for TupleField {}
1670impl ast::HasVisibility for TupleField {}
1671impl TupleField {
1672 #[inline]
1673 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1674}
1675pub struct TupleFieldList {
1676 pub(crate) syntax: SyntaxNode,
1677}
1678impl TupleFieldList {
1679 #[inline]
1680 pub fn fields(&self) -> AstChildren<TupleField> { support::children(&self.syntax) }
1681 #[inline]
1682 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1683 #[inline]
1684 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1685}
1686pub struct TuplePat {
1687 pub(crate) syntax: SyntaxNode,
1688}
1689impl TuplePat {
1690 #[inline]
1691 pub fn fields(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
1692 #[inline]
1693 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1694 #[inline]
1695 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1696}
1697pub struct TupleStructPat {
1698 pub(crate) syntax: SyntaxNode,
1699}
1700impl TupleStructPat {
1701 #[inline]
1702 pub fn fields(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
1703 #[inline]
1704 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1705 #[inline]
1706 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1707 #[inline]
1708 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1709}
1710pub struct TupleType {
1711 pub(crate) syntax: SyntaxNode,
1712}
1713impl TupleType {
1714 #[inline]
1715 pub fn fields(&self) -> AstChildren<Type> { support::children(&self.syntax) }
1716 #[inline]
1717 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1718 #[inline]
1719 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1720}
1721pub struct TypeAlias {
1722 pub(crate) syntax: SyntaxNode,
1723}
1724impl ast::HasAttrs for TypeAlias {}
1725impl ast::HasDocComments for TypeAlias {}
1726impl ast::HasGenericParams for TypeAlias {}
1727impl ast::HasName for TypeAlias {}
1728impl ast::HasTypeBounds for TypeAlias {}
1729impl ast::HasVisibility for TypeAlias {}
1730impl TypeAlias {
1731 #[inline]
1732 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1733 #[inline]
1734 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1735 #[inline]
1736 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1737 #[inline]
1738 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
1739 #[inline]
1740 pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) }
1741}
1742pub struct TypeArg {
1743 pub(crate) syntax: SyntaxNode,
1744}
1745impl TypeArg {
1746 #[inline]
1747 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1748}
1749pub struct TypeBound {
1750 pub(crate) syntax: SyntaxNode,
1751}
1752impl TypeBound {
1753 #[inline]
1754 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
1755 #[inline]
1756 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1757 #[inline]
1758 pub fn use_bound_generic_args(&self) -> Option<UseBoundGenericArgs> {
1759 support::child(&self.syntax)
1760 }
1761 #[inline]
1762 pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
1763 #[inline]
1764 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
1765 #[inline]
1766 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
1767 #[inline]
1768 pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
1769 #[inline]
1770 pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) }
1771}
1772pub struct TypeBoundList {
1773 pub(crate) syntax: SyntaxNode,
1774}
1775impl TypeBoundList {
1776 #[inline]
1777 pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) }
1778}
1779pub struct TypeParam {
1780 pub(crate) syntax: SyntaxNode,
1781}
1782impl ast::HasAttrs for TypeParam {}
1783impl ast::HasName for TypeParam {}
1784impl ast::HasTypeBounds for TypeParam {}
1785impl TypeParam {
1786 #[inline]
1787 pub fn default_type(&self) -> Option<Type> { support::child(&self.syntax) }
1788 #[inline]
1789 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1790}
1791pub struct UnderscoreExpr {
1792 pub(crate) syntax: SyntaxNode,
1793}
1794impl ast::HasAttrs for UnderscoreExpr {}
1795impl UnderscoreExpr {
1796 #[inline]
1797 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
1798}
1799pub struct Union {
1800 pub(crate) syntax: SyntaxNode,
1801}
1802impl ast::HasAttrs for Union {}
1803impl ast::HasDocComments for Union {}
1804impl ast::HasGenericParams for Union {}
1805impl ast::HasName for Union {}
1806impl ast::HasVisibility for Union {}
1807impl Union {
1808 #[inline]
1809 pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) }
1810 #[inline]
1811 pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) }
1812}
1813pub struct Use {
1814 pub(crate) syntax: SyntaxNode,
1815}
1816impl ast::HasAttrs for Use {}
1817impl ast::HasDocComments for Use {}
1818impl ast::HasVisibility for Use {}
1819impl Use {
1820 #[inline]
1821 pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) }
1822 #[inline]
1823 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
1824 #[inline]
1825 pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
1826}
1827pub struct UseBoundGenericArgs {
1828 pub(crate) syntax: SyntaxNode,
1829}
1830impl UseBoundGenericArgs {
1831 #[inline]
1832 pub fn use_bound_generic_args(&self) -> AstChildren<UseBoundGenericArg> {
1833 support::children(&self.syntax)
1834 }
1835 #[inline]
1836 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
1837 #[inline]
1838 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
1839}
1840pub struct UseTree {
1841 pub(crate) syntax: SyntaxNode,
1842}
1843impl UseTree {
1844 #[inline]
1845 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1846 #[inline]
1847 pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) }
1848 #[inline]
1849 pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) }
1850 #[inline]
1851 pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) }
1852 #[inline]
1853 pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
1854}
1855pub struct UseTreeList {
1856 pub(crate) syntax: SyntaxNode,
1857}
1858impl UseTreeList {
1859 #[inline]
1860 pub fn use_trees(&self) -> AstChildren<UseTree> { support::children(&self.syntax) }
1861 #[inline]
1862 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1863 #[inline]
1864 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1865}
1866pub struct Variant {
1867 pub(crate) syntax: SyntaxNode,
1868}
1869impl ast::HasAttrs for Variant {}
1870impl ast::HasDocComments for Variant {}
1871impl ast::HasName for Variant {}
1872impl ast::HasVisibility for Variant {}
1873impl Variant {
1874 #[inline]
1875 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1876 #[inline]
1877 pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) }
1878 #[inline]
1879 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
1880}
1881pub struct VariantList {
1882 pub(crate) syntax: SyntaxNode,
1883}
1884impl VariantList {
1885 #[inline]
1886 pub fn variants(&self) -> AstChildren<Variant> { support::children(&self.syntax) }
1887 #[inline]
1888 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1889 #[inline]
1890 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1891}
1892pub struct Visibility {
1893 pub(crate) syntax: SyntaxNode,
1894}
1895impl Visibility {
1896 #[inline]
1897 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1898 #[inline]
1899 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1900 #[inline]
1901 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1902 #[inline]
1903 pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
1904 #[inline]
1905 pub fn pub_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![pub]) }
1906}
1907pub struct WhereClause {
1908 pub(crate) syntax: SyntaxNode,
1909}
1910impl WhereClause {
1911 #[inline]
1912 pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) }
1913 #[inline]
1914 pub fn where_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![where]) }
1915}
1916pub struct WherePred {
1917 pub(crate) syntax: SyntaxNode,
1918}
1919impl ast::HasTypeBounds for WherePred {}
1920impl WherePred {
1921 #[inline]
1922 pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
1923 #[inline]
1924 pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
1925 #[inline]
1926 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1927 #[inline]
1928 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
1929}
1930pub struct WhileExpr {
1931 pub(crate) syntax: SyntaxNode,
1932}
1933impl ast::HasAttrs for WhileExpr {}
1934impl WhileExpr {
1935 #[inline]
1936 pub fn while_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![while]) }
1937}
1938pub struct WildcardPat {
1939 pub(crate) syntax: SyntaxNode,
1940}
1941impl WildcardPat {
1942 #[inline]
1943 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
1944}
1945pub struct YeetExpr {
1946 pub(crate) syntax: SyntaxNode,
1947}
1948impl ast::HasAttrs for YeetExpr {}
1949impl YeetExpr {
1950 #[inline]
1951 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1952 #[inline]
1953 pub fn do_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![do]) }
1954 #[inline]
1955 pub fn yeet_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![yeet]) }
1956}
1957pub struct YieldExpr {
1958 pub(crate) syntax: SyntaxNode,
1959}
1960impl ast::HasAttrs for YieldExpr {}
1961impl YieldExpr {
1962 #[inline]
1963 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1964 #[inline]
1965 pub fn yield_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![yield]) }
1966}
1967
1968#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1969pub enum Adt {
1970 Enum(Enum),
1971 Struct(Struct),
1972 Union(Union),
1973}
1974impl ast::HasAttrs for Adt {}
1975impl ast::HasDocComments for Adt {}
1976impl ast::HasGenericParams for Adt {}
1977impl ast::HasName for Adt {}
1978impl ast::HasVisibility for Adt {}
1979
1980#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1981pub enum AsmOperand {
1982 AsmConst(AsmConst),
1983 AsmLabel(AsmLabel),
1984 AsmRegOperand(AsmRegOperand),
1985 AsmSym(AsmSym),
1986}
1987
1988#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1989pub enum AsmPiece {
1990 AsmClobberAbi(AsmClobberAbi),
1991 AsmOperandNamed(AsmOperandNamed),
1992 AsmOptions(AsmOptions),
1993}
1994
1995#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1996pub enum AssocItem {
1997 Const(Const),
1998 Fn(Fn),
1999 MacroCall(MacroCall),
2000 TypeAlias(TypeAlias),
2001}
2002impl ast::HasAttrs for AssocItem {}
2003impl ast::HasDocComments for AssocItem {}
2004
2005#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2006pub enum Expr {
2007 ArrayExpr(ArrayExpr),
2008 AsmExpr(AsmExpr),
2009 AwaitExpr(AwaitExpr),
2010 BecomeExpr(BecomeExpr),
2011 BinExpr(BinExpr),
2012 BlockExpr(BlockExpr),
2013 BreakExpr(BreakExpr),
2014 CallExpr(CallExpr),
2015 CastExpr(CastExpr),
2016 ClosureExpr(ClosureExpr),
2017 ContinueExpr(ContinueExpr),
2018 FieldExpr(FieldExpr),
2019 ForExpr(ForExpr),
2020 FormatArgsExpr(FormatArgsExpr),
2021 IfExpr(IfExpr),
2022 IndexExpr(IndexExpr),
2023 LetExpr(LetExpr),
2024 Literal(Literal),
2025 LoopExpr(LoopExpr),
2026 MacroExpr(MacroExpr),
2027 MatchExpr(MatchExpr),
2028 MethodCallExpr(MethodCallExpr),
2029 OffsetOfExpr(OffsetOfExpr),
2030 ParenExpr(ParenExpr),
2031 PathExpr(PathExpr),
2032 PrefixExpr(PrefixExpr),
2033 RangeExpr(RangeExpr),
2034 RecordExpr(RecordExpr),
2035 RefExpr(RefExpr),
2036 ReturnExpr(ReturnExpr),
2037 TryExpr(TryExpr),
2038 TupleExpr(TupleExpr),
2039 UnderscoreExpr(UnderscoreExpr),
2040 WhileExpr(WhileExpr),
2041 YeetExpr(YeetExpr),
2042 YieldExpr(YieldExpr),
2043}
2044
2045#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2046pub enum ExternItem {
2047 Fn(Fn),
2048 MacroCall(MacroCall),
2049 Static(Static),
2050 TypeAlias(TypeAlias),
2051}
2052impl ast::HasAttrs for ExternItem {}
2053impl ast::HasDocComments for ExternItem {}
2054
2055#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2056pub enum FieldList {
2057 RecordFieldList(RecordFieldList),
2058 TupleFieldList(TupleFieldList),
2059}
2060
2061#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2062pub enum GenericArg {
2063 AssocTypeArg(AssocTypeArg),
2064 ConstArg(ConstArg),
2065 LifetimeArg(LifetimeArg),
2066 TypeArg(TypeArg),
2067}
2068
2069#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2070pub enum GenericParam {
2071 ConstParam(ConstParam),
2072 LifetimeParam(LifetimeParam),
2073 TypeParam(TypeParam),
2074}
2075impl ast::HasAttrs for GenericParam {}
2076
2077#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2078pub enum Item {
2079 Const(Const),
2080 Enum(Enum),
2081 ExternBlock(ExternBlock),
2082 ExternCrate(ExternCrate),
2083 Fn(Fn),
2084 Impl(Impl),
2085 MacroCall(MacroCall),
2086 MacroDef(MacroDef),
2087 MacroRules(MacroRules),
2088 Module(Module),
2089 Static(Static),
2090 Struct(Struct),
2091 Trait(Trait),
2092 TraitAlias(TraitAlias),
2093 TypeAlias(TypeAlias),
2094 Union(Union),
2095 Use(Use),
2096}
2097impl ast::HasAttrs for Item {}
2098impl ast::HasDocComments for Item {}
2099
2100#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2101pub enum Pat {
2102 BoxPat(BoxPat),
2103 ConstBlockPat(ConstBlockPat),
2104 IdentPat(IdentPat),
2105 LiteralPat(LiteralPat),
2106 MacroPat(MacroPat),
2107 OrPat(OrPat),
2108 ParenPat(ParenPat),
2109 PathPat(PathPat),
2110 RangePat(RangePat),
2111 RecordPat(RecordPat),
2112 RefPat(RefPat),
2113 RestPat(RestPat),
2114 SlicePat(SlicePat),
2115 TuplePat(TuplePat),
2116 TupleStructPat(TupleStructPat),
2117 WildcardPat(WildcardPat),
2118}
2119
2120#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2121pub enum Stmt {
2122 ExprStmt(ExprStmt),
2123 Item(Item),
2124 LetStmt(LetStmt),
2125}
2126
2127#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2128pub enum Type {
2129 ArrayType(ArrayType),
2130 DynTraitType(DynTraitType),
2131 FnPtrType(FnPtrType),
2132 ForType(ForType),
2133 ImplTraitType(ImplTraitType),
2134 InferType(InferType),
2135 MacroType(MacroType),
2136 NeverType(NeverType),
2137 ParenType(ParenType),
2138 PathType(PathType),
2139 PtrType(PtrType),
2140 RefType(RefType),
2141 SliceType(SliceType),
2142 TupleType(TupleType),
2143}
2144
2145#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2146pub enum UseBoundGenericArg {
2147 Lifetime(Lifetime),
2148 NameRef(NameRef),
2149}
2150
2151#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2152pub enum VariantDef {
2153 Struct(Struct),
2154 Union(Union),
2155 Variant(Variant),
2156}
2157impl ast::HasAttrs for VariantDef {}
2158impl ast::HasDocComments for VariantDef {}
2159impl ast::HasName for VariantDef {}
2160impl ast::HasVisibility for VariantDef {}
2161pub struct AnyHasArgList {
2162 pub(crate) syntax: SyntaxNode,
2163}
2164impl AnyHasArgList {
2165 #[inline]
2166 pub fn new<T: ast::HasArgList>(node: T) -> AnyHasArgList {
2167 AnyHasArgList { syntax: node.syntax().clone() }
2168 }
2169}
2170pub struct AnyHasAttrs {
2171 pub(crate) syntax: SyntaxNode,
2172}
2173impl AnyHasAttrs {
2174 #[inline]
2175 pub fn new<T: ast::HasAttrs>(node: T) -> AnyHasAttrs {
2176 AnyHasAttrs { syntax: node.syntax().clone() }
2177 }
2178}
2179pub struct AnyHasDocComments {
2180 pub(crate) syntax: SyntaxNode,
2181}
2182impl AnyHasDocComments {
2183 #[inline]
2184 pub fn new<T: ast::HasDocComments>(node: T) -> AnyHasDocComments {
2185 AnyHasDocComments { syntax: node.syntax().clone() }
2186 }
2187}
2188pub struct AnyHasGenericArgs {
2189 pub(crate) syntax: SyntaxNode,
2190}
2191impl AnyHasGenericArgs {
2192 #[inline]
2193 pub fn new<T: ast::HasGenericArgs>(node: T) -> AnyHasGenericArgs {
2194 AnyHasGenericArgs { syntax: node.syntax().clone() }
2195 }
2196}
2197pub struct AnyHasGenericParams {
2198 pub(crate) syntax: SyntaxNode,
2199}
2200impl AnyHasGenericParams {
2201 #[inline]
2202 pub fn new<T: ast::HasGenericParams>(node: T) -> AnyHasGenericParams {
2203 AnyHasGenericParams { syntax: node.syntax().clone() }
2204 }
2205}
2206pub struct AnyHasLoopBody {
2207 pub(crate) syntax: SyntaxNode,
2208}
2209impl AnyHasLoopBody {
2210 #[inline]
2211 pub fn new<T: ast::HasLoopBody>(node: T) -> AnyHasLoopBody {
2212 AnyHasLoopBody { syntax: node.syntax().clone() }
2213 }
2214}
2215pub struct AnyHasModuleItem {
2216 pub(crate) syntax: SyntaxNode,
2217}
2218impl AnyHasModuleItem {
2219 #[inline]
2220 pub fn new<T: ast::HasModuleItem>(node: T) -> AnyHasModuleItem {
2221 AnyHasModuleItem { syntax: node.syntax().clone() }
2222 }
2223}
2224pub struct AnyHasName {
2225 pub(crate) syntax: SyntaxNode,
2226}
2227impl AnyHasName {
2228 #[inline]
2229 pub fn new<T: ast::HasName>(node: T) -> AnyHasName {
2230 AnyHasName { syntax: node.syntax().clone() }
2231 }
2232}
2233pub struct AnyHasTypeBounds {
2234 pub(crate) syntax: SyntaxNode,
2235}
2236impl AnyHasTypeBounds {
2237 #[inline]
2238 pub fn new<T: ast::HasTypeBounds>(node: T) -> AnyHasTypeBounds {
2239 AnyHasTypeBounds { syntax: node.syntax().clone() }
2240 }
2241}
2242pub struct AnyHasVisibility {
2243 pub(crate) syntax: SyntaxNode,
2244}
2245impl AnyHasVisibility {
2246 #[inline]
2247 pub fn new<T: ast::HasVisibility>(node: T) -> AnyHasVisibility {
2248 AnyHasVisibility { syntax: node.syntax().clone() }
2249 }
2250}
2251impl AstNode for Abi {
2252 #[inline]
2253 fn kind() -> SyntaxKind
2254 where
2255 Self: Sized,
2256 {
2257 ABI
2258 }
2259 #[inline]
2260 fn can_cast(kind: SyntaxKind) -> bool { kind == ABI }
2261 #[inline]
2262 fn cast(syntax: SyntaxNode) -> Option<Self> {
2263 if Self::can_cast(syntax.kind()) {
2264 Some(Self { syntax })
2265 } else {
2266 None
2267 }
2268 }
2269 #[inline]
2270 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2271}
2272impl hash::Hash for Abi {
2273 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2274}
2275impl Eq for Abi {}
2276impl PartialEq for Abi {
2277 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2278}
2279impl Clone for Abi {
2280 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2281}
2282impl fmt::Debug for Abi {
2283 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2284 f.debug_struct("Abi").field("syntax", &self.syntax).finish()
2285 }
2286}
2287impl AstNode for ArgList {
2288 #[inline]
2289 fn kind() -> SyntaxKind
2290 where
2291 Self: Sized,
2292 {
2293 ARG_LIST
2294 }
2295 #[inline]
2296 fn can_cast(kind: SyntaxKind) -> bool { kind == ARG_LIST }
2297 #[inline]
2298 fn cast(syntax: SyntaxNode) -> Option<Self> {
2299 if Self::can_cast(syntax.kind()) {
2300 Some(Self { syntax })
2301 } else {
2302 None
2303 }
2304 }
2305 #[inline]
2306 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2307}
2308impl hash::Hash for ArgList {
2309 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2310}
2311impl Eq for ArgList {}
2312impl PartialEq for ArgList {
2313 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2314}
2315impl Clone for ArgList {
2316 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2317}
2318impl fmt::Debug for ArgList {
2319 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2320 f.debug_struct("ArgList").field("syntax", &self.syntax).finish()
2321 }
2322}
2323impl AstNode for ArrayExpr {
2324 #[inline]
2325 fn kind() -> SyntaxKind
2326 where
2327 Self: Sized,
2328 {
2329 ARRAY_EXPR
2330 }
2331 #[inline]
2332 fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_EXPR }
2333 #[inline]
2334 fn cast(syntax: SyntaxNode) -> Option<Self> {
2335 if Self::can_cast(syntax.kind()) {
2336 Some(Self { syntax })
2337 } else {
2338 None
2339 }
2340 }
2341 #[inline]
2342 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2343}
2344impl hash::Hash for ArrayExpr {
2345 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2346}
2347impl Eq for ArrayExpr {}
2348impl PartialEq for ArrayExpr {
2349 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2350}
2351impl Clone for ArrayExpr {
2352 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2353}
2354impl fmt::Debug for ArrayExpr {
2355 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2356 f.debug_struct("ArrayExpr").field("syntax", &self.syntax).finish()
2357 }
2358}
2359impl AstNode for ArrayType {
2360 #[inline]
2361 fn kind() -> SyntaxKind
2362 where
2363 Self: Sized,
2364 {
2365 ARRAY_TYPE
2366 }
2367 #[inline]
2368 fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_TYPE }
2369 #[inline]
2370 fn cast(syntax: SyntaxNode) -> Option<Self> {
2371 if Self::can_cast(syntax.kind()) {
2372 Some(Self { syntax })
2373 } else {
2374 None
2375 }
2376 }
2377 #[inline]
2378 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2379}
2380impl hash::Hash for ArrayType {
2381 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2382}
2383impl Eq for ArrayType {}
2384impl PartialEq for ArrayType {
2385 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2386}
2387impl Clone for ArrayType {
2388 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2389}
2390impl fmt::Debug for ArrayType {
2391 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2392 f.debug_struct("ArrayType").field("syntax", &self.syntax).finish()
2393 }
2394}
2395impl AstNode for AsmClobberAbi {
2396 #[inline]
2397 fn kind() -> SyntaxKind
2398 where
2399 Self: Sized,
2400 {
2401 ASM_CLOBBER_ABI
2402 }
2403 #[inline]
2404 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_CLOBBER_ABI }
2405 #[inline]
2406 fn cast(syntax: SyntaxNode) -> Option<Self> {
2407 if Self::can_cast(syntax.kind()) {
2408 Some(Self { syntax })
2409 } else {
2410 None
2411 }
2412 }
2413 #[inline]
2414 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2415}
2416impl hash::Hash for AsmClobberAbi {
2417 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2418}
2419impl Eq for AsmClobberAbi {}
2420impl PartialEq for AsmClobberAbi {
2421 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2422}
2423impl Clone for AsmClobberAbi {
2424 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2425}
2426impl fmt::Debug for AsmClobberAbi {
2427 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2428 f.debug_struct("AsmClobberAbi").field("syntax", &self.syntax).finish()
2429 }
2430}
2431impl AstNode for AsmConst {
2432 #[inline]
2433 fn kind() -> SyntaxKind
2434 where
2435 Self: Sized,
2436 {
2437 ASM_CONST
2438 }
2439 #[inline]
2440 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_CONST }
2441 #[inline]
2442 fn cast(syntax: SyntaxNode) -> Option<Self> {
2443 if Self::can_cast(syntax.kind()) {
2444 Some(Self { syntax })
2445 } else {
2446 None
2447 }
2448 }
2449 #[inline]
2450 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2451}
2452impl hash::Hash for AsmConst {
2453 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2454}
2455impl Eq for AsmConst {}
2456impl PartialEq for AsmConst {
2457 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2458}
2459impl Clone for AsmConst {
2460 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2461}
2462impl fmt::Debug for AsmConst {
2463 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2464 f.debug_struct("AsmConst").field("syntax", &self.syntax).finish()
2465 }
2466}
2467impl AstNode for AsmDirSpec {
2468 #[inline]
2469 fn kind() -> SyntaxKind
2470 where
2471 Self: Sized,
2472 {
2473 ASM_DIR_SPEC
2474 }
2475 #[inline]
2476 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_DIR_SPEC }
2477 #[inline]
2478 fn cast(syntax: SyntaxNode) -> Option<Self> {
2479 if Self::can_cast(syntax.kind()) {
2480 Some(Self { syntax })
2481 } else {
2482 None
2483 }
2484 }
2485 #[inline]
2486 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2487}
2488impl hash::Hash for AsmDirSpec {
2489 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2490}
2491impl Eq for AsmDirSpec {}
2492impl PartialEq for AsmDirSpec {
2493 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2494}
2495impl Clone for AsmDirSpec {
2496 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2497}
2498impl fmt::Debug for AsmDirSpec {
2499 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2500 f.debug_struct("AsmDirSpec").field("syntax", &self.syntax).finish()
2501 }
2502}
2503impl AstNode for AsmExpr {
2504 #[inline]
2505 fn kind() -> SyntaxKind
2506 where
2507 Self: Sized,
2508 {
2509 ASM_EXPR
2510 }
2511 #[inline]
2512 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_EXPR }
2513 #[inline]
2514 fn cast(syntax: SyntaxNode) -> Option<Self> {
2515 if Self::can_cast(syntax.kind()) {
2516 Some(Self { syntax })
2517 } else {
2518 None
2519 }
2520 }
2521 #[inline]
2522 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2523}
2524impl hash::Hash for AsmExpr {
2525 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2526}
2527impl Eq for AsmExpr {}
2528impl PartialEq for AsmExpr {
2529 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2530}
2531impl Clone for AsmExpr {
2532 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2533}
2534impl fmt::Debug for AsmExpr {
2535 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2536 f.debug_struct("AsmExpr").field("syntax", &self.syntax).finish()
2537 }
2538}
2539impl AstNode for AsmLabel {
2540 #[inline]
2541 fn kind() -> SyntaxKind
2542 where
2543 Self: Sized,
2544 {
2545 ASM_LABEL
2546 }
2547 #[inline]
2548 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_LABEL }
2549 #[inline]
2550 fn cast(syntax: SyntaxNode) -> Option<Self> {
2551 if Self::can_cast(syntax.kind()) {
2552 Some(Self { syntax })
2553 } else {
2554 None
2555 }
2556 }
2557 #[inline]
2558 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2559}
2560impl hash::Hash for AsmLabel {
2561 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2562}
2563impl Eq for AsmLabel {}
2564impl PartialEq for AsmLabel {
2565 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2566}
2567impl Clone for AsmLabel {
2568 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2569}
2570impl fmt::Debug for AsmLabel {
2571 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2572 f.debug_struct("AsmLabel").field("syntax", &self.syntax).finish()
2573 }
2574}
2575impl AstNode for AsmOperandExpr {
2576 #[inline]
2577 fn kind() -> SyntaxKind
2578 where
2579 Self: Sized,
2580 {
2581 ASM_OPERAND_EXPR
2582 }
2583 #[inline]
2584 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPERAND_EXPR }
2585 #[inline]
2586 fn cast(syntax: SyntaxNode) -> Option<Self> {
2587 if Self::can_cast(syntax.kind()) {
2588 Some(Self { syntax })
2589 } else {
2590 None
2591 }
2592 }
2593 #[inline]
2594 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2595}
2596impl hash::Hash for AsmOperandExpr {
2597 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2598}
2599impl Eq for AsmOperandExpr {}
2600impl PartialEq for AsmOperandExpr {
2601 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2602}
2603impl Clone for AsmOperandExpr {
2604 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2605}
2606impl fmt::Debug for AsmOperandExpr {
2607 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2608 f.debug_struct("AsmOperandExpr").field("syntax", &self.syntax).finish()
2609 }
2610}
2611impl AstNode for AsmOperandNamed {
2612 #[inline]
2613 fn kind() -> SyntaxKind
2614 where
2615 Self: Sized,
2616 {
2617 ASM_OPERAND_NAMED
2618 }
2619 #[inline]
2620 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPERAND_NAMED }
2621 #[inline]
2622 fn cast(syntax: SyntaxNode) -> Option<Self> {
2623 if Self::can_cast(syntax.kind()) {
2624 Some(Self { syntax })
2625 } else {
2626 None
2627 }
2628 }
2629 #[inline]
2630 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2631}
2632impl hash::Hash for AsmOperandNamed {
2633 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2634}
2635impl Eq for AsmOperandNamed {}
2636impl PartialEq for AsmOperandNamed {
2637 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2638}
2639impl Clone for AsmOperandNamed {
2640 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2641}
2642impl fmt::Debug for AsmOperandNamed {
2643 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2644 f.debug_struct("AsmOperandNamed").field("syntax", &self.syntax).finish()
2645 }
2646}
2647impl AstNode for AsmOption {
2648 #[inline]
2649 fn kind() -> SyntaxKind
2650 where
2651 Self: Sized,
2652 {
2653 ASM_OPTION
2654 }
2655 #[inline]
2656 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPTION }
2657 #[inline]
2658 fn cast(syntax: SyntaxNode) -> Option<Self> {
2659 if Self::can_cast(syntax.kind()) {
2660 Some(Self { syntax })
2661 } else {
2662 None
2663 }
2664 }
2665 #[inline]
2666 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2667}
2668impl hash::Hash for AsmOption {
2669 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2670}
2671impl Eq for AsmOption {}
2672impl PartialEq for AsmOption {
2673 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2674}
2675impl Clone for AsmOption {
2676 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2677}
2678impl fmt::Debug for AsmOption {
2679 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2680 f.debug_struct("AsmOption").field("syntax", &self.syntax).finish()
2681 }
2682}
2683impl AstNode for AsmOptions {
2684 #[inline]
2685 fn kind() -> SyntaxKind
2686 where
2687 Self: Sized,
2688 {
2689 ASM_OPTIONS
2690 }
2691 #[inline]
2692 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_OPTIONS }
2693 #[inline]
2694 fn cast(syntax: SyntaxNode) -> Option<Self> {
2695 if Self::can_cast(syntax.kind()) {
2696 Some(Self { syntax })
2697 } else {
2698 None
2699 }
2700 }
2701 #[inline]
2702 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2703}
2704impl hash::Hash for AsmOptions {
2705 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2706}
2707impl Eq for AsmOptions {}
2708impl PartialEq for AsmOptions {
2709 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2710}
2711impl Clone for AsmOptions {
2712 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2713}
2714impl fmt::Debug for AsmOptions {
2715 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2716 f.debug_struct("AsmOptions").field("syntax", &self.syntax).finish()
2717 }
2718}
2719impl AstNode for AsmRegOperand {
2720 #[inline]
2721 fn kind() -> SyntaxKind
2722 where
2723 Self: Sized,
2724 {
2725 ASM_REG_OPERAND
2726 }
2727 #[inline]
2728 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_REG_OPERAND }
2729 #[inline]
2730 fn cast(syntax: SyntaxNode) -> Option<Self> {
2731 if Self::can_cast(syntax.kind()) {
2732 Some(Self { syntax })
2733 } else {
2734 None
2735 }
2736 }
2737 #[inline]
2738 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2739}
2740impl hash::Hash for AsmRegOperand {
2741 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2742}
2743impl Eq for AsmRegOperand {}
2744impl PartialEq for AsmRegOperand {
2745 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2746}
2747impl Clone for AsmRegOperand {
2748 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2749}
2750impl fmt::Debug for AsmRegOperand {
2751 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2752 f.debug_struct("AsmRegOperand").field("syntax", &self.syntax).finish()
2753 }
2754}
2755impl AstNode for AsmRegSpec {
2756 #[inline]
2757 fn kind() -> SyntaxKind
2758 where
2759 Self: Sized,
2760 {
2761 ASM_REG_SPEC
2762 }
2763 #[inline]
2764 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_REG_SPEC }
2765 #[inline]
2766 fn cast(syntax: SyntaxNode) -> Option<Self> {
2767 if Self::can_cast(syntax.kind()) {
2768 Some(Self { syntax })
2769 } else {
2770 None
2771 }
2772 }
2773 #[inline]
2774 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2775}
2776impl hash::Hash for AsmRegSpec {
2777 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2778}
2779impl Eq for AsmRegSpec {}
2780impl PartialEq for AsmRegSpec {
2781 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2782}
2783impl Clone for AsmRegSpec {
2784 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2785}
2786impl fmt::Debug for AsmRegSpec {
2787 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2788 f.debug_struct("AsmRegSpec").field("syntax", &self.syntax).finish()
2789 }
2790}
2791impl AstNode for AsmSym {
2792 #[inline]
2793 fn kind() -> SyntaxKind
2794 where
2795 Self: Sized,
2796 {
2797 ASM_SYM
2798 }
2799 #[inline]
2800 fn can_cast(kind: SyntaxKind) -> bool { kind == ASM_SYM }
2801 #[inline]
2802 fn cast(syntax: SyntaxNode) -> Option<Self> {
2803 if Self::can_cast(syntax.kind()) {
2804 Some(Self { syntax })
2805 } else {
2806 None
2807 }
2808 }
2809 #[inline]
2810 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2811}
2812impl hash::Hash for AsmSym {
2813 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2814}
2815impl Eq for AsmSym {}
2816impl PartialEq for AsmSym {
2817 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2818}
2819impl Clone for AsmSym {
2820 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2821}
2822impl fmt::Debug for AsmSym {
2823 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2824 f.debug_struct("AsmSym").field("syntax", &self.syntax).finish()
2825 }
2826}
2827impl AstNode for AssocItemList {
2828 #[inline]
2829 fn kind() -> SyntaxKind
2830 where
2831 Self: Sized,
2832 {
2833 ASSOC_ITEM_LIST
2834 }
2835 #[inline]
2836 fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_ITEM_LIST }
2837 #[inline]
2838 fn cast(syntax: SyntaxNode) -> Option<Self> {
2839 if Self::can_cast(syntax.kind()) {
2840 Some(Self { syntax })
2841 } else {
2842 None
2843 }
2844 }
2845 #[inline]
2846 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2847}
2848impl hash::Hash for AssocItemList {
2849 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2850}
2851impl Eq for AssocItemList {}
2852impl PartialEq for AssocItemList {
2853 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2854}
2855impl Clone for AssocItemList {
2856 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2857}
2858impl fmt::Debug for AssocItemList {
2859 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2860 f.debug_struct("AssocItemList").field("syntax", &self.syntax).finish()
2861 }
2862}
2863impl AstNode for AssocTypeArg {
2864 #[inline]
2865 fn kind() -> SyntaxKind
2866 where
2867 Self: Sized,
2868 {
2869 ASSOC_TYPE_ARG
2870 }
2871 #[inline]
2872 fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_TYPE_ARG }
2873 #[inline]
2874 fn cast(syntax: SyntaxNode) -> Option<Self> {
2875 if Self::can_cast(syntax.kind()) {
2876 Some(Self { syntax })
2877 } else {
2878 None
2879 }
2880 }
2881 #[inline]
2882 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2883}
2884impl hash::Hash for AssocTypeArg {
2885 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2886}
2887impl Eq for AssocTypeArg {}
2888impl PartialEq for AssocTypeArg {
2889 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2890}
2891impl Clone for AssocTypeArg {
2892 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2893}
2894impl fmt::Debug for AssocTypeArg {
2895 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2896 f.debug_struct("AssocTypeArg").field("syntax", &self.syntax).finish()
2897 }
2898}
2899impl AstNode for Attr {
2900 #[inline]
2901 fn kind() -> SyntaxKind
2902 where
2903 Self: Sized,
2904 {
2905 ATTR
2906 }
2907 #[inline]
2908 fn can_cast(kind: SyntaxKind) -> bool { kind == ATTR }
2909 #[inline]
2910 fn cast(syntax: SyntaxNode) -> Option<Self> {
2911 if Self::can_cast(syntax.kind()) {
2912 Some(Self { syntax })
2913 } else {
2914 None
2915 }
2916 }
2917 #[inline]
2918 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2919}
2920impl hash::Hash for Attr {
2921 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2922}
2923impl Eq for Attr {}
2924impl PartialEq for Attr {
2925 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2926}
2927impl Clone for Attr {
2928 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2929}
2930impl fmt::Debug for Attr {
2931 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2932 f.debug_struct("Attr").field("syntax", &self.syntax).finish()
2933 }
2934}
2935impl AstNode for AwaitExpr {
2936 #[inline]
2937 fn kind() -> SyntaxKind
2938 where
2939 Self: Sized,
2940 {
2941 AWAIT_EXPR
2942 }
2943 #[inline]
2944 fn can_cast(kind: SyntaxKind) -> bool { kind == AWAIT_EXPR }
2945 #[inline]
2946 fn cast(syntax: SyntaxNode) -> Option<Self> {
2947 if Self::can_cast(syntax.kind()) {
2948 Some(Self { syntax })
2949 } else {
2950 None
2951 }
2952 }
2953 #[inline]
2954 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2955}
2956impl hash::Hash for AwaitExpr {
2957 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2958}
2959impl Eq for AwaitExpr {}
2960impl PartialEq for AwaitExpr {
2961 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2962}
2963impl Clone for AwaitExpr {
2964 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
2965}
2966impl fmt::Debug for AwaitExpr {
2967 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2968 f.debug_struct("AwaitExpr").field("syntax", &self.syntax).finish()
2969 }
2970}
2971impl AstNode for BecomeExpr {
2972 #[inline]
2973 fn kind() -> SyntaxKind
2974 where
2975 Self: Sized,
2976 {
2977 BECOME_EXPR
2978 }
2979 #[inline]
2980 fn can_cast(kind: SyntaxKind) -> bool { kind == BECOME_EXPR }
2981 #[inline]
2982 fn cast(syntax: SyntaxNode) -> Option<Self> {
2983 if Self::can_cast(syntax.kind()) {
2984 Some(Self { syntax })
2985 } else {
2986 None
2987 }
2988 }
2989 #[inline]
2990 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2991}
2992impl hash::Hash for BecomeExpr {
2993 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
2994}
2995impl Eq for BecomeExpr {}
2996impl PartialEq for BecomeExpr {
2997 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
2998}
2999impl Clone for BecomeExpr {
3000 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3001}
3002impl fmt::Debug for BecomeExpr {
3003 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3004 f.debug_struct("BecomeExpr").field("syntax", &self.syntax).finish()
3005 }
3006}
3007impl AstNode for BinExpr {
3008 #[inline]
3009 fn kind() -> SyntaxKind
3010 where
3011 Self: Sized,
3012 {
3013 BIN_EXPR
3014 }
3015 #[inline]
3016 fn can_cast(kind: SyntaxKind) -> bool { kind == BIN_EXPR }
3017 #[inline]
3018 fn cast(syntax: SyntaxNode) -> Option<Self> {
3019 if Self::can_cast(syntax.kind()) {
3020 Some(Self { syntax })
3021 } else {
3022 None
3023 }
3024 }
3025 #[inline]
3026 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3027}
3028impl hash::Hash for BinExpr {
3029 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3030}
3031impl Eq for BinExpr {}
3032impl PartialEq for BinExpr {
3033 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3034}
3035impl Clone for BinExpr {
3036 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3037}
3038impl fmt::Debug for BinExpr {
3039 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3040 f.debug_struct("BinExpr").field("syntax", &self.syntax).finish()
3041 }
3042}
3043impl AstNode for BlockExpr {
3044 #[inline]
3045 fn kind() -> SyntaxKind
3046 where
3047 Self: Sized,
3048 {
3049 BLOCK_EXPR
3050 }
3051 #[inline]
3052 fn can_cast(kind: SyntaxKind) -> bool { kind == BLOCK_EXPR }
3053 #[inline]
3054 fn cast(syntax: SyntaxNode) -> Option<Self> {
3055 if Self::can_cast(syntax.kind()) {
3056 Some(Self { syntax })
3057 } else {
3058 None
3059 }
3060 }
3061 #[inline]
3062 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3063}
3064impl hash::Hash for BlockExpr {
3065 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3066}
3067impl Eq for BlockExpr {}
3068impl PartialEq for BlockExpr {
3069 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3070}
3071impl Clone for BlockExpr {
3072 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3073}
3074impl fmt::Debug for BlockExpr {
3075 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3076 f.debug_struct("BlockExpr").field("syntax", &self.syntax).finish()
3077 }
3078}
3079impl AstNode for BoxPat {
3080 #[inline]
3081 fn kind() -> SyntaxKind
3082 where
3083 Self: Sized,
3084 {
3085 BOX_PAT
3086 }
3087 #[inline]
3088 fn can_cast(kind: SyntaxKind) -> bool { kind == BOX_PAT }
3089 #[inline]
3090 fn cast(syntax: SyntaxNode) -> Option<Self> {
3091 if Self::can_cast(syntax.kind()) {
3092 Some(Self { syntax })
3093 } else {
3094 None
3095 }
3096 }
3097 #[inline]
3098 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3099}
3100impl hash::Hash for BoxPat {
3101 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3102}
3103impl Eq for BoxPat {}
3104impl PartialEq for BoxPat {
3105 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3106}
3107impl Clone for BoxPat {
3108 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3109}
3110impl fmt::Debug for BoxPat {
3111 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3112 f.debug_struct("BoxPat").field("syntax", &self.syntax).finish()
3113 }
3114}
3115impl AstNode for BreakExpr {
3116 #[inline]
3117 fn kind() -> SyntaxKind
3118 where
3119 Self: Sized,
3120 {
3121 BREAK_EXPR
3122 }
3123 #[inline]
3124 fn can_cast(kind: SyntaxKind) -> bool { kind == BREAK_EXPR }
3125 #[inline]
3126 fn cast(syntax: SyntaxNode) -> Option<Self> {
3127 if Self::can_cast(syntax.kind()) {
3128 Some(Self { syntax })
3129 } else {
3130 None
3131 }
3132 }
3133 #[inline]
3134 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3135}
3136impl hash::Hash for BreakExpr {
3137 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3138}
3139impl Eq for BreakExpr {}
3140impl PartialEq for BreakExpr {
3141 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3142}
3143impl Clone for BreakExpr {
3144 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3145}
3146impl fmt::Debug for BreakExpr {
3147 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3148 f.debug_struct("BreakExpr").field("syntax", &self.syntax).finish()
3149 }
3150}
3151impl AstNode for CallExpr {
3152 #[inline]
3153 fn kind() -> SyntaxKind
3154 where
3155 Self: Sized,
3156 {
3157 CALL_EXPR
3158 }
3159 #[inline]
3160 fn can_cast(kind: SyntaxKind) -> bool { kind == CALL_EXPR }
3161 #[inline]
3162 fn cast(syntax: SyntaxNode) -> Option<Self> {
3163 if Self::can_cast(syntax.kind()) {
3164 Some(Self { syntax })
3165 } else {
3166 None
3167 }
3168 }
3169 #[inline]
3170 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3171}
3172impl hash::Hash for CallExpr {
3173 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3174}
3175impl Eq for CallExpr {}
3176impl PartialEq for CallExpr {
3177 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3178}
3179impl Clone for CallExpr {
3180 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3181}
3182impl fmt::Debug for CallExpr {
3183 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3184 f.debug_struct("CallExpr").field("syntax", &self.syntax).finish()
3185 }
3186}
3187impl AstNode for CastExpr {
3188 #[inline]
3189 fn kind() -> SyntaxKind
3190 where
3191 Self: Sized,
3192 {
3193 CAST_EXPR
3194 }
3195 #[inline]
3196 fn can_cast(kind: SyntaxKind) -> bool { kind == CAST_EXPR }
3197 #[inline]
3198 fn cast(syntax: SyntaxNode) -> Option<Self> {
3199 if Self::can_cast(syntax.kind()) {
3200 Some(Self { syntax })
3201 } else {
3202 None
3203 }
3204 }
3205 #[inline]
3206 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3207}
3208impl hash::Hash for CastExpr {
3209 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3210}
3211impl Eq for CastExpr {}
3212impl PartialEq for CastExpr {
3213 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3214}
3215impl Clone for CastExpr {
3216 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3217}
3218impl fmt::Debug for CastExpr {
3219 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3220 f.debug_struct("CastExpr").field("syntax", &self.syntax).finish()
3221 }
3222}
3223impl AstNode for ClosureBinder {
3224 #[inline]
3225 fn kind() -> SyntaxKind
3226 where
3227 Self: Sized,
3228 {
3229 CLOSURE_BINDER
3230 }
3231 #[inline]
3232 fn can_cast(kind: SyntaxKind) -> bool { kind == CLOSURE_BINDER }
3233 #[inline]
3234 fn cast(syntax: SyntaxNode) -> Option<Self> {
3235 if Self::can_cast(syntax.kind()) {
3236 Some(Self { syntax })
3237 } else {
3238 None
3239 }
3240 }
3241 #[inline]
3242 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3243}
3244impl hash::Hash for ClosureBinder {
3245 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3246}
3247impl Eq for ClosureBinder {}
3248impl PartialEq for ClosureBinder {
3249 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3250}
3251impl Clone for ClosureBinder {
3252 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3253}
3254impl fmt::Debug for ClosureBinder {
3255 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3256 f.debug_struct("ClosureBinder").field("syntax", &self.syntax).finish()
3257 }
3258}
3259impl AstNode for ClosureExpr {
3260 #[inline]
3261 fn kind() -> SyntaxKind
3262 where
3263 Self: Sized,
3264 {
3265 CLOSURE_EXPR
3266 }
3267 #[inline]
3268 fn can_cast(kind: SyntaxKind) -> bool { kind == CLOSURE_EXPR }
3269 #[inline]
3270 fn cast(syntax: SyntaxNode) -> Option<Self> {
3271 if Self::can_cast(syntax.kind()) {
3272 Some(Self { syntax })
3273 } else {
3274 None
3275 }
3276 }
3277 #[inline]
3278 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3279}
3280impl hash::Hash for ClosureExpr {
3281 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3282}
3283impl Eq for ClosureExpr {}
3284impl PartialEq for ClosureExpr {
3285 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3286}
3287impl Clone for ClosureExpr {
3288 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3289}
3290impl fmt::Debug for ClosureExpr {
3291 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3292 f.debug_struct("ClosureExpr").field("syntax", &self.syntax).finish()
3293 }
3294}
3295impl AstNode for Const {
3296 #[inline]
3297 fn kind() -> SyntaxKind
3298 where
3299 Self: Sized,
3300 {
3301 CONST
3302 }
3303 #[inline]
3304 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST }
3305 #[inline]
3306 fn cast(syntax: SyntaxNode) -> Option<Self> {
3307 if Self::can_cast(syntax.kind()) {
3308 Some(Self { syntax })
3309 } else {
3310 None
3311 }
3312 }
3313 #[inline]
3314 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3315}
3316impl hash::Hash for Const {
3317 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3318}
3319impl Eq for Const {}
3320impl PartialEq for Const {
3321 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3322}
3323impl Clone for Const {
3324 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3325}
3326impl fmt::Debug for Const {
3327 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3328 f.debug_struct("Const").field("syntax", &self.syntax).finish()
3329 }
3330}
3331impl AstNode for ConstArg {
3332 #[inline]
3333 fn kind() -> SyntaxKind
3334 where
3335 Self: Sized,
3336 {
3337 CONST_ARG
3338 }
3339 #[inline]
3340 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_ARG }
3341 #[inline]
3342 fn cast(syntax: SyntaxNode) -> Option<Self> {
3343 if Self::can_cast(syntax.kind()) {
3344 Some(Self { syntax })
3345 } else {
3346 None
3347 }
3348 }
3349 #[inline]
3350 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3351}
3352impl hash::Hash for ConstArg {
3353 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3354}
3355impl Eq for ConstArg {}
3356impl PartialEq for ConstArg {
3357 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3358}
3359impl Clone for ConstArg {
3360 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3361}
3362impl fmt::Debug for ConstArg {
3363 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3364 f.debug_struct("ConstArg").field("syntax", &self.syntax).finish()
3365 }
3366}
3367impl AstNode for ConstBlockPat {
3368 #[inline]
3369 fn kind() -> SyntaxKind
3370 where
3371 Self: Sized,
3372 {
3373 CONST_BLOCK_PAT
3374 }
3375 #[inline]
3376 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_BLOCK_PAT }
3377 #[inline]
3378 fn cast(syntax: SyntaxNode) -> Option<Self> {
3379 if Self::can_cast(syntax.kind()) {
3380 Some(Self { syntax })
3381 } else {
3382 None
3383 }
3384 }
3385 #[inline]
3386 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3387}
3388impl hash::Hash for ConstBlockPat {
3389 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3390}
3391impl Eq for ConstBlockPat {}
3392impl PartialEq for ConstBlockPat {
3393 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3394}
3395impl Clone for ConstBlockPat {
3396 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3397}
3398impl fmt::Debug for ConstBlockPat {
3399 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3400 f.debug_struct("ConstBlockPat").field("syntax", &self.syntax).finish()
3401 }
3402}
3403impl AstNode for ConstParam {
3404 #[inline]
3405 fn kind() -> SyntaxKind
3406 where
3407 Self: Sized,
3408 {
3409 CONST_PARAM
3410 }
3411 #[inline]
3412 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_PARAM }
3413 #[inline]
3414 fn cast(syntax: SyntaxNode) -> Option<Self> {
3415 if Self::can_cast(syntax.kind()) {
3416 Some(Self { syntax })
3417 } else {
3418 None
3419 }
3420 }
3421 #[inline]
3422 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3423}
3424impl hash::Hash for ConstParam {
3425 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3426}
3427impl Eq for ConstParam {}
3428impl PartialEq for ConstParam {
3429 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3430}
3431impl Clone for ConstParam {
3432 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3433}
3434impl fmt::Debug for ConstParam {
3435 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3436 f.debug_struct("ConstParam").field("syntax", &self.syntax).finish()
3437 }
3438}
3439impl AstNode for ContinueExpr {
3440 #[inline]
3441 fn kind() -> SyntaxKind
3442 where
3443 Self: Sized,
3444 {
3445 CONTINUE_EXPR
3446 }
3447 #[inline]
3448 fn can_cast(kind: SyntaxKind) -> bool { kind == CONTINUE_EXPR }
3449 #[inline]
3450 fn cast(syntax: SyntaxNode) -> Option<Self> {
3451 if Self::can_cast(syntax.kind()) {
3452 Some(Self { syntax })
3453 } else {
3454 None
3455 }
3456 }
3457 #[inline]
3458 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3459}
3460impl hash::Hash for ContinueExpr {
3461 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3462}
3463impl Eq for ContinueExpr {}
3464impl PartialEq for ContinueExpr {
3465 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3466}
3467impl Clone for ContinueExpr {
3468 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3469}
3470impl fmt::Debug for ContinueExpr {
3471 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3472 f.debug_struct("ContinueExpr").field("syntax", &self.syntax).finish()
3473 }
3474}
3475impl AstNode for DynTraitType {
3476 #[inline]
3477 fn kind() -> SyntaxKind
3478 where
3479 Self: Sized,
3480 {
3481 DYN_TRAIT_TYPE
3482 }
3483 #[inline]
3484 fn can_cast(kind: SyntaxKind) -> bool { kind == DYN_TRAIT_TYPE }
3485 #[inline]
3486 fn cast(syntax: SyntaxNode) -> Option<Self> {
3487 if Self::can_cast(syntax.kind()) {
3488 Some(Self { syntax })
3489 } else {
3490 None
3491 }
3492 }
3493 #[inline]
3494 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3495}
3496impl hash::Hash for DynTraitType {
3497 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3498}
3499impl Eq for DynTraitType {}
3500impl PartialEq for DynTraitType {
3501 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3502}
3503impl Clone for DynTraitType {
3504 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3505}
3506impl fmt::Debug for DynTraitType {
3507 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3508 f.debug_struct("DynTraitType").field("syntax", &self.syntax).finish()
3509 }
3510}
3511impl AstNode for Enum {
3512 #[inline]
3513 fn kind() -> SyntaxKind
3514 where
3515 Self: Sized,
3516 {
3517 ENUM
3518 }
3519 #[inline]
3520 fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM }
3521 #[inline]
3522 fn cast(syntax: SyntaxNode) -> Option<Self> {
3523 if Self::can_cast(syntax.kind()) {
3524 Some(Self { syntax })
3525 } else {
3526 None
3527 }
3528 }
3529 #[inline]
3530 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3531}
3532impl hash::Hash for Enum {
3533 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3534}
3535impl Eq for Enum {}
3536impl PartialEq for Enum {
3537 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3538}
3539impl Clone for Enum {
3540 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3541}
3542impl fmt::Debug for Enum {
3543 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3544 f.debug_struct("Enum").field("syntax", &self.syntax).finish()
3545 }
3546}
3547impl AstNode for ExprStmt {
3548 #[inline]
3549 fn kind() -> SyntaxKind
3550 where
3551 Self: Sized,
3552 {
3553 EXPR_STMT
3554 }
3555 #[inline]
3556 fn can_cast(kind: SyntaxKind) -> bool { kind == EXPR_STMT }
3557 #[inline]
3558 fn cast(syntax: SyntaxNode) -> Option<Self> {
3559 if Self::can_cast(syntax.kind()) {
3560 Some(Self { syntax })
3561 } else {
3562 None
3563 }
3564 }
3565 #[inline]
3566 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3567}
3568impl hash::Hash for ExprStmt {
3569 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3570}
3571impl Eq for ExprStmt {}
3572impl PartialEq for ExprStmt {
3573 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3574}
3575impl Clone for ExprStmt {
3576 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3577}
3578impl fmt::Debug for ExprStmt {
3579 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3580 f.debug_struct("ExprStmt").field("syntax", &self.syntax).finish()
3581 }
3582}
3583impl AstNode for ExternBlock {
3584 #[inline]
3585 fn kind() -> SyntaxKind
3586 where
3587 Self: Sized,
3588 {
3589 EXTERN_BLOCK
3590 }
3591 #[inline]
3592 fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_BLOCK }
3593 #[inline]
3594 fn cast(syntax: SyntaxNode) -> Option<Self> {
3595 if Self::can_cast(syntax.kind()) {
3596 Some(Self { syntax })
3597 } else {
3598 None
3599 }
3600 }
3601 #[inline]
3602 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3603}
3604impl hash::Hash for ExternBlock {
3605 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3606}
3607impl Eq for ExternBlock {}
3608impl PartialEq for ExternBlock {
3609 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3610}
3611impl Clone for ExternBlock {
3612 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3613}
3614impl fmt::Debug for ExternBlock {
3615 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3616 f.debug_struct("ExternBlock").field("syntax", &self.syntax).finish()
3617 }
3618}
3619impl AstNode for ExternCrate {
3620 #[inline]
3621 fn kind() -> SyntaxKind
3622 where
3623 Self: Sized,
3624 {
3625 EXTERN_CRATE
3626 }
3627 #[inline]
3628 fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_CRATE }
3629 #[inline]
3630 fn cast(syntax: SyntaxNode) -> Option<Self> {
3631 if Self::can_cast(syntax.kind()) {
3632 Some(Self { syntax })
3633 } else {
3634 None
3635 }
3636 }
3637 #[inline]
3638 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3639}
3640impl hash::Hash for ExternCrate {
3641 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3642}
3643impl Eq for ExternCrate {}
3644impl PartialEq for ExternCrate {
3645 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3646}
3647impl Clone for ExternCrate {
3648 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3649}
3650impl fmt::Debug for ExternCrate {
3651 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3652 f.debug_struct("ExternCrate").field("syntax", &self.syntax).finish()
3653 }
3654}
3655impl AstNode for ExternItemList {
3656 #[inline]
3657 fn kind() -> SyntaxKind
3658 where
3659 Self: Sized,
3660 {
3661 EXTERN_ITEM_LIST
3662 }
3663 #[inline]
3664 fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_ITEM_LIST }
3665 #[inline]
3666 fn cast(syntax: SyntaxNode) -> Option<Self> {
3667 if Self::can_cast(syntax.kind()) {
3668 Some(Self { syntax })
3669 } else {
3670 None
3671 }
3672 }
3673 #[inline]
3674 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3675}
3676impl hash::Hash for ExternItemList {
3677 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3678}
3679impl Eq for ExternItemList {}
3680impl PartialEq for ExternItemList {
3681 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3682}
3683impl Clone for ExternItemList {
3684 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3685}
3686impl fmt::Debug for ExternItemList {
3687 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3688 f.debug_struct("ExternItemList").field("syntax", &self.syntax).finish()
3689 }
3690}
3691impl AstNode for FieldExpr {
3692 #[inline]
3693 fn kind() -> SyntaxKind
3694 where
3695 Self: Sized,
3696 {
3697 FIELD_EXPR
3698 }
3699 #[inline]
3700 fn can_cast(kind: SyntaxKind) -> bool { kind == FIELD_EXPR }
3701 #[inline]
3702 fn cast(syntax: SyntaxNode) -> Option<Self> {
3703 if Self::can_cast(syntax.kind()) {
3704 Some(Self { syntax })
3705 } else {
3706 None
3707 }
3708 }
3709 #[inline]
3710 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3711}
3712impl hash::Hash for FieldExpr {
3713 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3714}
3715impl Eq for FieldExpr {}
3716impl PartialEq for FieldExpr {
3717 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3718}
3719impl Clone for FieldExpr {
3720 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3721}
3722impl fmt::Debug for FieldExpr {
3723 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3724 f.debug_struct("FieldExpr").field("syntax", &self.syntax).finish()
3725 }
3726}
3727impl AstNode for Fn {
3728 #[inline]
3729 fn kind() -> SyntaxKind
3730 where
3731 Self: Sized,
3732 {
3733 FN
3734 }
3735 #[inline]
3736 fn can_cast(kind: SyntaxKind) -> bool { kind == FN }
3737 #[inline]
3738 fn cast(syntax: SyntaxNode) -> Option<Self> {
3739 if Self::can_cast(syntax.kind()) {
3740 Some(Self { syntax })
3741 } else {
3742 None
3743 }
3744 }
3745 #[inline]
3746 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3747}
3748impl hash::Hash for Fn {
3749 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3750}
3751impl Eq for Fn {}
3752impl PartialEq for Fn {
3753 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3754}
3755impl Clone for Fn {
3756 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3757}
3758impl fmt::Debug for Fn {
3759 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3760 f.debug_struct("Fn").field("syntax", &self.syntax).finish()
3761 }
3762}
3763impl AstNode for FnPtrType {
3764 #[inline]
3765 fn kind() -> SyntaxKind
3766 where
3767 Self: Sized,
3768 {
3769 FN_PTR_TYPE
3770 }
3771 #[inline]
3772 fn can_cast(kind: SyntaxKind) -> bool { kind == FN_PTR_TYPE }
3773 #[inline]
3774 fn cast(syntax: SyntaxNode) -> Option<Self> {
3775 if Self::can_cast(syntax.kind()) {
3776 Some(Self { syntax })
3777 } else {
3778 None
3779 }
3780 }
3781 #[inline]
3782 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3783}
3784impl hash::Hash for FnPtrType {
3785 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3786}
3787impl Eq for FnPtrType {}
3788impl PartialEq for FnPtrType {
3789 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3790}
3791impl Clone for FnPtrType {
3792 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3793}
3794impl fmt::Debug for FnPtrType {
3795 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3796 f.debug_struct("FnPtrType").field("syntax", &self.syntax).finish()
3797 }
3798}
3799impl AstNode for ForExpr {
3800 #[inline]
3801 fn kind() -> SyntaxKind
3802 where
3803 Self: Sized,
3804 {
3805 FOR_EXPR
3806 }
3807 #[inline]
3808 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_EXPR }
3809 #[inline]
3810 fn cast(syntax: SyntaxNode) -> Option<Self> {
3811 if Self::can_cast(syntax.kind()) {
3812 Some(Self { syntax })
3813 } else {
3814 None
3815 }
3816 }
3817 #[inline]
3818 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3819}
3820impl hash::Hash for ForExpr {
3821 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3822}
3823impl Eq for ForExpr {}
3824impl PartialEq for ForExpr {
3825 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3826}
3827impl Clone for ForExpr {
3828 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3829}
3830impl fmt::Debug for ForExpr {
3831 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3832 f.debug_struct("ForExpr").field("syntax", &self.syntax).finish()
3833 }
3834}
3835impl AstNode for ForType {
3836 #[inline]
3837 fn kind() -> SyntaxKind
3838 where
3839 Self: Sized,
3840 {
3841 FOR_TYPE
3842 }
3843 #[inline]
3844 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_TYPE }
3845 #[inline]
3846 fn cast(syntax: SyntaxNode) -> Option<Self> {
3847 if Self::can_cast(syntax.kind()) {
3848 Some(Self { syntax })
3849 } else {
3850 None
3851 }
3852 }
3853 #[inline]
3854 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3855}
3856impl hash::Hash for ForType {
3857 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3858}
3859impl Eq for ForType {}
3860impl PartialEq for ForType {
3861 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3862}
3863impl Clone for ForType {
3864 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3865}
3866impl fmt::Debug for ForType {
3867 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3868 f.debug_struct("ForType").field("syntax", &self.syntax).finish()
3869 }
3870}
3871impl AstNode for FormatArgsArg {
3872 #[inline]
3873 fn kind() -> SyntaxKind
3874 where
3875 Self: Sized,
3876 {
3877 FORMAT_ARGS_ARG
3878 }
3879 #[inline]
3880 fn can_cast(kind: SyntaxKind) -> bool { kind == FORMAT_ARGS_ARG }
3881 #[inline]
3882 fn cast(syntax: SyntaxNode) -> Option<Self> {
3883 if Self::can_cast(syntax.kind()) {
3884 Some(Self { syntax })
3885 } else {
3886 None
3887 }
3888 }
3889 #[inline]
3890 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3891}
3892impl hash::Hash for FormatArgsArg {
3893 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3894}
3895impl Eq for FormatArgsArg {}
3896impl PartialEq for FormatArgsArg {
3897 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3898}
3899impl Clone for FormatArgsArg {
3900 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3901}
3902impl fmt::Debug for FormatArgsArg {
3903 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3904 f.debug_struct("FormatArgsArg").field("syntax", &self.syntax).finish()
3905 }
3906}
3907impl AstNode for FormatArgsExpr {
3908 #[inline]
3909 fn kind() -> SyntaxKind
3910 where
3911 Self: Sized,
3912 {
3913 FORMAT_ARGS_EXPR
3914 }
3915 #[inline]
3916 fn can_cast(kind: SyntaxKind) -> bool { kind == FORMAT_ARGS_EXPR }
3917 #[inline]
3918 fn cast(syntax: SyntaxNode) -> Option<Self> {
3919 if Self::can_cast(syntax.kind()) {
3920 Some(Self { syntax })
3921 } else {
3922 None
3923 }
3924 }
3925 #[inline]
3926 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3927}
3928impl hash::Hash for FormatArgsExpr {
3929 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3930}
3931impl Eq for FormatArgsExpr {}
3932impl PartialEq for FormatArgsExpr {
3933 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3934}
3935impl Clone for FormatArgsExpr {
3936 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3937}
3938impl fmt::Debug for FormatArgsExpr {
3939 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3940 f.debug_struct("FormatArgsExpr").field("syntax", &self.syntax).finish()
3941 }
3942}
3943impl AstNode for GenericArgList {
3944 #[inline]
3945 fn kind() -> SyntaxKind
3946 where
3947 Self: Sized,
3948 {
3949 GENERIC_ARG_LIST
3950 }
3951 #[inline]
3952 fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_ARG_LIST }
3953 #[inline]
3954 fn cast(syntax: SyntaxNode) -> Option<Self> {
3955 if Self::can_cast(syntax.kind()) {
3956 Some(Self { syntax })
3957 } else {
3958 None
3959 }
3960 }
3961 #[inline]
3962 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3963}
3964impl hash::Hash for GenericArgList {
3965 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
3966}
3967impl Eq for GenericArgList {}
3968impl PartialEq for GenericArgList {
3969 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
3970}
3971impl Clone for GenericArgList {
3972 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
3973}
3974impl fmt::Debug for GenericArgList {
3975 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3976 f.debug_struct("GenericArgList").field("syntax", &self.syntax).finish()
3977 }
3978}
3979impl AstNode for GenericParamList {
3980 #[inline]
3981 fn kind() -> SyntaxKind
3982 where
3983 Self: Sized,
3984 {
3985 GENERIC_PARAM_LIST
3986 }
3987 #[inline]
3988 fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_PARAM_LIST }
3989 #[inline]
3990 fn cast(syntax: SyntaxNode) -> Option<Self> {
3991 if Self::can_cast(syntax.kind()) {
3992 Some(Self { syntax })
3993 } else {
3994 None
3995 }
3996 }
3997 #[inline]
3998 fn syntax(&self) -> &SyntaxNode { &self.syntax }
3999}
4000impl hash::Hash for GenericParamList {
4001 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4002}
4003impl Eq for GenericParamList {}
4004impl PartialEq for GenericParamList {
4005 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4006}
4007impl Clone for GenericParamList {
4008 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4009}
4010impl fmt::Debug for GenericParamList {
4011 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4012 f.debug_struct("GenericParamList").field("syntax", &self.syntax).finish()
4013 }
4014}
4015impl AstNode for IdentPat {
4016 #[inline]
4017 fn kind() -> SyntaxKind
4018 where
4019 Self: Sized,
4020 {
4021 IDENT_PAT
4022 }
4023 #[inline]
4024 fn can_cast(kind: SyntaxKind) -> bool { kind == IDENT_PAT }
4025 #[inline]
4026 fn cast(syntax: SyntaxNode) -> Option<Self> {
4027 if Self::can_cast(syntax.kind()) {
4028 Some(Self { syntax })
4029 } else {
4030 None
4031 }
4032 }
4033 #[inline]
4034 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4035}
4036impl hash::Hash for IdentPat {
4037 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4038}
4039impl Eq for IdentPat {}
4040impl PartialEq for IdentPat {
4041 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4042}
4043impl Clone for IdentPat {
4044 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4045}
4046impl fmt::Debug for IdentPat {
4047 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4048 f.debug_struct("IdentPat").field("syntax", &self.syntax).finish()
4049 }
4050}
4051impl AstNode for IfExpr {
4052 #[inline]
4053 fn kind() -> SyntaxKind
4054 where
4055 Self: Sized,
4056 {
4057 IF_EXPR
4058 }
4059 #[inline]
4060 fn can_cast(kind: SyntaxKind) -> bool { kind == IF_EXPR }
4061 #[inline]
4062 fn cast(syntax: SyntaxNode) -> Option<Self> {
4063 if Self::can_cast(syntax.kind()) {
4064 Some(Self { syntax })
4065 } else {
4066 None
4067 }
4068 }
4069 #[inline]
4070 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4071}
4072impl hash::Hash for IfExpr {
4073 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4074}
4075impl Eq for IfExpr {}
4076impl PartialEq for IfExpr {
4077 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4078}
4079impl Clone for IfExpr {
4080 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4081}
4082impl fmt::Debug for IfExpr {
4083 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4084 f.debug_struct("IfExpr").field("syntax", &self.syntax).finish()
4085 }
4086}
4087impl AstNode for Impl {
4088 #[inline]
4089 fn kind() -> SyntaxKind
4090 where
4091 Self: Sized,
4092 {
4093 IMPL
4094 }
4095 #[inline]
4096 fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL }
4097 #[inline]
4098 fn cast(syntax: SyntaxNode) -> Option<Self> {
4099 if Self::can_cast(syntax.kind()) {
4100 Some(Self { syntax })
4101 } else {
4102 None
4103 }
4104 }
4105 #[inline]
4106 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4107}
4108impl hash::Hash for Impl {
4109 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4110}
4111impl Eq for Impl {}
4112impl PartialEq for Impl {
4113 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4114}
4115impl Clone for Impl {
4116 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4117}
4118impl fmt::Debug for Impl {
4119 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4120 f.debug_struct("Impl").field("syntax", &self.syntax).finish()
4121 }
4122}
4123impl AstNode for ImplTraitType {
4124 #[inline]
4125 fn kind() -> SyntaxKind
4126 where
4127 Self: Sized,
4128 {
4129 IMPL_TRAIT_TYPE
4130 }
4131 #[inline]
4132 fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL_TRAIT_TYPE }
4133 #[inline]
4134 fn cast(syntax: SyntaxNode) -> Option<Self> {
4135 if Self::can_cast(syntax.kind()) {
4136 Some(Self { syntax })
4137 } else {
4138 None
4139 }
4140 }
4141 #[inline]
4142 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4143}
4144impl hash::Hash for ImplTraitType {
4145 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4146}
4147impl Eq for ImplTraitType {}
4148impl PartialEq for ImplTraitType {
4149 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4150}
4151impl Clone for ImplTraitType {
4152 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4153}
4154impl fmt::Debug for ImplTraitType {
4155 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4156 f.debug_struct("ImplTraitType").field("syntax", &self.syntax).finish()
4157 }
4158}
4159impl AstNode for IndexExpr {
4160 #[inline]
4161 fn kind() -> SyntaxKind
4162 where
4163 Self: Sized,
4164 {
4165 INDEX_EXPR
4166 }
4167 #[inline]
4168 fn can_cast(kind: SyntaxKind) -> bool { kind == INDEX_EXPR }
4169 #[inline]
4170 fn cast(syntax: SyntaxNode) -> Option<Self> {
4171 if Self::can_cast(syntax.kind()) {
4172 Some(Self { syntax })
4173 } else {
4174 None
4175 }
4176 }
4177 #[inline]
4178 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4179}
4180impl hash::Hash for IndexExpr {
4181 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4182}
4183impl Eq for IndexExpr {}
4184impl PartialEq for IndexExpr {
4185 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4186}
4187impl Clone for IndexExpr {
4188 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4189}
4190impl fmt::Debug for IndexExpr {
4191 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4192 f.debug_struct("IndexExpr").field("syntax", &self.syntax).finish()
4193 }
4194}
4195impl AstNode for InferType {
4196 #[inline]
4197 fn kind() -> SyntaxKind
4198 where
4199 Self: Sized,
4200 {
4201 INFER_TYPE
4202 }
4203 #[inline]
4204 fn can_cast(kind: SyntaxKind) -> bool { kind == INFER_TYPE }
4205 #[inline]
4206 fn cast(syntax: SyntaxNode) -> Option<Self> {
4207 if Self::can_cast(syntax.kind()) {
4208 Some(Self { syntax })
4209 } else {
4210 None
4211 }
4212 }
4213 #[inline]
4214 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4215}
4216impl hash::Hash for InferType {
4217 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4218}
4219impl Eq for InferType {}
4220impl PartialEq for InferType {
4221 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4222}
4223impl Clone for InferType {
4224 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4225}
4226impl fmt::Debug for InferType {
4227 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4228 f.debug_struct("InferType").field("syntax", &self.syntax).finish()
4229 }
4230}
4231impl AstNode for ItemList {
4232 #[inline]
4233 fn kind() -> SyntaxKind
4234 where
4235 Self: Sized,
4236 {
4237 ITEM_LIST
4238 }
4239 #[inline]
4240 fn can_cast(kind: SyntaxKind) -> bool { kind == ITEM_LIST }
4241 #[inline]
4242 fn cast(syntax: SyntaxNode) -> Option<Self> {
4243 if Self::can_cast(syntax.kind()) {
4244 Some(Self { syntax })
4245 } else {
4246 None
4247 }
4248 }
4249 #[inline]
4250 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4251}
4252impl hash::Hash for ItemList {
4253 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4254}
4255impl Eq for ItemList {}
4256impl PartialEq for ItemList {
4257 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4258}
4259impl Clone for ItemList {
4260 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4261}
4262impl fmt::Debug for ItemList {
4263 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4264 f.debug_struct("ItemList").field("syntax", &self.syntax).finish()
4265 }
4266}
4267impl AstNode for Label {
4268 #[inline]
4269 fn kind() -> SyntaxKind
4270 where
4271 Self: Sized,
4272 {
4273 LABEL
4274 }
4275 #[inline]
4276 fn can_cast(kind: SyntaxKind) -> bool { kind == LABEL }
4277 #[inline]
4278 fn cast(syntax: SyntaxNode) -> Option<Self> {
4279 if Self::can_cast(syntax.kind()) {
4280 Some(Self { syntax })
4281 } else {
4282 None
4283 }
4284 }
4285 #[inline]
4286 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4287}
4288impl hash::Hash for Label {
4289 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4290}
4291impl Eq for Label {}
4292impl PartialEq for Label {
4293 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4294}
4295impl Clone for Label {
4296 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4297}
4298impl fmt::Debug for Label {
4299 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4300 f.debug_struct("Label").field("syntax", &self.syntax).finish()
4301 }
4302}
4303impl AstNode for LetElse {
4304 #[inline]
4305 fn kind() -> SyntaxKind
4306 where
4307 Self: Sized,
4308 {
4309 LET_ELSE
4310 }
4311 #[inline]
4312 fn can_cast(kind: SyntaxKind) -> bool { kind == LET_ELSE }
4313 #[inline]
4314 fn cast(syntax: SyntaxNode) -> Option<Self> {
4315 if Self::can_cast(syntax.kind()) {
4316 Some(Self { syntax })
4317 } else {
4318 None
4319 }
4320 }
4321 #[inline]
4322 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4323}
4324impl hash::Hash for LetElse {
4325 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4326}
4327impl Eq for LetElse {}
4328impl PartialEq for LetElse {
4329 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4330}
4331impl Clone for LetElse {
4332 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4333}
4334impl fmt::Debug for LetElse {
4335 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4336 f.debug_struct("LetElse").field("syntax", &self.syntax).finish()
4337 }
4338}
4339impl AstNode for LetExpr {
4340 #[inline]
4341 fn kind() -> SyntaxKind
4342 where
4343 Self: Sized,
4344 {
4345 LET_EXPR
4346 }
4347 #[inline]
4348 fn can_cast(kind: SyntaxKind) -> bool { kind == LET_EXPR }
4349 #[inline]
4350 fn cast(syntax: SyntaxNode) -> Option<Self> {
4351 if Self::can_cast(syntax.kind()) {
4352 Some(Self { syntax })
4353 } else {
4354 None
4355 }
4356 }
4357 #[inline]
4358 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4359}
4360impl hash::Hash for LetExpr {
4361 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4362}
4363impl Eq for LetExpr {}
4364impl PartialEq for LetExpr {
4365 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4366}
4367impl Clone for LetExpr {
4368 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4369}
4370impl fmt::Debug for LetExpr {
4371 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4372 f.debug_struct("LetExpr").field("syntax", &self.syntax).finish()
4373 }
4374}
4375impl AstNode for LetStmt {
4376 #[inline]
4377 fn kind() -> SyntaxKind
4378 where
4379 Self: Sized,
4380 {
4381 LET_STMT
4382 }
4383 #[inline]
4384 fn can_cast(kind: SyntaxKind) -> bool { kind == LET_STMT }
4385 #[inline]
4386 fn cast(syntax: SyntaxNode) -> Option<Self> {
4387 if Self::can_cast(syntax.kind()) {
4388 Some(Self { syntax })
4389 } else {
4390 None
4391 }
4392 }
4393 #[inline]
4394 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4395}
4396impl hash::Hash for LetStmt {
4397 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4398}
4399impl Eq for LetStmt {}
4400impl PartialEq for LetStmt {
4401 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4402}
4403impl Clone for LetStmt {
4404 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4405}
4406impl fmt::Debug for LetStmt {
4407 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4408 f.debug_struct("LetStmt").field("syntax", &self.syntax).finish()
4409 }
4410}
4411impl AstNode for Lifetime {
4412 #[inline]
4413 fn kind() -> SyntaxKind
4414 where
4415 Self: Sized,
4416 {
4417 LIFETIME
4418 }
4419 #[inline]
4420 fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME }
4421 #[inline]
4422 fn cast(syntax: SyntaxNode) -> Option<Self> {
4423 if Self::can_cast(syntax.kind()) {
4424 Some(Self { syntax })
4425 } else {
4426 None
4427 }
4428 }
4429 #[inline]
4430 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4431}
4432impl hash::Hash for Lifetime {
4433 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4434}
4435impl Eq for Lifetime {}
4436impl PartialEq for Lifetime {
4437 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4438}
4439impl Clone for Lifetime {
4440 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4441}
4442impl fmt::Debug for Lifetime {
4443 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4444 f.debug_struct("Lifetime").field("syntax", &self.syntax).finish()
4445 }
4446}
4447impl AstNode for LifetimeArg {
4448 #[inline]
4449 fn kind() -> SyntaxKind
4450 where
4451 Self: Sized,
4452 {
4453 LIFETIME_ARG
4454 }
4455 #[inline]
4456 fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_ARG }
4457 #[inline]
4458 fn cast(syntax: SyntaxNode) -> Option<Self> {
4459 if Self::can_cast(syntax.kind()) {
4460 Some(Self { syntax })
4461 } else {
4462 None
4463 }
4464 }
4465 #[inline]
4466 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4467}
4468impl hash::Hash for LifetimeArg {
4469 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4470}
4471impl Eq for LifetimeArg {}
4472impl PartialEq for LifetimeArg {
4473 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4474}
4475impl Clone for LifetimeArg {
4476 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4477}
4478impl fmt::Debug for LifetimeArg {
4479 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4480 f.debug_struct("LifetimeArg").field("syntax", &self.syntax).finish()
4481 }
4482}
4483impl AstNode for LifetimeParam {
4484 #[inline]
4485 fn kind() -> SyntaxKind
4486 where
4487 Self: Sized,
4488 {
4489 LIFETIME_PARAM
4490 }
4491 #[inline]
4492 fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_PARAM }
4493 #[inline]
4494 fn cast(syntax: SyntaxNode) -> Option<Self> {
4495 if Self::can_cast(syntax.kind()) {
4496 Some(Self { syntax })
4497 } else {
4498 None
4499 }
4500 }
4501 #[inline]
4502 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4503}
4504impl hash::Hash for LifetimeParam {
4505 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4506}
4507impl Eq for LifetimeParam {}
4508impl PartialEq for LifetimeParam {
4509 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4510}
4511impl Clone for LifetimeParam {
4512 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4513}
4514impl fmt::Debug for LifetimeParam {
4515 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4516 f.debug_struct("LifetimeParam").field("syntax", &self.syntax).finish()
4517 }
4518}
4519impl AstNode for Literal {
4520 #[inline]
4521 fn kind() -> SyntaxKind
4522 where
4523 Self: Sized,
4524 {
4525 LITERAL
4526 }
4527 #[inline]
4528 fn can_cast(kind: SyntaxKind) -> bool { kind == LITERAL }
4529 #[inline]
4530 fn cast(syntax: SyntaxNode) -> Option<Self> {
4531 if Self::can_cast(syntax.kind()) {
4532 Some(Self { syntax })
4533 } else {
4534 None
4535 }
4536 }
4537 #[inline]
4538 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4539}
4540impl hash::Hash for Literal {
4541 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4542}
4543impl Eq for Literal {}
4544impl PartialEq for Literal {
4545 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4546}
4547impl Clone for Literal {
4548 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4549}
4550impl fmt::Debug for Literal {
4551 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4552 f.debug_struct("Literal").field("syntax", &self.syntax).finish()
4553 }
4554}
4555impl AstNode for LiteralPat {
4556 #[inline]
4557 fn kind() -> SyntaxKind
4558 where
4559 Self: Sized,
4560 {
4561 LITERAL_PAT
4562 }
4563 #[inline]
4564 fn can_cast(kind: SyntaxKind) -> bool { kind == LITERAL_PAT }
4565 #[inline]
4566 fn cast(syntax: SyntaxNode) -> Option<Self> {
4567 if Self::can_cast(syntax.kind()) {
4568 Some(Self { syntax })
4569 } else {
4570 None
4571 }
4572 }
4573 #[inline]
4574 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4575}
4576impl hash::Hash for LiteralPat {
4577 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4578}
4579impl Eq for LiteralPat {}
4580impl PartialEq for LiteralPat {
4581 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4582}
4583impl Clone for LiteralPat {
4584 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4585}
4586impl fmt::Debug for LiteralPat {
4587 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4588 f.debug_struct("LiteralPat").field("syntax", &self.syntax).finish()
4589 }
4590}
4591impl AstNode for LoopExpr {
4592 #[inline]
4593 fn kind() -> SyntaxKind
4594 where
4595 Self: Sized,
4596 {
4597 LOOP_EXPR
4598 }
4599 #[inline]
4600 fn can_cast(kind: SyntaxKind) -> bool { kind == LOOP_EXPR }
4601 #[inline]
4602 fn cast(syntax: SyntaxNode) -> Option<Self> {
4603 if Self::can_cast(syntax.kind()) {
4604 Some(Self { syntax })
4605 } else {
4606 None
4607 }
4608 }
4609 #[inline]
4610 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4611}
4612impl hash::Hash for LoopExpr {
4613 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4614}
4615impl Eq for LoopExpr {}
4616impl PartialEq for LoopExpr {
4617 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4618}
4619impl Clone for LoopExpr {
4620 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4621}
4622impl fmt::Debug for LoopExpr {
4623 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4624 f.debug_struct("LoopExpr").field("syntax", &self.syntax).finish()
4625 }
4626}
4627impl AstNode for MacroCall {
4628 #[inline]
4629 fn kind() -> SyntaxKind
4630 where
4631 Self: Sized,
4632 {
4633 MACRO_CALL
4634 }
4635 #[inline]
4636 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_CALL }
4637 #[inline]
4638 fn cast(syntax: SyntaxNode) -> Option<Self> {
4639 if Self::can_cast(syntax.kind()) {
4640 Some(Self { syntax })
4641 } else {
4642 None
4643 }
4644 }
4645 #[inline]
4646 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4647}
4648impl hash::Hash for MacroCall {
4649 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4650}
4651impl Eq for MacroCall {}
4652impl PartialEq for MacroCall {
4653 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4654}
4655impl Clone for MacroCall {
4656 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4657}
4658impl fmt::Debug for MacroCall {
4659 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4660 f.debug_struct("MacroCall").field("syntax", &self.syntax).finish()
4661 }
4662}
4663impl AstNode for MacroDef {
4664 #[inline]
4665 fn kind() -> SyntaxKind
4666 where
4667 Self: Sized,
4668 {
4669 MACRO_DEF
4670 }
4671 #[inline]
4672 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_DEF }
4673 #[inline]
4674 fn cast(syntax: SyntaxNode) -> Option<Self> {
4675 if Self::can_cast(syntax.kind()) {
4676 Some(Self { syntax })
4677 } else {
4678 None
4679 }
4680 }
4681 #[inline]
4682 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4683}
4684impl hash::Hash for MacroDef {
4685 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4686}
4687impl Eq for MacroDef {}
4688impl PartialEq for MacroDef {
4689 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4690}
4691impl Clone for MacroDef {
4692 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4693}
4694impl fmt::Debug for MacroDef {
4695 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4696 f.debug_struct("MacroDef").field("syntax", &self.syntax).finish()
4697 }
4698}
4699impl AstNode for MacroExpr {
4700 #[inline]
4701 fn kind() -> SyntaxKind
4702 where
4703 Self: Sized,
4704 {
4705 MACRO_EXPR
4706 }
4707 #[inline]
4708 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_EXPR }
4709 #[inline]
4710 fn cast(syntax: SyntaxNode) -> Option<Self> {
4711 if Self::can_cast(syntax.kind()) {
4712 Some(Self { syntax })
4713 } else {
4714 None
4715 }
4716 }
4717 #[inline]
4718 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4719}
4720impl hash::Hash for MacroExpr {
4721 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4722}
4723impl Eq for MacroExpr {}
4724impl PartialEq for MacroExpr {
4725 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4726}
4727impl Clone for MacroExpr {
4728 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4729}
4730impl fmt::Debug for MacroExpr {
4731 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4732 f.debug_struct("MacroExpr").field("syntax", &self.syntax).finish()
4733 }
4734}
4735impl AstNode for MacroItems {
4736 #[inline]
4737 fn kind() -> SyntaxKind
4738 where
4739 Self: Sized,
4740 {
4741 MACRO_ITEMS
4742 }
4743 #[inline]
4744 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_ITEMS }
4745 #[inline]
4746 fn cast(syntax: SyntaxNode) -> Option<Self> {
4747 if Self::can_cast(syntax.kind()) {
4748 Some(Self { syntax })
4749 } else {
4750 None
4751 }
4752 }
4753 #[inline]
4754 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4755}
4756impl hash::Hash for MacroItems {
4757 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4758}
4759impl Eq for MacroItems {}
4760impl PartialEq for MacroItems {
4761 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4762}
4763impl Clone for MacroItems {
4764 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4765}
4766impl fmt::Debug for MacroItems {
4767 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4768 f.debug_struct("MacroItems").field("syntax", &self.syntax).finish()
4769 }
4770}
4771impl AstNode for MacroPat {
4772 #[inline]
4773 fn kind() -> SyntaxKind
4774 where
4775 Self: Sized,
4776 {
4777 MACRO_PAT
4778 }
4779 #[inline]
4780 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_PAT }
4781 #[inline]
4782 fn cast(syntax: SyntaxNode) -> Option<Self> {
4783 if Self::can_cast(syntax.kind()) {
4784 Some(Self { syntax })
4785 } else {
4786 None
4787 }
4788 }
4789 #[inline]
4790 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4791}
4792impl hash::Hash for MacroPat {
4793 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4794}
4795impl Eq for MacroPat {}
4796impl PartialEq for MacroPat {
4797 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4798}
4799impl Clone for MacroPat {
4800 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4801}
4802impl fmt::Debug for MacroPat {
4803 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4804 f.debug_struct("MacroPat").field("syntax", &self.syntax).finish()
4805 }
4806}
4807impl AstNode for MacroRules {
4808 #[inline]
4809 fn kind() -> SyntaxKind
4810 where
4811 Self: Sized,
4812 {
4813 MACRO_RULES
4814 }
4815 #[inline]
4816 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_RULES }
4817 #[inline]
4818 fn cast(syntax: SyntaxNode) -> Option<Self> {
4819 if Self::can_cast(syntax.kind()) {
4820 Some(Self { syntax })
4821 } else {
4822 None
4823 }
4824 }
4825 #[inline]
4826 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4827}
4828impl hash::Hash for MacroRules {
4829 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4830}
4831impl Eq for MacroRules {}
4832impl PartialEq for MacroRules {
4833 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4834}
4835impl Clone for MacroRules {
4836 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4837}
4838impl fmt::Debug for MacroRules {
4839 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4840 f.debug_struct("MacroRules").field("syntax", &self.syntax).finish()
4841 }
4842}
4843impl AstNode for MacroStmts {
4844 #[inline]
4845 fn kind() -> SyntaxKind
4846 where
4847 Self: Sized,
4848 {
4849 MACRO_STMTS
4850 }
4851 #[inline]
4852 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_STMTS }
4853 #[inline]
4854 fn cast(syntax: SyntaxNode) -> Option<Self> {
4855 if Self::can_cast(syntax.kind()) {
4856 Some(Self { syntax })
4857 } else {
4858 None
4859 }
4860 }
4861 #[inline]
4862 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4863}
4864impl hash::Hash for MacroStmts {
4865 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4866}
4867impl Eq for MacroStmts {}
4868impl PartialEq for MacroStmts {
4869 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4870}
4871impl Clone for MacroStmts {
4872 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4873}
4874impl fmt::Debug for MacroStmts {
4875 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4876 f.debug_struct("MacroStmts").field("syntax", &self.syntax).finish()
4877 }
4878}
4879impl AstNode for MacroType {
4880 #[inline]
4881 fn kind() -> SyntaxKind
4882 where
4883 Self: Sized,
4884 {
4885 MACRO_TYPE
4886 }
4887 #[inline]
4888 fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_TYPE }
4889 #[inline]
4890 fn cast(syntax: SyntaxNode) -> Option<Self> {
4891 if Self::can_cast(syntax.kind()) {
4892 Some(Self { syntax })
4893 } else {
4894 None
4895 }
4896 }
4897 #[inline]
4898 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4899}
4900impl hash::Hash for MacroType {
4901 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4902}
4903impl Eq for MacroType {}
4904impl PartialEq for MacroType {
4905 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4906}
4907impl Clone for MacroType {
4908 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4909}
4910impl fmt::Debug for MacroType {
4911 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4912 f.debug_struct("MacroType").field("syntax", &self.syntax).finish()
4913 }
4914}
4915impl AstNode for MatchArm {
4916 #[inline]
4917 fn kind() -> SyntaxKind
4918 where
4919 Self: Sized,
4920 {
4921 MATCH_ARM
4922 }
4923 #[inline]
4924 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM }
4925 #[inline]
4926 fn cast(syntax: SyntaxNode) -> Option<Self> {
4927 if Self::can_cast(syntax.kind()) {
4928 Some(Self { syntax })
4929 } else {
4930 None
4931 }
4932 }
4933 #[inline]
4934 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4935}
4936impl hash::Hash for MatchArm {
4937 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4938}
4939impl Eq for MatchArm {}
4940impl PartialEq for MatchArm {
4941 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4942}
4943impl Clone for MatchArm {
4944 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4945}
4946impl fmt::Debug for MatchArm {
4947 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4948 f.debug_struct("MatchArm").field("syntax", &self.syntax).finish()
4949 }
4950}
4951impl AstNode for MatchArmList {
4952 #[inline]
4953 fn kind() -> SyntaxKind
4954 where
4955 Self: Sized,
4956 {
4957 MATCH_ARM_LIST
4958 }
4959 #[inline]
4960 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM_LIST }
4961 #[inline]
4962 fn cast(syntax: SyntaxNode) -> Option<Self> {
4963 if Self::can_cast(syntax.kind()) {
4964 Some(Self { syntax })
4965 } else {
4966 None
4967 }
4968 }
4969 #[inline]
4970 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4971}
4972impl hash::Hash for MatchArmList {
4973 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
4974}
4975impl Eq for MatchArmList {}
4976impl PartialEq for MatchArmList {
4977 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
4978}
4979impl Clone for MatchArmList {
4980 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
4981}
4982impl fmt::Debug for MatchArmList {
4983 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4984 f.debug_struct("MatchArmList").field("syntax", &self.syntax).finish()
4985 }
4986}
4987impl AstNode for MatchExpr {
4988 #[inline]
4989 fn kind() -> SyntaxKind
4990 where
4991 Self: Sized,
4992 {
4993 MATCH_EXPR
4994 }
4995 #[inline]
4996 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_EXPR }
4997 #[inline]
4998 fn cast(syntax: SyntaxNode) -> Option<Self> {
4999 if Self::can_cast(syntax.kind()) {
5000 Some(Self { syntax })
5001 } else {
5002 None
5003 }
5004 }
5005 #[inline]
5006 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5007}
5008impl hash::Hash for MatchExpr {
5009 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5010}
5011impl Eq for MatchExpr {}
5012impl PartialEq for MatchExpr {
5013 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5014}
5015impl Clone for MatchExpr {
5016 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5017}
5018impl fmt::Debug for MatchExpr {
5019 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5020 f.debug_struct("MatchExpr").field("syntax", &self.syntax).finish()
5021 }
5022}
5023impl AstNode for MatchGuard {
5024 #[inline]
5025 fn kind() -> SyntaxKind
5026 where
5027 Self: Sized,
5028 {
5029 MATCH_GUARD
5030 }
5031 #[inline]
5032 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_GUARD }
5033 #[inline]
5034 fn cast(syntax: SyntaxNode) -> Option<Self> {
5035 if Self::can_cast(syntax.kind()) {
5036 Some(Self { syntax })
5037 } else {
5038 None
5039 }
5040 }
5041 #[inline]
5042 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5043}
5044impl hash::Hash for MatchGuard {
5045 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5046}
5047impl Eq for MatchGuard {}
5048impl PartialEq for MatchGuard {
5049 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5050}
5051impl Clone for MatchGuard {
5052 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5053}
5054impl fmt::Debug for MatchGuard {
5055 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5056 f.debug_struct("MatchGuard").field("syntax", &self.syntax).finish()
5057 }
5058}
5059impl AstNode for Meta {
5060 #[inline]
5061 fn kind() -> SyntaxKind
5062 where
5063 Self: Sized,
5064 {
5065 META
5066 }
5067 #[inline]
5068 fn can_cast(kind: SyntaxKind) -> bool { kind == META }
5069 #[inline]
5070 fn cast(syntax: SyntaxNode) -> Option<Self> {
5071 if Self::can_cast(syntax.kind()) {
5072 Some(Self { syntax })
5073 } else {
5074 None
5075 }
5076 }
5077 #[inline]
5078 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5079}
5080impl hash::Hash for Meta {
5081 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5082}
5083impl Eq for Meta {}
5084impl PartialEq for Meta {
5085 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5086}
5087impl Clone for Meta {
5088 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5089}
5090impl fmt::Debug for Meta {
5091 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5092 f.debug_struct("Meta").field("syntax", &self.syntax).finish()
5093 }
5094}
5095impl AstNode for MethodCallExpr {
5096 #[inline]
5097 fn kind() -> SyntaxKind
5098 where
5099 Self: Sized,
5100 {
5101 METHOD_CALL_EXPR
5102 }
5103 #[inline]
5104 fn can_cast(kind: SyntaxKind) -> bool { kind == METHOD_CALL_EXPR }
5105 #[inline]
5106 fn cast(syntax: SyntaxNode) -> Option<Self> {
5107 if Self::can_cast(syntax.kind()) {
5108 Some(Self { syntax })
5109 } else {
5110 None
5111 }
5112 }
5113 #[inline]
5114 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5115}
5116impl hash::Hash for MethodCallExpr {
5117 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5118}
5119impl Eq for MethodCallExpr {}
5120impl PartialEq for MethodCallExpr {
5121 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5122}
5123impl Clone for MethodCallExpr {
5124 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5125}
5126impl fmt::Debug for MethodCallExpr {
5127 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5128 f.debug_struct("MethodCallExpr").field("syntax", &self.syntax).finish()
5129 }
5130}
5131impl AstNode for Module {
5132 #[inline]
5133 fn kind() -> SyntaxKind
5134 where
5135 Self: Sized,
5136 {
5137 MODULE
5138 }
5139 #[inline]
5140 fn can_cast(kind: SyntaxKind) -> bool { kind == MODULE }
5141 #[inline]
5142 fn cast(syntax: SyntaxNode) -> Option<Self> {
5143 if Self::can_cast(syntax.kind()) {
5144 Some(Self { syntax })
5145 } else {
5146 None
5147 }
5148 }
5149 #[inline]
5150 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5151}
5152impl hash::Hash for Module {
5153 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5154}
5155impl Eq for Module {}
5156impl PartialEq for Module {
5157 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5158}
5159impl Clone for Module {
5160 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5161}
5162impl fmt::Debug for Module {
5163 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5164 f.debug_struct("Module").field("syntax", &self.syntax).finish()
5165 }
5166}
5167impl AstNode for Name {
5168 #[inline]
5169 fn kind() -> SyntaxKind
5170 where
5171 Self: Sized,
5172 {
5173 NAME
5174 }
5175 #[inline]
5176 fn can_cast(kind: SyntaxKind) -> bool { kind == NAME }
5177 #[inline]
5178 fn cast(syntax: SyntaxNode) -> Option<Self> {
5179 if Self::can_cast(syntax.kind()) {
5180 Some(Self { syntax })
5181 } else {
5182 None
5183 }
5184 }
5185 #[inline]
5186 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5187}
5188impl hash::Hash for Name {
5189 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5190}
5191impl Eq for Name {}
5192impl PartialEq for Name {
5193 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5194}
5195impl Clone for Name {
5196 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5197}
5198impl fmt::Debug for Name {
5199 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5200 f.debug_struct("Name").field("syntax", &self.syntax).finish()
5201 }
5202}
5203impl AstNode for NameRef {
5204 #[inline]
5205 fn kind() -> SyntaxKind
5206 where
5207 Self: Sized,
5208 {
5209 NAME_REF
5210 }
5211 #[inline]
5212 fn can_cast(kind: SyntaxKind) -> bool { kind == NAME_REF }
5213 #[inline]
5214 fn cast(syntax: SyntaxNode) -> Option<Self> {
5215 if Self::can_cast(syntax.kind()) {
5216 Some(Self { syntax })
5217 } else {
5218 None
5219 }
5220 }
5221 #[inline]
5222 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5223}
5224impl hash::Hash for NameRef {
5225 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5226}
5227impl Eq for NameRef {}
5228impl PartialEq for NameRef {
5229 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5230}
5231impl Clone for NameRef {
5232 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5233}
5234impl fmt::Debug for NameRef {
5235 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5236 f.debug_struct("NameRef").field("syntax", &self.syntax).finish()
5237 }
5238}
5239impl AstNode for NeverType {
5240 #[inline]
5241 fn kind() -> SyntaxKind
5242 where
5243 Self: Sized,
5244 {
5245 NEVER_TYPE
5246 }
5247 #[inline]
5248 fn can_cast(kind: SyntaxKind) -> bool { kind == NEVER_TYPE }
5249 #[inline]
5250 fn cast(syntax: SyntaxNode) -> Option<Self> {
5251 if Self::can_cast(syntax.kind()) {
5252 Some(Self { syntax })
5253 } else {
5254 None
5255 }
5256 }
5257 #[inline]
5258 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5259}
5260impl hash::Hash for NeverType {
5261 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5262}
5263impl Eq for NeverType {}
5264impl PartialEq for NeverType {
5265 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5266}
5267impl Clone for NeverType {
5268 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5269}
5270impl fmt::Debug for NeverType {
5271 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5272 f.debug_struct("NeverType").field("syntax", &self.syntax).finish()
5273 }
5274}
5275impl AstNode for OffsetOfExpr {
5276 #[inline]
5277 fn kind() -> SyntaxKind
5278 where
5279 Self: Sized,
5280 {
5281 OFFSET_OF_EXPR
5282 }
5283 #[inline]
5284 fn can_cast(kind: SyntaxKind) -> bool { kind == OFFSET_OF_EXPR }
5285 #[inline]
5286 fn cast(syntax: SyntaxNode) -> Option<Self> {
5287 if Self::can_cast(syntax.kind()) {
5288 Some(Self { syntax })
5289 } else {
5290 None
5291 }
5292 }
5293 #[inline]
5294 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5295}
5296impl hash::Hash for OffsetOfExpr {
5297 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5298}
5299impl Eq for OffsetOfExpr {}
5300impl PartialEq for OffsetOfExpr {
5301 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5302}
5303impl Clone for OffsetOfExpr {
5304 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5305}
5306impl fmt::Debug for OffsetOfExpr {
5307 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5308 f.debug_struct("OffsetOfExpr").field("syntax", &self.syntax).finish()
5309 }
5310}
5311impl AstNode for OrPat {
5312 #[inline]
5313 fn kind() -> SyntaxKind
5314 where
5315 Self: Sized,
5316 {
5317 OR_PAT
5318 }
5319 #[inline]
5320 fn can_cast(kind: SyntaxKind) -> bool { kind == OR_PAT }
5321 #[inline]
5322 fn cast(syntax: SyntaxNode) -> Option<Self> {
5323 if Self::can_cast(syntax.kind()) {
5324 Some(Self { syntax })
5325 } else {
5326 None
5327 }
5328 }
5329 #[inline]
5330 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5331}
5332impl hash::Hash for OrPat {
5333 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5334}
5335impl Eq for OrPat {}
5336impl PartialEq for OrPat {
5337 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5338}
5339impl Clone for OrPat {
5340 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5341}
5342impl fmt::Debug for OrPat {
5343 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5344 f.debug_struct("OrPat").field("syntax", &self.syntax).finish()
5345 }
5346}
5347impl AstNode for Param {
5348 #[inline]
5349 fn kind() -> SyntaxKind
5350 where
5351 Self: Sized,
5352 {
5353 PARAM
5354 }
5355 #[inline]
5356 fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM }
5357 #[inline]
5358 fn cast(syntax: SyntaxNode) -> Option<Self> {
5359 if Self::can_cast(syntax.kind()) {
5360 Some(Self { syntax })
5361 } else {
5362 None
5363 }
5364 }
5365 #[inline]
5366 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5367}
5368impl hash::Hash for Param {
5369 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5370}
5371impl Eq for Param {}
5372impl PartialEq for Param {
5373 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5374}
5375impl Clone for Param {
5376 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5377}
5378impl fmt::Debug for Param {
5379 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5380 f.debug_struct("Param").field("syntax", &self.syntax).finish()
5381 }
5382}
5383impl AstNode for ParamList {
5384 #[inline]
5385 fn kind() -> SyntaxKind
5386 where
5387 Self: Sized,
5388 {
5389 PARAM_LIST
5390 }
5391 #[inline]
5392 fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM_LIST }
5393 #[inline]
5394 fn cast(syntax: SyntaxNode) -> Option<Self> {
5395 if Self::can_cast(syntax.kind()) {
5396 Some(Self { syntax })
5397 } else {
5398 None
5399 }
5400 }
5401 #[inline]
5402 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5403}
5404impl hash::Hash for ParamList {
5405 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5406}
5407impl Eq for ParamList {}
5408impl PartialEq for ParamList {
5409 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5410}
5411impl Clone for ParamList {
5412 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5413}
5414impl fmt::Debug for ParamList {
5415 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5416 f.debug_struct("ParamList").field("syntax", &self.syntax).finish()
5417 }
5418}
5419impl AstNode for ParenExpr {
5420 #[inline]
5421 fn kind() -> SyntaxKind
5422 where
5423 Self: Sized,
5424 {
5425 PAREN_EXPR
5426 }
5427 #[inline]
5428 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_EXPR }
5429 #[inline]
5430 fn cast(syntax: SyntaxNode) -> Option<Self> {
5431 if Self::can_cast(syntax.kind()) {
5432 Some(Self { syntax })
5433 } else {
5434 None
5435 }
5436 }
5437 #[inline]
5438 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5439}
5440impl hash::Hash for ParenExpr {
5441 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5442}
5443impl Eq for ParenExpr {}
5444impl PartialEq for ParenExpr {
5445 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5446}
5447impl Clone for ParenExpr {
5448 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5449}
5450impl fmt::Debug for ParenExpr {
5451 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5452 f.debug_struct("ParenExpr").field("syntax", &self.syntax).finish()
5453 }
5454}
5455impl AstNode for ParenPat {
5456 #[inline]
5457 fn kind() -> SyntaxKind
5458 where
5459 Self: Sized,
5460 {
5461 PAREN_PAT
5462 }
5463 #[inline]
5464 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_PAT }
5465 #[inline]
5466 fn cast(syntax: SyntaxNode) -> Option<Self> {
5467 if Self::can_cast(syntax.kind()) {
5468 Some(Self { syntax })
5469 } else {
5470 None
5471 }
5472 }
5473 #[inline]
5474 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5475}
5476impl hash::Hash for ParenPat {
5477 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5478}
5479impl Eq for ParenPat {}
5480impl PartialEq for ParenPat {
5481 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5482}
5483impl Clone for ParenPat {
5484 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5485}
5486impl fmt::Debug for ParenPat {
5487 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5488 f.debug_struct("ParenPat").field("syntax", &self.syntax).finish()
5489 }
5490}
5491impl AstNode for ParenType {
5492 #[inline]
5493 fn kind() -> SyntaxKind
5494 where
5495 Self: Sized,
5496 {
5497 PAREN_TYPE
5498 }
5499 #[inline]
5500 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_TYPE }
5501 #[inline]
5502 fn cast(syntax: SyntaxNode) -> Option<Self> {
5503 if Self::can_cast(syntax.kind()) {
5504 Some(Self { syntax })
5505 } else {
5506 None
5507 }
5508 }
5509 #[inline]
5510 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5511}
5512impl hash::Hash for ParenType {
5513 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5514}
5515impl Eq for ParenType {}
5516impl PartialEq for ParenType {
5517 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5518}
5519impl Clone for ParenType {
5520 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5521}
5522impl fmt::Debug for ParenType {
5523 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5524 f.debug_struct("ParenType").field("syntax", &self.syntax).finish()
5525 }
5526}
5527impl AstNode for ParenthesizedArgList {
5528 #[inline]
5529 fn kind() -> SyntaxKind
5530 where
5531 Self: Sized,
5532 {
5533 PARENTHESIZED_ARG_LIST
5534 }
5535 #[inline]
5536 fn can_cast(kind: SyntaxKind) -> bool { kind == PARENTHESIZED_ARG_LIST }
5537 #[inline]
5538 fn cast(syntax: SyntaxNode) -> Option<Self> {
5539 if Self::can_cast(syntax.kind()) {
5540 Some(Self { syntax })
5541 } else {
5542 None
5543 }
5544 }
5545 #[inline]
5546 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5547}
5548impl hash::Hash for ParenthesizedArgList {
5549 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5550}
5551impl Eq for ParenthesizedArgList {}
5552impl PartialEq for ParenthesizedArgList {
5553 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5554}
5555impl Clone for ParenthesizedArgList {
5556 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5557}
5558impl fmt::Debug for ParenthesizedArgList {
5559 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5560 f.debug_struct("ParenthesizedArgList").field("syntax", &self.syntax).finish()
5561 }
5562}
5563impl AstNode for Path {
5564 #[inline]
5565 fn kind() -> SyntaxKind
5566 where
5567 Self: Sized,
5568 {
5569 PATH
5570 }
5571 #[inline]
5572 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH }
5573 #[inline]
5574 fn cast(syntax: SyntaxNode) -> Option<Self> {
5575 if Self::can_cast(syntax.kind()) {
5576 Some(Self { syntax })
5577 } else {
5578 None
5579 }
5580 }
5581 #[inline]
5582 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5583}
5584impl hash::Hash for Path {
5585 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5586}
5587impl Eq for Path {}
5588impl PartialEq for Path {
5589 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5590}
5591impl Clone for Path {
5592 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5593}
5594impl fmt::Debug for Path {
5595 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5596 f.debug_struct("Path").field("syntax", &self.syntax).finish()
5597 }
5598}
5599impl AstNode for PathExpr {
5600 #[inline]
5601 fn kind() -> SyntaxKind
5602 where
5603 Self: Sized,
5604 {
5605 PATH_EXPR
5606 }
5607 #[inline]
5608 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_EXPR }
5609 #[inline]
5610 fn cast(syntax: SyntaxNode) -> Option<Self> {
5611 if Self::can_cast(syntax.kind()) {
5612 Some(Self { syntax })
5613 } else {
5614 None
5615 }
5616 }
5617 #[inline]
5618 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5619}
5620impl hash::Hash for PathExpr {
5621 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5622}
5623impl Eq for PathExpr {}
5624impl PartialEq for PathExpr {
5625 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5626}
5627impl Clone for PathExpr {
5628 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5629}
5630impl fmt::Debug for PathExpr {
5631 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5632 f.debug_struct("PathExpr").field("syntax", &self.syntax).finish()
5633 }
5634}
5635impl AstNode for PathPat {
5636 #[inline]
5637 fn kind() -> SyntaxKind
5638 where
5639 Self: Sized,
5640 {
5641 PATH_PAT
5642 }
5643 #[inline]
5644 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_PAT }
5645 #[inline]
5646 fn cast(syntax: SyntaxNode) -> Option<Self> {
5647 if Self::can_cast(syntax.kind()) {
5648 Some(Self { syntax })
5649 } else {
5650 None
5651 }
5652 }
5653 #[inline]
5654 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5655}
5656impl hash::Hash for PathPat {
5657 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5658}
5659impl Eq for PathPat {}
5660impl PartialEq for PathPat {
5661 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5662}
5663impl Clone for PathPat {
5664 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5665}
5666impl fmt::Debug for PathPat {
5667 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5668 f.debug_struct("PathPat").field("syntax", &self.syntax).finish()
5669 }
5670}
5671impl AstNode for PathSegment {
5672 #[inline]
5673 fn kind() -> SyntaxKind
5674 where
5675 Self: Sized,
5676 {
5677 PATH_SEGMENT
5678 }
5679 #[inline]
5680 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT }
5681 #[inline]
5682 fn cast(syntax: SyntaxNode) -> Option<Self> {
5683 if Self::can_cast(syntax.kind()) {
5684 Some(Self { syntax })
5685 } else {
5686 None
5687 }
5688 }
5689 #[inline]
5690 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5691}
5692impl hash::Hash for PathSegment {
5693 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5694}
5695impl Eq for PathSegment {}
5696impl PartialEq for PathSegment {
5697 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5698}
5699impl Clone for PathSegment {
5700 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5701}
5702impl fmt::Debug for PathSegment {
5703 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5704 f.debug_struct("PathSegment").field("syntax", &self.syntax).finish()
5705 }
5706}
5707impl AstNode for PathType {
5708 #[inline]
5709 fn kind() -> SyntaxKind
5710 where
5711 Self: Sized,
5712 {
5713 PATH_TYPE
5714 }
5715 #[inline]
5716 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_TYPE }
5717 #[inline]
5718 fn cast(syntax: SyntaxNode) -> Option<Self> {
5719 if Self::can_cast(syntax.kind()) {
5720 Some(Self { syntax })
5721 } else {
5722 None
5723 }
5724 }
5725 #[inline]
5726 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5727}
5728impl hash::Hash for PathType {
5729 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5730}
5731impl Eq for PathType {}
5732impl PartialEq for PathType {
5733 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5734}
5735impl Clone for PathType {
5736 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5737}
5738impl fmt::Debug for PathType {
5739 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5740 f.debug_struct("PathType").field("syntax", &self.syntax).finish()
5741 }
5742}
5743impl AstNode for PrefixExpr {
5744 #[inline]
5745 fn kind() -> SyntaxKind
5746 where
5747 Self: Sized,
5748 {
5749 PREFIX_EXPR
5750 }
5751 #[inline]
5752 fn can_cast(kind: SyntaxKind) -> bool { kind == PREFIX_EXPR }
5753 #[inline]
5754 fn cast(syntax: SyntaxNode) -> Option<Self> {
5755 if Self::can_cast(syntax.kind()) {
5756 Some(Self { syntax })
5757 } else {
5758 None
5759 }
5760 }
5761 #[inline]
5762 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5763}
5764impl hash::Hash for PrefixExpr {
5765 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5766}
5767impl Eq for PrefixExpr {}
5768impl PartialEq for PrefixExpr {
5769 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5770}
5771impl Clone for PrefixExpr {
5772 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5773}
5774impl fmt::Debug for PrefixExpr {
5775 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5776 f.debug_struct("PrefixExpr").field("syntax", &self.syntax).finish()
5777 }
5778}
5779impl AstNode for PtrType {
5780 #[inline]
5781 fn kind() -> SyntaxKind
5782 where
5783 Self: Sized,
5784 {
5785 PTR_TYPE
5786 }
5787 #[inline]
5788 fn can_cast(kind: SyntaxKind) -> bool { kind == PTR_TYPE }
5789 #[inline]
5790 fn cast(syntax: SyntaxNode) -> Option<Self> {
5791 if Self::can_cast(syntax.kind()) {
5792 Some(Self { syntax })
5793 } else {
5794 None
5795 }
5796 }
5797 #[inline]
5798 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5799}
5800impl hash::Hash for PtrType {
5801 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5802}
5803impl Eq for PtrType {}
5804impl PartialEq for PtrType {
5805 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5806}
5807impl Clone for PtrType {
5808 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5809}
5810impl fmt::Debug for PtrType {
5811 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5812 f.debug_struct("PtrType").field("syntax", &self.syntax).finish()
5813 }
5814}
5815impl AstNode for RangeExpr {
5816 #[inline]
5817 fn kind() -> SyntaxKind
5818 where
5819 Self: Sized,
5820 {
5821 RANGE_EXPR
5822 }
5823 #[inline]
5824 fn can_cast(kind: SyntaxKind) -> bool { kind == RANGE_EXPR }
5825 #[inline]
5826 fn cast(syntax: SyntaxNode) -> Option<Self> {
5827 if Self::can_cast(syntax.kind()) {
5828 Some(Self { syntax })
5829 } else {
5830 None
5831 }
5832 }
5833 #[inline]
5834 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5835}
5836impl hash::Hash for RangeExpr {
5837 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5838}
5839impl Eq for RangeExpr {}
5840impl PartialEq for RangeExpr {
5841 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5842}
5843impl Clone for RangeExpr {
5844 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5845}
5846impl fmt::Debug for RangeExpr {
5847 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5848 f.debug_struct("RangeExpr").field("syntax", &self.syntax).finish()
5849 }
5850}
5851impl AstNode for RangePat {
5852 #[inline]
5853 fn kind() -> SyntaxKind
5854 where
5855 Self: Sized,
5856 {
5857 RANGE_PAT
5858 }
5859 #[inline]
5860 fn can_cast(kind: SyntaxKind) -> bool { kind == RANGE_PAT }
5861 #[inline]
5862 fn cast(syntax: SyntaxNode) -> Option<Self> {
5863 if Self::can_cast(syntax.kind()) {
5864 Some(Self { syntax })
5865 } else {
5866 None
5867 }
5868 }
5869 #[inline]
5870 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5871}
5872impl hash::Hash for RangePat {
5873 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5874}
5875impl Eq for RangePat {}
5876impl PartialEq for RangePat {
5877 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5878}
5879impl Clone for RangePat {
5880 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5881}
5882impl fmt::Debug for RangePat {
5883 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5884 f.debug_struct("RangePat").field("syntax", &self.syntax).finish()
5885 }
5886}
5887impl AstNode for RecordExpr {
5888 #[inline]
5889 fn kind() -> SyntaxKind
5890 where
5891 Self: Sized,
5892 {
5893 RECORD_EXPR
5894 }
5895 #[inline]
5896 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR }
5897 #[inline]
5898 fn cast(syntax: SyntaxNode) -> Option<Self> {
5899 if Self::can_cast(syntax.kind()) {
5900 Some(Self { syntax })
5901 } else {
5902 None
5903 }
5904 }
5905 #[inline]
5906 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5907}
5908impl hash::Hash for RecordExpr {
5909 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5910}
5911impl Eq for RecordExpr {}
5912impl PartialEq for RecordExpr {
5913 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5914}
5915impl Clone for RecordExpr {
5916 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5917}
5918impl fmt::Debug for RecordExpr {
5919 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5920 f.debug_struct("RecordExpr").field("syntax", &self.syntax).finish()
5921 }
5922}
5923impl AstNode for RecordExprField {
5924 #[inline]
5925 fn kind() -> SyntaxKind
5926 where
5927 Self: Sized,
5928 {
5929 RECORD_EXPR_FIELD
5930 }
5931 #[inline]
5932 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD }
5933 #[inline]
5934 fn cast(syntax: SyntaxNode) -> Option<Self> {
5935 if Self::can_cast(syntax.kind()) {
5936 Some(Self { syntax })
5937 } else {
5938 None
5939 }
5940 }
5941 #[inline]
5942 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5943}
5944impl hash::Hash for RecordExprField {
5945 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5946}
5947impl Eq for RecordExprField {}
5948impl PartialEq for RecordExprField {
5949 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5950}
5951impl Clone for RecordExprField {
5952 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5953}
5954impl fmt::Debug for RecordExprField {
5955 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5956 f.debug_struct("RecordExprField").field("syntax", &self.syntax).finish()
5957 }
5958}
5959impl AstNode for RecordExprFieldList {
5960 #[inline]
5961 fn kind() -> SyntaxKind
5962 where
5963 Self: Sized,
5964 {
5965 RECORD_EXPR_FIELD_LIST
5966 }
5967 #[inline]
5968 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD_LIST }
5969 #[inline]
5970 fn cast(syntax: SyntaxNode) -> Option<Self> {
5971 if Self::can_cast(syntax.kind()) {
5972 Some(Self { syntax })
5973 } else {
5974 None
5975 }
5976 }
5977 #[inline]
5978 fn syntax(&self) -> &SyntaxNode { &self.syntax }
5979}
5980impl hash::Hash for RecordExprFieldList {
5981 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
5982}
5983impl Eq for RecordExprFieldList {}
5984impl PartialEq for RecordExprFieldList {
5985 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
5986}
5987impl Clone for RecordExprFieldList {
5988 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
5989}
5990impl fmt::Debug for RecordExprFieldList {
5991 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5992 f.debug_struct("RecordExprFieldList").field("syntax", &self.syntax).finish()
5993 }
5994}
5995impl AstNode for RecordField {
5996 #[inline]
5997 fn kind() -> SyntaxKind
5998 where
5999 Self: Sized,
6000 {
6001 RECORD_FIELD
6002 }
6003 #[inline]
6004 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD }
6005 #[inline]
6006 fn cast(syntax: SyntaxNode) -> Option<Self> {
6007 if Self::can_cast(syntax.kind()) {
6008 Some(Self { syntax })
6009 } else {
6010 None
6011 }
6012 }
6013 #[inline]
6014 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6015}
6016impl hash::Hash for RecordField {
6017 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6018}
6019impl Eq for RecordField {}
6020impl PartialEq for RecordField {
6021 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6022}
6023impl Clone for RecordField {
6024 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6025}
6026impl fmt::Debug for RecordField {
6027 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6028 f.debug_struct("RecordField").field("syntax", &self.syntax).finish()
6029 }
6030}
6031impl AstNode for RecordFieldList {
6032 #[inline]
6033 fn kind() -> SyntaxKind
6034 where
6035 Self: Sized,
6036 {
6037 RECORD_FIELD_LIST
6038 }
6039 #[inline]
6040 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_LIST }
6041 #[inline]
6042 fn cast(syntax: SyntaxNode) -> Option<Self> {
6043 if Self::can_cast(syntax.kind()) {
6044 Some(Self { syntax })
6045 } else {
6046 None
6047 }
6048 }
6049 #[inline]
6050 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6051}
6052impl hash::Hash for RecordFieldList {
6053 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6054}
6055impl Eq for RecordFieldList {}
6056impl PartialEq for RecordFieldList {
6057 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6058}
6059impl Clone for RecordFieldList {
6060 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6061}
6062impl fmt::Debug for RecordFieldList {
6063 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6064 f.debug_struct("RecordFieldList").field("syntax", &self.syntax).finish()
6065 }
6066}
6067impl AstNode for RecordPat {
6068 #[inline]
6069 fn kind() -> SyntaxKind
6070 where
6071 Self: Sized,
6072 {
6073 RECORD_PAT
6074 }
6075 #[inline]
6076 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_PAT }
6077 #[inline]
6078 fn cast(syntax: SyntaxNode) -> Option<Self> {
6079 if Self::can_cast(syntax.kind()) {
6080 Some(Self { syntax })
6081 } else {
6082 None
6083 }
6084 }
6085 #[inline]
6086 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6087}
6088impl hash::Hash for RecordPat {
6089 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6090}
6091impl Eq for RecordPat {}
6092impl PartialEq for RecordPat {
6093 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6094}
6095impl Clone for RecordPat {
6096 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6097}
6098impl fmt::Debug for RecordPat {
6099 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6100 f.debug_struct("RecordPat").field("syntax", &self.syntax).finish()
6101 }
6102}
6103impl AstNode for RecordPatField {
6104 #[inline]
6105 fn kind() -> SyntaxKind
6106 where
6107 Self: Sized,
6108 {
6109 RECORD_PAT_FIELD
6110 }
6111 #[inline]
6112 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_PAT_FIELD }
6113 #[inline]
6114 fn cast(syntax: SyntaxNode) -> Option<Self> {
6115 if Self::can_cast(syntax.kind()) {
6116 Some(Self { syntax })
6117 } else {
6118 None
6119 }
6120 }
6121 #[inline]
6122 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6123}
6124impl hash::Hash for RecordPatField {
6125 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6126}
6127impl Eq for RecordPatField {}
6128impl PartialEq for RecordPatField {
6129 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6130}
6131impl Clone for RecordPatField {
6132 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6133}
6134impl fmt::Debug for RecordPatField {
6135 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6136 f.debug_struct("RecordPatField").field("syntax", &self.syntax).finish()
6137 }
6138}
6139impl AstNode for RecordPatFieldList {
6140 #[inline]
6141 fn kind() -> SyntaxKind
6142 where
6143 Self: Sized,
6144 {
6145 RECORD_PAT_FIELD_LIST
6146 }
6147 #[inline]
6148 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_PAT_FIELD_LIST }
6149 #[inline]
6150 fn cast(syntax: SyntaxNode) -> Option<Self> {
6151 if Self::can_cast(syntax.kind()) {
6152 Some(Self { syntax })
6153 } else {
6154 None
6155 }
6156 }
6157 #[inline]
6158 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6159}
6160impl hash::Hash for RecordPatFieldList {
6161 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6162}
6163impl Eq for RecordPatFieldList {}
6164impl PartialEq for RecordPatFieldList {
6165 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6166}
6167impl Clone for RecordPatFieldList {
6168 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6169}
6170impl fmt::Debug for RecordPatFieldList {
6171 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6172 f.debug_struct("RecordPatFieldList").field("syntax", &self.syntax).finish()
6173 }
6174}
6175impl AstNode for RefExpr {
6176 #[inline]
6177 fn kind() -> SyntaxKind
6178 where
6179 Self: Sized,
6180 {
6181 REF_EXPR
6182 }
6183 #[inline]
6184 fn can_cast(kind: SyntaxKind) -> bool { kind == REF_EXPR }
6185 #[inline]
6186 fn cast(syntax: SyntaxNode) -> Option<Self> {
6187 if Self::can_cast(syntax.kind()) {
6188 Some(Self { syntax })
6189 } else {
6190 None
6191 }
6192 }
6193 #[inline]
6194 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6195}
6196impl hash::Hash for RefExpr {
6197 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6198}
6199impl Eq for RefExpr {}
6200impl PartialEq for RefExpr {
6201 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6202}
6203impl Clone for RefExpr {
6204 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6205}
6206impl fmt::Debug for RefExpr {
6207 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6208 f.debug_struct("RefExpr").field("syntax", &self.syntax).finish()
6209 }
6210}
6211impl AstNode for RefPat {
6212 #[inline]
6213 fn kind() -> SyntaxKind
6214 where
6215 Self: Sized,
6216 {
6217 REF_PAT
6218 }
6219 #[inline]
6220 fn can_cast(kind: SyntaxKind) -> bool { kind == REF_PAT }
6221 #[inline]
6222 fn cast(syntax: SyntaxNode) -> Option<Self> {
6223 if Self::can_cast(syntax.kind()) {
6224 Some(Self { syntax })
6225 } else {
6226 None
6227 }
6228 }
6229 #[inline]
6230 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6231}
6232impl hash::Hash for RefPat {
6233 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6234}
6235impl Eq for RefPat {}
6236impl PartialEq for RefPat {
6237 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6238}
6239impl Clone for RefPat {
6240 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6241}
6242impl fmt::Debug for RefPat {
6243 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6244 f.debug_struct("RefPat").field("syntax", &self.syntax).finish()
6245 }
6246}
6247impl AstNode for RefType {
6248 #[inline]
6249 fn kind() -> SyntaxKind
6250 where
6251 Self: Sized,
6252 {
6253 REF_TYPE
6254 }
6255 #[inline]
6256 fn can_cast(kind: SyntaxKind) -> bool { kind == REF_TYPE }
6257 #[inline]
6258 fn cast(syntax: SyntaxNode) -> Option<Self> {
6259 if Self::can_cast(syntax.kind()) {
6260 Some(Self { syntax })
6261 } else {
6262 None
6263 }
6264 }
6265 #[inline]
6266 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6267}
6268impl hash::Hash for RefType {
6269 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6270}
6271impl Eq for RefType {}
6272impl PartialEq for RefType {
6273 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6274}
6275impl Clone for RefType {
6276 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6277}
6278impl fmt::Debug for RefType {
6279 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6280 f.debug_struct("RefType").field("syntax", &self.syntax).finish()
6281 }
6282}
6283impl AstNode for Rename {
6284 #[inline]
6285 fn kind() -> SyntaxKind
6286 where
6287 Self: Sized,
6288 {
6289 RENAME
6290 }
6291 #[inline]
6292 fn can_cast(kind: SyntaxKind) -> bool { kind == RENAME }
6293 #[inline]
6294 fn cast(syntax: SyntaxNode) -> Option<Self> {
6295 if Self::can_cast(syntax.kind()) {
6296 Some(Self { syntax })
6297 } else {
6298 None
6299 }
6300 }
6301 #[inline]
6302 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6303}
6304impl hash::Hash for Rename {
6305 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6306}
6307impl Eq for Rename {}
6308impl PartialEq for Rename {
6309 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6310}
6311impl Clone for Rename {
6312 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6313}
6314impl fmt::Debug for Rename {
6315 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6316 f.debug_struct("Rename").field("syntax", &self.syntax).finish()
6317 }
6318}
6319impl AstNode for RestPat {
6320 #[inline]
6321 fn kind() -> SyntaxKind
6322 where
6323 Self: Sized,
6324 {
6325 REST_PAT
6326 }
6327 #[inline]
6328 fn can_cast(kind: SyntaxKind) -> bool { kind == REST_PAT }
6329 #[inline]
6330 fn cast(syntax: SyntaxNode) -> Option<Self> {
6331 if Self::can_cast(syntax.kind()) {
6332 Some(Self { syntax })
6333 } else {
6334 None
6335 }
6336 }
6337 #[inline]
6338 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6339}
6340impl hash::Hash for RestPat {
6341 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6342}
6343impl Eq for RestPat {}
6344impl PartialEq for RestPat {
6345 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6346}
6347impl Clone for RestPat {
6348 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6349}
6350impl fmt::Debug for RestPat {
6351 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6352 f.debug_struct("RestPat").field("syntax", &self.syntax).finish()
6353 }
6354}
6355impl AstNode for RetType {
6356 #[inline]
6357 fn kind() -> SyntaxKind
6358 where
6359 Self: Sized,
6360 {
6361 RET_TYPE
6362 }
6363 #[inline]
6364 fn can_cast(kind: SyntaxKind) -> bool { kind == RET_TYPE }
6365 #[inline]
6366 fn cast(syntax: SyntaxNode) -> Option<Self> {
6367 if Self::can_cast(syntax.kind()) {
6368 Some(Self { syntax })
6369 } else {
6370 None
6371 }
6372 }
6373 #[inline]
6374 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6375}
6376impl hash::Hash for RetType {
6377 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6378}
6379impl Eq for RetType {}
6380impl PartialEq for RetType {
6381 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6382}
6383impl Clone for RetType {
6384 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6385}
6386impl fmt::Debug for RetType {
6387 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6388 f.debug_struct("RetType").field("syntax", &self.syntax).finish()
6389 }
6390}
6391impl AstNode for ReturnExpr {
6392 #[inline]
6393 fn kind() -> SyntaxKind
6394 where
6395 Self: Sized,
6396 {
6397 RETURN_EXPR
6398 }
6399 #[inline]
6400 fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_EXPR }
6401 #[inline]
6402 fn cast(syntax: SyntaxNode) -> Option<Self> {
6403 if Self::can_cast(syntax.kind()) {
6404 Some(Self { syntax })
6405 } else {
6406 None
6407 }
6408 }
6409 #[inline]
6410 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6411}
6412impl hash::Hash for ReturnExpr {
6413 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6414}
6415impl Eq for ReturnExpr {}
6416impl PartialEq for ReturnExpr {
6417 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6418}
6419impl Clone for ReturnExpr {
6420 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6421}
6422impl fmt::Debug for ReturnExpr {
6423 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6424 f.debug_struct("ReturnExpr").field("syntax", &self.syntax).finish()
6425 }
6426}
6427impl AstNode for ReturnTypeSyntax {
6428 #[inline]
6429 fn kind() -> SyntaxKind
6430 where
6431 Self: Sized,
6432 {
6433 RETURN_TYPE_SYNTAX
6434 }
6435 #[inline]
6436 fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_TYPE_SYNTAX }
6437 #[inline]
6438 fn cast(syntax: SyntaxNode) -> Option<Self> {
6439 if Self::can_cast(syntax.kind()) {
6440 Some(Self { syntax })
6441 } else {
6442 None
6443 }
6444 }
6445 #[inline]
6446 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6447}
6448impl hash::Hash for ReturnTypeSyntax {
6449 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6450}
6451impl Eq for ReturnTypeSyntax {}
6452impl PartialEq for ReturnTypeSyntax {
6453 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6454}
6455impl Clone for ReturnTypeSyntax {
6456 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6457}
6458impl fmt::Debug for ReturnTypeSyntax {
6459 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6460 f.debug_struct("ReturnTypeSyntax").field("syntax", &self.syntax).finish()
6461 }
6462}
6463impl AstNode for SelfParam {
6464 #[inline]
6465 fn kind() -> SyntaxKind
6466 where
6467 Self: Sized,
6468 {
6469 SELF_PARAM
6470 }
6471 #[inline]
6472 fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM }
6473 #[inline]
6474 fn cast(syntax: SyntaxNode) -> Option<Self> {
6475 if Self::can_cast(syntax.kind()) {
6476 Some(Self { syntax })
6477 } else {
6478 None
6479 }
6480 }
6481 #[inline]
6482 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6483}
6484impl hash::Hash for SelfParam {
6485 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6486}
6487impl Eq for SelfParam {}
6488impl PartialEq for SelfParam {
6489 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6490}
6491impl Clone for SelfParam {
6492 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6493}
6494impl fmt::Debug for SelfParam {
6495 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6496 f.debug_struct("SelfParam").field("syntax", &self.syntax).finish()
6497 }
6498}
6499impl AstNode for SlicePat {
6500 #[inline]
6501 fn kind() -> SyntaxKind
6502 where
6503 Self: Sized,
6504 {
6505 SLICE_PAT
6506 }
6507 #[inline]
6508 fn can_cast(kind: SyntaxKind) -> bool { kind == SLICE_PAT }
6509 #[inline]
6510 fn cast(syntax: SyntaxNode) -> Option<Self> {
6511 if Self::can_cast(syntax.kind()) {
6512 Some(Self { syntax })
6513 } else {
6514 None
6515 }
6516 }
6517 #[inline]
6518 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6519}
6520impl hash::Hash for SlicePat {
6521 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6522}
6523impl Eq for SlicePat {}
6524impl PartialEq for SlicePat {
6525 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6526}
6527impl Clone for SlicePat {
6528 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6529}
6530impl fmt::Debug for SlicePat {
6531 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6532 f.debug_struct("SlicePat").field("syntax", &self.syntax).finish()
6533 }
6534}
6535impl AstNode for SliceType {
6536 #[inline]
6537 fn kind() -> SyntaxKind
6538 where
6539 Self: Sized,
6540 {
6541 SLICE_TYPE
6542 }
6543 #[inline]
6544 fn can_cast(kind: SyntaxKind) -> bool { kind == SLICE_TYPE }
6545 #[inline]
6546 fn cast(syntax: SyntaxNode) -> Option<Self> {
6547 if Self::can_cast(syntax.kind()) {
6548 Some(Self { syntax })
6549 } else {
6550 None
6551 }
6552 }
6553 #[inline]
6554 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6555}
6556impl hash::Hash for SliceType {
6557 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6558}
6559impl Eq for SliceType {}
6560impl PartialEq for SliceType {
6561 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6562}
6563impl Clone for SliceType {
6564 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6565}
6566impl fmt::Debug for SliceType {
6567 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6568 f.debug_struct("SliceType").field("syntax", &self.syntax).finish()
6569 }
6570}
6571impl AstNode for SourceFile {
6572 #[inline]
6573 fn kind() -> SyntaxKind
6574 where
6575 Self: Sized,
6576 {
6577 SOURCE_FILE
6578 }
6579 #[inline]
6580 fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE }
6581 #[inline]
6582 fn cast(syntax: SyntaxNode) -> Option<Self> {
6583 if Self::can_cast(syntax.kind()) {
6584 Some(Self { syntax })
6585 } else {
6586 None
6587 }
6588 }
6589 #[inline]
6590 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6591}
6592impl hash::Hash for SourceFile {
6593 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6594}
6595impl Eq for SourceFile {}
6596impl PartialEq for SourceFile {
6597 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6598}
6599impl Clone for SourceFile {
6600 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6601}
6602impl fmt::Debug for SourceFile {
6603 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6604 f.debug_struct("SourceFile").field("syntax", &self.syntax).finish()
6605 }
6606}
6607impl AstNode for Static {
6608 #[inline]
6609 fn kind() -> SyntaxKind
6610 where
6611 Self: Sized,
6612 {
6613 STATIC
6614 }
6615 #[inline]
6616 fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC }
6617 #[inline]
6618 fn cast(syntax: SyntaxNode) -> Option<Self> {
6619 if Self::can_cast(syntax.kind()) {
6620 Some(Self { syntax })
6621 } else {
6622 None
6623 }
6624 }
6625 #[inline]
6626 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6627}
6628impl hash::Hash for Static {
6629 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6630}
6631impl Eq for Static {}
6632impl PartialEq for Static {
6633 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6634}
6635impl Clone for Static {
6636 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6637}
6638impl fmt::Debug for Static {
6639 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6640 f.debug_struct("Static").field("syntax", &self.syntax).finish()
6641 }
6642}
6643impl AstNode for StmtList {
6644 #[inline]
6645 fn kind() -> SyntaxKind
6646 where
6647 Self: Sized,
6648 {
6649 STMT_LIST
6650 }
6651 #[inline]
6652 fn can_cast(kind: SyntaxKind) -> bool { kind == STMT_LIST }
6653 #[inline]
6654 fn cast(syntax: SyntaxNode) -> Option<Self> {
6655 if Self::can_cast(syntax.kind()) {
6656 Some(Self { syntax })
6657 } else {
6658 None
6659 }
6660 }
6661 #[inline]
6662 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6663}
6664impl hash::Hash for StmtList {
6665 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6666}
6667impl Eq for StmtList {}
6668impl PartialEq for StmtList {
6669 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6670}
6671impl Clone for StmtList {
6672 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6673}
6674impl fmt::Debug for StmtList {
6675 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6676 f.debug_struct("StmtList").field("syntax", &self.syntax).finish()
6677 }
6678}
6679impl AstNode for Struct {
6680 #[inline]
6681 fn kind() -> SyntaxKind
6682 where
6683 Self: Sized,
6684 {
6685 STRUCT
6686 }
6687 #[inline]
6688 fn can_cast(kind: SyntaxKind) -> bool { kind == STRUCT }
6689 #[inline]
6690 fn cast(syntax: SyntaxNode) -> Option<Self> {
6691 if Self::can_cast(syntax.kind()) {
6692 Some(Self { syntax })
6693 } else {
6694 None
6695 }
6696 }
6697 #[inline]
6698 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6699}
6700impl hash::Hash for Struct {
6701 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6702}
6703impl Eq for Struct {}
6704impl PartialEq for Struct {
6705 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6706}
6707impl Clone for Struct {
6708 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6709}
6710impl fmt::Debug for Struct {
6711 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6712 f.debug_struct("Struct").field("syntax", &self.syntax).finish()
6713 }
6714}
6715impl AstNode for TokenTree {
6716 #[inline]
6717 fn kind() -> SyntaxKind
6718 where
6719 Self: Sized,
6720 {
6721 TOKEN_TREE
6722 }
6723 #[inline]
6724 fn can_cast(kind: SyntaxKind) -> bool { kind == TOKEN_TREE }
6725 #[inline]
6726 fn cast(syntax: SyntaxNode) -> Option<Self> {
6727 if Self::can_cast(syntax.kind()) {
6728 Some(Self { syntax })
6729 } else {
6730 None
6731 }
6732 }
6733 #[inline]
6734 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6735}
6736impl hash::Hash for TokenTree {
6737 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6738}
6739impl Eq for TokenTree {}
6740impl PartialEq for TokenTree {
6741 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6742}
6743impl Clone for TokenTree {
6744 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6745}
6746impl fmt::Debug for TokenTree {
6747 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6748 f.debug_struct("TokenTree").field("syntax", &self.syntax).finish()
6749 }
6750}
6751impl AstNode for Trait {
6752 #[inline]
6753 fn kind() -> SyntaxKind
6754 where
6755 Self: Sized,
6756 {
6757 TRAIT
6758 }
6759 #[inline]
6760 fn can_cast(kind: SyntaxKind) -> bool { kind == TRAIT }
6761 #[inline]
6762 fn cast(syntax: SyntaxNode) -> Option<Self> {
6763 if Self::can_cast(syntax.kind()) {
6764 Some(Self { syntax })
6765 } else {
6766 None
6767 }
6768 }
6769 #[inline]
6770 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6771}
6772impl hash::Hash for Trait {
6773 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6774}
6775impl Eq for Trait {}
6776impl PartialEq for Trait {
6777 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6778}
6779impl Clone for Trait {
6780 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6781}
6782impl fmt::Debug for Trait {
6783 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6784 f.debug_struct("Trait").field("syntax", &self.syntax).finish()
6785 }
6786}
6787impl AstNode for TraitAlias {
6788 #[inline]
6789 fn kind() -> SyntaxKind
6790 where
6791 Self: Sized,
6792 {
6793 TRAIT_ALIAS
6794 }
6795 #[inline]
6796 fn can_cast(kind: SyntaxKind) -> bool { kind == TRAIT_ALIAS }
6797 #[inline]
6798 fn cast(syntax: SyntaxNode) -> Option<Self> {
6799 if Self::can_cast(syntax.kind()) {
6800 Some(Self { syntax })
6801 } else {
6802 None
6803 }
6804 }
6805 #[inline]
6806 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6807}
6808impl hash::Hash for TraitAlias {
6809 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6810}
6811impl Eq for TraitAlias {}
6812impl PartialEq for TraitAlias {
6813 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6814}
6815impl Clone for TraitAlias {
6816 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6817}
6818impl fmt::Debug for TraitAlias {
6819 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6820 f.debug_struct("TraitAlias").field("syntax", &self.syntax).finish()
6821 }
6822}
6823impl AstNode for TryExpr {
6824 #[inline]
6825 fn kind() -> SyntaxKind
6826 where
6827 Self: Sized,
6828 {
6829 TRY_EXPR
6830 }
6831 #[inline]
6832 fn can_cast(kind: SyntaxKind) -> bool { kind == TRY_EXPR }
6833 #[inline]
6834 fn cast(syntax: SyntaxNode) -> Option<Self> {
6835 if Self::can_cast(syntax.kind()) {
6836 Some(Self { syntax })
6837 } else {
6838 None
6839 }
6840 }
6841 #[inline]
6842 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6843}
6844impl hash::Hash for TryExpr {
6845 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6846}
6847impl Eq for TryExpr {}
6848impl PartialEq for TryExpr {
6849 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6850}
6851impl Clone for TryExpr {
6852 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6853}
6854impl fmt::Debug for TryExpr {
6855 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6856 f.debug_struct("TryExpr").field("syntax", &self.syntax).finish()
6857 }
6858}
6859impl AstNode for TupleExpr {
6860 #[inline]
6861 fn kind() -> SyntaxKind
6862 where
6863 Self: Sized,
6864 {
6865 TUPLE_EXPR
6866 }
6867 #[inline]
6868 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_EXPR }
6869 #[inline]
6870 fn cast(syntax: SyntaxNode) -> Option<Self> {
6871 if Self::can_cast(syntax.kind()) {
6872 Some(Self { syntax })
6873 } else {
6874 None
6875 }
6876 }
6877 #[inline]
6878 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6879}
6880impl hash::Hash for TupleExpr {
6881 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6882}
6883impl Eq for TupleExpr {}
6884impl PartialEq for TupleExpr {
6885 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6886}
6887impl Clone for TupleExpr {
6888 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6889}
6890impl fmt::Debug for TupleExpr {
6891 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6892 f.debug_struct("TupleExpr").field("syntax", &self.syntax).finish()
6893 }
6894}
6895impl AstNode for TupleField {
6896 #[inline]
6897 fn kind() -> SyntaxKind
6898 where
6899 Self: Sized,
6900 {
6901 TUPLE_FIELD
6902 }
6903 #[inline]
6904 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD }
6905 #[inline]
6906 fn cast(syntax: SyntaxNode) -> Option<Self> {
6907 if Self::can_cast(syntax.kind()) {
6908 Some(Self { syntax })
6909 } else {
6910 None
6911 }
6912 }
6913 #[inline]
6914 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6915}
6916impl hash::Hash for TupleField {
6917 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6918}
6919impl Eq for TupleField {}
6920impl PartialEq for TupleField {
6921 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6922}
6923impl Clone for TupleField {
6924 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6925}
6926impl fmt::Debug for TupleField {
6927 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6928 f.debug_struct("TupleField").field("syntax", &self.syntax).finish()
6929 }
6930}
6931impl AstNode for TupleFieldList {
6932 #[inline]
6933 fn kind() -> SyntaxKind
6934 where
6935 Self: Sized,
6936 {
6937 TUPLE_FIELD_LIST
6938 }
6939 #[inline]
6940 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_FIELD_LIST }
6941 #[inline]
6942 fn cast(syntax: SyntaxNode) -> Option<Self> {
6943 if Self::can_cast(syntax.kind()) {
6944 Some(Self { syntax })
6945 } else {
6946 None
6947 }
6948 }
6949 #[inline]
6950 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6951}
6952impl hash::Hash for TupleFieldList {
6953 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6954}
6955impl Eq for TupleFieldList {}
6956impl PartialEq for TupleFieldList {
6957 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6958}
6959impl Clone for TupleFieldList {
6960 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6961}
6962impl fmt::Debug for TupleFieldList {
6963 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6964 f.debug_struct("TupleFieldList").field("syntax", &self.syntax).finish()
6965 }
6966}
6967impl AstNode for TuplePat {
6968 #[inline]
6969 fn kind() -> SyntaxKind
6970 where
6971 Self: Sized,
6972 {
6973 TUPLE_PAT
6974 }
6975 #[inline]
6976 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_PAT }
6977 #[inline]
6978 fn cast(syntax: SyntaxNode) -> Option<Self> {
6979 if Self::can_cast(syntax.kind()) {
6980 Some(Self { syntax })
6981 } else {
6982 None
6983 }
6984 }
6985 #[inline]
6986 fn syntax(&self) -> &SyntaxNode { &self.syntax }
6987}
6988impl hash::Hash for TuplePat {
6989 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
6990}
6991impl Eq for TuplePat {}
6992impl PartialEq for TuplePat {
6993 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
6994}
6995impl Clone for TuplePat {
6996 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
6997}
6998impl fmt::Debug for TuplePat {
6999 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7000 f.debug_struct("TuplePat").field("syntax", &self.syntax).finish()
7001 }
7002}
7003impl AstNode for TupleStructPat {
7004 #[inline]
7005 fn kind() -> SyntaxKind
7006 where
7007 Self: Sized,
7008 {
7009 TUPLE_STRUCT_PAT
7010 }
7011 #[inline]
7012 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_STRUCT_PAT }
7013 #[inline]
7014 fn cast(syntax: SyntaxNode) -> Option<Self> {
7015 if Self::can_cast(syntax.kind()) {
7016 Some(Self { syntax })
7017 } else {
7018 None
7019 }
7020 }
7021 #[inline]
7022 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7023}
7024impl hash::Hash for TupleStructPat {
7025 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7026}
7027impl Eq for TupleStructPat {}
7028impl PartialEq for TupleStructPat {
7029 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7030}
7031impl Clone for TupleStructPat {
7032 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7033}
7034impl fmt::Debug for TupleStructPat {
7035 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7036 f.debug_struct("TupleStructPat").field("syntax", &self.syntax).finish()
7037 }
7038}
7039impl AstNode for TupleType {
7040 #[inline]
7041 fn kind() -> SyntaxKind
7042 where
7043 Self: Sized,
7044 {
7045 TUPLE_TYPE
7046 }
7047 #[inline]
7048 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_TYPE }
7049 #[inline]
7050 fn cast(syntax: SyntaxNode) -> Option<Self> {
7051 if Self::can_cast(syntax.kind()) {
7052 Some(Self { syntax })
7053 } else {
7054 None
7055 }
7056 }
7057 #[inline]
7058 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7059}
7060impl hash::Hash for TupleType {
7061 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7062}
7063impl Eq for TupleType {}
7064impl PartialEq for TupleType {
7065 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7066}
7067impl Clone for TupleType {
7068 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7069}
7070impl fmt::Debug for TupleType {
7071 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7072 f.debug_struct("TupleType").field("syntax", &self.syntax).finish()
7073 }
7074}
7075impl AstNode for TypeAlias {
7076 #[inline]
7077 fn kind() -> SyntaxKind
7078 where
7079 Self: Sized,
7080 {
7081 TYPE_ALIAS
7082 }
7083 #[inline]
7084 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ALIAS }
7085 #[inline]
7086 fn cast(syntax: SyntaxNode) -> Option<Self> {
7087 if Self::can_cast(syntax.kind()) {
7088 Some(Self { syntax })
7089 } else {
7090 None
7091 }
7092 }
7093 #[inline]
7094 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7095}
7096impl hash::Hash for TypeAlias {
7097 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7098}
7099impl Eq for TypeAlias {}
7100impl PartialEq for TypeAlias {
7101 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7102}
7103impl Clone for TypeAlias {
7104 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7105}
7106impl fmt::Debug for TypeAlias {
7107 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7108 f.debug_struct("TypeAlias").field("syntax", &self.syntax).finish()
7109 }
7110}
7111impl AstNode for TypeArg {
7112 #[inline]
7113 fn kind() -> SyntaxKind
7114 where
7115 Self: Sized,
7116 {
7117 TYPE_ARG
7118 }
7119 #[inline]
7120 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ARG }
7121 #[inline]
7122 fn cast(syntax: SyntaxNode) -> Option<Self> {
7123 if Self::can_cast(syntax.kind()) {
7124 Some(Self { syntax })
7125 } else {
7126 None
7127 }
7128 }
7129 #[inline]
7130 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7131}
7132impl hash::Hash for TypeArg {
7133 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7134}
7135impl Eq for TypeArg {}
7136impl PartialEq for TypeArg {
7137 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7138}
7139impl Clone for TypeArg {
7140 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7141}
7142impl fmt::Debug for TypeArg {
7143 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7144 f.debug_struct("TypeArg").field("syntax", &self.syntax).finish()
7145 }
7146}
7147impl AstNode for TypeBound {
7148 #[inline]
7149 fn kind() -> SyntaxKind
7150 where
7151 Self: Sized,
7152 {
7153 TYPE_BOUND
7154 }
7155 #[inline]
7156 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND }
7157 #[inline]
7158 fn cast(syntax: SyntaxNode) -> Option<Self> {
7159 if Self::can_cast(syntax.kind()) {
7160 Some(Self { syntax })
7161 } else {
7162 None
7163 }
7164 }
7165 #[inline]
7166 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7167}
7168impl hash::Hash for TypeBound {
7169 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7170}
7171impl Eq for TypeBound {}
7172impl PartialEq for TypeBound {
7173 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7174}
7175impl Clone for TypeBound {
7176 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7177}
7178impl fmt::Debug for TypeBound {
7179 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7180 f.debug_struct("TypeBound").field("syntax", &self.syntax).finish()
7181 }
7182}
7183impl AstNode for TypeBoundList {
7184 #[inline]
7185 fn kind() -> SyntaxKind
7186 where
7187 Self: Sized,
7188 {
7189 TYPE_BOUND_LIST
7190 }
7191 #[inline]
7192 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST }
7193 #[inline]
7194 fn cast(syntax: SyntaxNode) -> Option<Self> {
7195 if Self::can_cast(syntax.kind()) {
7196 Some(Self { syntax })
7197 } else {
7198 None
7199 }
7200 }
7201 #[inline]
7202 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7203}
7204impl hash::Hash for TypeBoundList {
7205 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7206}
7207impl Eq for TypeBoundList {}
7208impl PartialEq for TypeBoundList {
7209 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7210}
7211impl Clone for TypeBoundList {
7212 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7213}
7214impl fmt::Debug for TypeBoundList {
7215 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7216 f.debug_struct("TypeBoundList").field("syntax", &self.syntax).finish()
7217 }
7218}
7219impl AstNode for TypeParam {
7220 #[inline]
7221 fn kind() -> SyntaxKind
7222 where
7223 Self: Sized,
7224 {
7225 TYPE_PARAM
7226 }
7227 #[inline]
7228 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_PARAM }
7229 #[inline]
7230 fn cast(syntax: SyntaxNode) -> Option<Self> {
7231 if Self::can_cast(syntax.kind()) {
7232 Some(Self { syntax })
7233 } else {
7234 None
7235 }
7236 }
7237 #[inline]
7238 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7239}
7240impl hash::Hash for TypeParam {
7241 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7242}
7243impl Eq for TypeParam {}
7244impl PartialEq for TypeParam {
7245 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7246}
7247impl Clone for TypeParam {
7248 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7249}
7250impl fmt::Debug for TypeParam {
7251 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7252 f.debug_struct("TypeParam").field("syntax", &self.syntax).finish()
7253 }
7254}
7255impl AstNode for UnderscoreExpr {
7256 #[inline]
7257 fn kind() -> SyntaxKind
7258 where
7259 Self: Sized,
7260 {
7261 UNDERSCORE_EXPR
7262 }
7263 #[inline]
7264 fn can_cast(kind: SyntaxKind) -> bool { kind == UNDERSCORE_EXPR }
7265 #[inline]
7266 fn cast(syntax: SyntaxNode) -> Option<Self> {
7267 if Self::can_cast(syntax.kind()) {
7268 Some(Self { syntax })
7269 } else {
7270 None
7271 }
7272 }
7273 #[inline]
7274 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7275}
7276impl hash::Hash for UnderscoreExpr {
7277 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7278}
7279impl Eq for UnderscoreExpr {}
7280impl PartialEq for UnderscoreExpr {
7281 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7282}
7283impl Clone for UnderscoreExpr {
7284 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7285}
7286impl fmt::Debug for UnderscoreExpr {
7287 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7288 f.debug_struct("UnderscoreExpr").field("syntax", &self.syntax).finish()
7289 }
7290}
7291impl AstNode for Union {
7292 #[inline]
7293 fn kind() -> SyntaxKind
7294 where
7295 Self: Sized,
7296 {
7297 UNION
7298 }
7299 #[inline]
7300 fn can_cast(kind: SyntaxKind) -> bool { kind == UNION }
7301 #[inline]
7302 fn cast(syntax: SyntaxNode) -> Option<Self> {
7303 if Self::can_cast(syntax.kind()) {
7304 Some(Self { syntax })
7305 } else {
7306 None
7307 }
7308 }
7309 #[inline]
7310 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7311}
7312impl hash::Hash for Union {
7313 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7314}
7315impl Eq for Union {}
7316impl PartialEq for Union {
7317 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7318}
7319impl Clone for Union {
7320 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7321}
7322impl fmt::Debug for Union {
7323 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7324 f.debug_struct("Union").field("syntax", &self.syntax).finish()
7325 }
7326}
7327impl AstNode for Use {
7328 #[inline]
7329 fn kind() -> SyntaxKind
7330 where
7331 Self: Sized,
7332 {
7333 USE
7334 }
7335 #[inline]
7336 fn can_cast(kind: SyntaxKind) -> bool { kind == USE }
7337 #[inline]
7338 fn cast(syntax: SyntaxNode) -> Option<Self> {
7339 if Self::can_cast(syntax.kind()) {
7340 Some(Self { syntax })
7341 } else {
7342 None
7343 }
7344 }
7345 #[inline]
7346 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7347}
7348impl hash::Hash for Use {
7349 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7350}
7351impl Eq for Use {}
7352impl PartialEq for Use {
7353 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7354}
7355impl Clone for Use {
7356 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7357}
7358impl fmt::Debug for Use {
7359 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7360 f.debug_struct("Use").field("syntax", &self.syntax).finish()
7361 }
7362}
7363impl AstNode for UseBoundGenericArgs {
7364 #[inline]
7365 fn kind() -> SyntaxKind
7366 where
7367 Self: Sized,
7368 {
7369 USE_BOUND_GENERIC_ARGS
7370 }
7371 #[inline]
7372 fn can_cast(kind: SyntaxKind) -> bool { kind == USE_BOUND_GENERIC_ARGS }
7373 #[inline]
7374 fn cast(syntax: SyntaxNode) -> Option<Self> {
7375 if Self::can_cast(syntax.kind()) {
7376 Some(Self { syntax })
7377 } else {
7378 None
7379 }
7380 }
7381 #[inline]
7382 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7383}
7384impl hash::Hash for UseBoundGenericArgs {
7385 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7386}
7387impl Eq for UseBoundGenericArgs {}
7388impl PartialEq for UseBoundGenericArgs {
7389 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7390}
7391impl Clone for UseBoundGenericArgs {
7392 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7393}
7394impl fmt::Debug for UseBoundGenericArgs {
7395 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7396 f.debug_struct("UseBoundGenericArgs").field("syntax", &self.syntax).finish()
7397 }
7398}
7399impl AstNode for UseTree {
7400 #[inline]
7401 fn kind() -> SyntaxKind
7402 where
7403 Self: Sized,
7404 {
7405 USE_TREE
7406 }
7407 #[inline]
7408 fn can_cast(kind: SyntaxKind) -> bool { kind == USE_TREE }
7409 #[inline]
7410 fn cast(syntax: SyntaxNode) -> Option<Self> {
7411 if Self::can_cast(syntax.kind()) {
7412 Some(Self { syntax })
7413 } else {
7414 None
7415 }
7416 }
7417 #[inline]
7418 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7419}
7420impl hash::Hash for UseTree {
7421 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7422}
7423impl Eq for UseTree {}
7424impl PartialEq for UseTree {
7425 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7426}
7427impl Clone for UseTree {
7428 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7429}
7430impl fmt::Debug for UseTree {
7431 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7432 f.debug_struct("UseTree").field("syntax", &self.syntax).finish()
7433 }
7434}
7435impl AstNode for UseTreeList {
7436 #[inline]
7437 fn kind() -> SyntaxKind
7438 where
7439 Self: Sized,
7440 {
7441 USE_TREE_LIST
7442 }
7443 #[inline]
7444 fn can_cast(kind: SyntaxKind) -> bool { kind == USE_TREE_LIST }
7445 #[inline]
7446 fn cast(syntax: SyntaxNode) -> Option<Self> {
7447 if Self::can_cast(syntax.kind()) {
7448 Some(Self { syntax })
7449 } else {
7450 None
7451 }
7452 }
7453 #[inline]
7454 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7455}
7456impl hash::Hash for UseTreeList {
7457 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7458}
7459impl Eq for UseTreeList {}
7460impl PartialEq for UseTreeList {
7461 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7462}
7463impl Clone for UseTreeList {
7464 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7465}
7466impl fmt::Debug for UseTreeList {
7467 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7468 f.debug_struct("UseTreeList").field("syntax", &self.syntax).finish()
7469 }
7470}
7471impl AstNode for Variant {
7472 #[inline]
7473 fn kind() -> SyntaxKind
7474 where
7475 Self: Sized,
7476 {
7477 VARIANT
7478 }
7479 #[inline]
7480 fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT }
7481 #[inline]
7482 fn cast(syntax: SyntaxNode) -> Option<Self> {
7483 if Self::can_cast(syntax.kind()) {
7484 Some(Self { syntax })
7485 } else {
7486 None
7487 }
7488 }
7489 #[inline]
7490 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7491}
7492impl hash::Hash for Variant {
7493 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7494}
7495impl Eq for Variant {}
7496impl PartialEq for Variant {
7497 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7498}
7499impl Clone for Variant {
7500 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7501}
7502impl fmt::Debug for Variant {
7503 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7504 f.debug_struct("Variant").field("syntax", &self.syntax).finish()
7505 }
7506}
7507impl AstNode for VariantList {
7508 #[inline]
7509 fn kind() -> SyntaxKind
7510 where
7511 Self: Sized,
7512 {
7513 VARIANT_LIST
7514 }
7515 #[inline]
7516 fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT_LIST }
7517 #[inline]
7518 fn cast(syntax: SyntaxNode) -> Option<Self> {
7519 if Self::can_cast(syntax.kind()) {
7520 Some(Self { syntax })
7521 } else {
7522 None
7523 }
7524 }
7525 #[inline]
7526 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7527}
7528impl hash::Hash for VariantList {
7529 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7530}
7531impl Eq for VariantList {}
7532impl PartialEq for VariantList {
7533 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7534}
7535impl Clone for VariantList {
7536 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7537}
7538impl fmt::Debug for VariantList {
7539 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7540 f.debug_struct("VariantList").field("syntax", &self.syntax).finish()
7541 }
7542}
7543impl AstNode for Visibility {
7544 #[inline]
7545 fn kind() -> SyntaxKind
7546 where
7547 Self: Sized,
7548 {
7549 VISIBILITY
7550 }
7551 #[inline]
7552 fn can_cast(kind: SyntaxKind) -> bool { kind == VISIBILITY }
7553 #[inline]
7554 fn cast(syntax: SyntaxNode) -> Option<Self> {
7555 if Self::can_cast(syntax.kind()) {
7556 Some(Self { syntax })
7557 } else {
7558 None
7559 }
7560 }
7561 #[inline]
7562 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7563}
7564impl hash::Hash for Visibility {
7565 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7566}
7567impl Eq for Visibility {}
7568impl PartialEq for Visibility {
7569 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7570}
7571impl Clone for Visibility {
7572 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7573}
7574impl fmt::Debug for Visibility {
7575 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7576 f.debug_struct("Visibility").field("syntax", &self.syntax).finish()
7577 }
7578}
7579impl AstNode for WhereClause {
7580 #[inline]
7581 fn kind() -> SyntaxKind
7582 where
7583 Self: Sized,
7584 {
7585 WHERE_CLAUSE
7586 }
7587 #[inline]
7588 fn can_cast(kind: SyntaxKind) -> bool { kind == WHERE_CLAUSE }
7589 #[inline]
7590 fn cast(syntax: SyntaxNode) -> Option<Self> {
7591 if Self::can_cast(syntax.kind()) {
7592 Some(Self { syntax })
7593 } else {
7594 None
7595 }
7596 }
7597 #[inline]
7598 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7599}
7600impl hash::Hash for WhereClause {
7601 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7602}
7603impl Eq for WhereClause {}
7604impl PartialEq for WhereClause {
7605 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7606}
7607impl Clone for WhereClause {
7608 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7609}
7610impl fmt::Debug for WhereClause {
7611 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7612 f.debug_struct("WhereClause").field("syntax", &self.syntax).finish()
7613 }
7614}
7615impl AstNode for WherePred {
7616 #[inline]
7617 fn kind() -> SyntaxKind
7618 where
7619 Self: Sized,
7620 {
7621 WHERE_PRED
7622 }
7623 #[inline]
7624 fn can_cast(kind: SyntaxKind) -> bool { kind == WHERE_PRED }
7625 #[inline]
7626 fn cast(syntax: SyntaxNode) -> Option<Self> {
7627 if Self::can_cast(syntax.kind()) {
7628 Some(Self { syntax })
7629 } else {
7630 None
7631 }
7632 }
7633 #[inline]
7634 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7635}
7636impl hash::Hash for WherePred {
7637 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7638}
7639impl Eq for WherePred {}
7640impl PartialEq for WherePred {
7641 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7642}
7643impl Clone for WherePred {
7644 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7645}
7646impl fmt::Debug for WherePred {
7647 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7648 f.debug_struct("WherePred").field("syntax", &self.syntax).finish()
7649 }
7650}
7651impl AstNode for WhileExpr {
7652 #[inline]
7653 fn kind() -> SyntaxKind
7654 where
7655 Self: Sized,
7656 {
7657 WHILE_EXPR
7658 }
7659 #[inline]
7660 fn can_cast(kind: SyntaxKind) -> bool { kind == WHILE_EXPR }
7661 #[inline]
7662 fn cast(syntax: SyntaxNode) -> Option<Self> {
7663 if Self::can_cast(syntax.kind()) {
7664 Some(Self { syntax })
7665 } else {
7666 None
7667 }
7668 }
7669 #[inline]
7670 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7671}
7672impl hash::Hash for WhileExpr {
7673 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7674}
7675impl Eq for WhileExpr {}
7676impl PartialEq for WhileExpr {
7677 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7678}
7679impl Clone for WhileExpr {
7680 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7681}
7682impl fmt::Debug for WhileExpr {
7683 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7684 f.debug_struct("WhileExpr").field("syntax", &self.syntax).finish()
7685 }
7686}
7687impl AstNode for WildcardPat {
7688 #[inline]
7689 fn kind() -> SyntaxKind
7690 where
7691 Self: Sized,
7692 {
7693 WILDCARD_PAT
7694 }
7695 #[inline]
7696 fn can_cast(kind: SyntaxKind) -> bool { kind == WILDCARD_PAT }
7697 #[inline]
7698 fn cast(syntax: SyntaxNode) -> Option<Self> {
7699 if Self::can_cast(syntax.kind()) {
7700 Some(Self { syntax })
7701 } else {
7702 None
7703 }
7704 }
7705 #[inline]
7706 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7707}
7708impl hash::Hash for WildcardPat {
7709 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7710}
7711impl Eq for WildcardPat {}
7712impl PartialEq for WildcardPat {
7713 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7714}
7715impl Clone for WildcardPat {
7716 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7717}
7718impl fmt::Debug for WildcardPat {
7719 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7720 f.debug_struct("WildcardPat").field("syntax", &self.syntax).finish()
7721 }
7722}
7723impl AstNode for YeetExpr {
7724 #[inline]
7725 fn kind() -> SyntaxKind
7726 where
7727 Self: Sized,
7728 {
7729 YEET_EXPR
7730 }
7731 #[inline]
7732 fn can_cast(kind: SyntaxKind) -> bool { kind == YEET_EXPR }
7733 #[inline]
7734 fn cast(syntax: SyntaxNode) -> Option<Self> {
7735 if Self::can_cast(syntax.kind()) {
7736 Some(Self { syntax })
7737 } else {
7738 None
7739 }
7740 }
7741 #[inline]
7742 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7743}
7744impl hash::Hash for YeetExpr {
7745 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7746}
7747impl Eq for YeetExpr {}
7748impl PartialEq for YeetExpr {
7749 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7750}
7751impl Clone for YeetExpr {
7752 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7753}
7754impl fmt::Debug for YeetExpr {
7755 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7756 f.debug_struct("YeetExpr").field("syntax", &self.syntax).finish()
7757 }
7758}
7759impl AstNode for YieldExpr {
7760 #[inline]
7761 fn kind() -> SyntaxKind
7762 where
7763 Self: Sized,
7764 {
7765 YIELD_EXPR
7766 }
7767 #[inline]
7768 fn can_cast(kind: SyntaxKind) -> bool { kind == YIELD_EXPR }
7769 #[inline]
7770 fn cast(syntax: SyntaxNode) -> Option<Self> {
7771 if Self::can_cast(syntax.kind()) {
7772 Some(Self { syntax })
7773 } else {
7774 None
7775 }
7776 }
7777 #[inline]
7778 fn syntax(&self) -> &SyntaxNode { &self.syntax }
7779}
7780impl hash::Hash for YieldExpr {
7781 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
7782}
7783impl Eq for YieldExpr {}
7784impl PartialEq for YieldExpr {
7785 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
7786}
7787impl Clone for YieldExpr {
7788 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
7789}
7790impl fmt::Debug for YieldExpr {
7791 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7792 f.debug_struct("YieldExpr").field("syntax", &self.syntax).finish()
7793 }
7794}
7795impl From<Enum> for Adt {
7796 #[inline]
7797 fn from(node: Enum) -> Adt { Adt::Enum(node) }
7798}
7799impl From<Struct> for Adt {
7800 #[inline]
7801 fn from(node: Struct) -> Adt { Adt::Struct(node) }
7802}
7803impl From<Union> for Adt {
7804 #[inline]
7805 fn from(node: Union) -> Adt { Adt::Union(node) }
7806}
7807impl AstNode for Adt {
7808 #[inline]
7809 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, ENUM | STRUCT | UNION) }
7810 #[inline]
7811 fn cast(syntax: SyntaxNode) -> Option<Self> {
7812 let res = match syntax.kind() {
7813 ENUM => Adt::Enum(Enum { syntax }),
7814 STRUCT => Adt::Struct(Struct { syntax }),
7815 UNION => Adt::Union(Union { syntax }),
7816 _ => return None,
7817 };
7818 Some(res)
7819 }
7820 #[inline]
7821 fn syntax(&self) -> &SyntaxNode {
7822 match self {
7823 Adt::Enum(it) => &it.syntax,
7824 Adt::Struct(it) => &it.syntax,
7825 Adt::Union(it) => &it.syntax,
7826 }
7827 }
7828}
7829impl From<AsmConst> for AsmOperand {
7830 #[inline]
7831 fn from(node: AsmConst) -> AsmOperand { AsmOperand::AsmConst(node) }
7832}
7833impl From<AsmLabel> for AsmOperand {
7834 #[inline]
7835 fn from(node: AsmLabel) -> AsmOperand { AsmOperand::AsmLabel(node) }
7836}
7837impl From<AsmRegOperand> for AsmOperand {
7838 #[inline]
7839 fn from(node: AsmRegOperand) -> AsmOperand { AsmOperand::AsmRegOperand(node) }
7840}
7841impl From<AsmSym> for AsmOperand {
7842 #[inline]
7843 fn from(node: AsmSym) -> AsmOperand { AsmOperand::AsmSym(node) }
7844}
7845impl AstNode for AsmOperand {
7846 #[inline]
7847 fn can_cast(kind: SyntaxKind) -> bool {
7848 matches!(kind, ASM_CONST | ASM_LABEL | ASM_REG_OPERAND | ASM_SYM)
7849 }
7850 #[inline]
7851 fn cast(syntax: SyntaxNode) -> Option<Self> {
7852 let res = match syntax.kind() {
7853 ASM_CONST => AsmOperand::AsmConst(AsmConst { syntax }),
7854 ASM_LABEL => AsmOperand::AsmLabel(AsmLabel { syntax }),
7855 ASM_REG_OPERAND => AsmOperand::AsmRegOperand(AsmRegOperand { syntax }),
7856 ASM_SYM => AsmOperand::AsmSym(AsmSym { syntax }),
7857 _ => return None,
7858 };
7859 Some(res)
7860 }
7861 #[inline]
7862 fn syntax(&self) -> &SyntaxNode {
7863 match self {
7864 AsmOperand::AsmConst(it) => &it.syntax,
7865 AsmOperand::AsmLabel(it) => &it.syntax,
7866 AsmOperand::AsmRegOperand(it) => &it.syntax,
7867 AsmOperand::AsmSym(it) => &it.syntax,
7868 }
7869 }
7870}
7871impl From<AsmClobberAbi> for AsmPiece {
7872 #[inline]
7873 fn from(node: AsmClobberAbi) -> AsmPiece { AsmPiece::AsmClobberAbi(node) }
7874}
7875impl From<AsmOperandNamed> for AsmPiece {
7876 #[inline]
7877 fn from(node: AsmOperandNamed) -> AsmPiece { AsmPiece::AsmOperandNamed(node) }
7878}
7879impl From<AsmOptions> for AsmPiece {
7880 #[inline]
7881 fn from(node: AsmOptions) -> AsmPiece { AsmPiece::AsmOptions(node) }
7882}
7883impl AstNode for AsmPiece {
7884 #[inline]
7885 fn can_cast(kind: SyntaxKind) -> bool {
7886 matches!(kind, ASM_CLOBBER_ABI | ASM_OPERAND_NAMED | ASM_OPTIONS)
7887 }
7888 #[inline]
7889 fn cast(syntax: SyntaxNode) -> Option<Self> {
7890 let res = match syntax.kind() {
7891 ASM_CLOBBER_ABI => AsmPiece::AsmClobberAbi(AsmClobberAbi { syntax }),
7892 ASM_OPERAND_NAMED => AsmPiece::AsmOperandNamed(AsmOperandNamed { syntax }),
7893 ASM_OPTIONS => AsmPiece::AsmOptions(AsmOptions { syntax }),
7894 _ => return None,
7895 };
7896 Some(res)
7897 }
7898 #[inline]
7899 fn syntax(&self) -> &SyntaxNode {
7900 match self {
7901 AsmPiece::AsmClobberAbi(it) => &it.syntax,
7902 AsmPiece::AsmOperandNamed(it) => &it.syntax,
7903 AsmPiece::AsmOptions(it) => &it.syntax,
7904 }
7905 }
7906}
7907impl From<Const> for AssocItem {
7908 #[inline]
7909 fn from(node: Const) -> AssocItem { AssocItem::Const(node) }
7910}
7911impl From<Fn> for AssocItem {
7912 #[inline]
7913 fn from(node: Fn) -> AssocItem { AssocItem::Fn(node) }
7914}
7915impl From<MacroCall> for AssocItem {
7916 #[inline]
7917 fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) }
7918}
7919impl From<TypeAlias> for AssocItem {
7920 #[inline]
7921 fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) }
7922}
7923impl AstNode for AssocItem {
7924 #[inline]
7925 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, CONST | FN | MACRO_CALL | TYPE_ALIAS) }
7926 #[inline]
7927 fn cast(syntax: SyntaxNode) -> Option<Self> {
7928 let res = match syntax.kind() {
7929 CONST => AssocItem::Const(Const { syntax }),
7930 FN => AssocItem::Fn(Fn { syntax }),
7931 MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }),
7932 TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }),
7933 _ => return None,
7934 };
7935 Some(res)
7936 }
7937 #[inline]
7938 fn syntax(&self) -> &SyntaxNode {
7939 match self {
7940 AssocItem::Const(it) => &it.syntax,
7941 AssocItem::Fn(it) => &it.syntax,
7942 AssocItem::MacroCall(it) => &it.syntax,
7943 AssocItem::TypeAlias(it) => &it.syntax,
7944 }
7945 }
7946}
7947impl From<ArrayExpr> for Expr {
7948 #[inline]
7949 fn from(node: ArrayExpr) -> Expr { Expr::ArrayExpr(node) }
7950}
7951impl From<AsmExpr> for Expr {
7952 #[inline]
7953 fn from(node: AsmExpr) -> Expr { Expr::AsmExpr(node) }
7954}
7955impl From<AwaitExpr> for Expr {
7956 #[inline]
7957 fn from(node: AwaitExpr) -> Expr { Expr::AwaitExpr(node) }
7958}
7959impl From<BecomeExpr> for Expr {
7960 #[inline]
7961 fn from(node: BecomeExpr) -> Expr { Expr::BecomeExpr(node) }
7962}
7963impl From<BinExpr> for Expr {
7964 #[inline]
7965 fn from(node: BinExpr) -> Expr { Expr::BinExpr(node) }
7966}
7967impl From<BlockExpr> for Expr {
7968 #[inline]
7969 fn from(node: BlockExpr) -> Expr { Expr::BlockExpr(node) }
7970}
7971impl From<BreakExpr> for Expr {
7972 #[inline]
7973 fn from(node: BreakExpr) -> Expr { Expr::BreakExpr(node) }
7974}
7975impl From<CallExpr> for Expr {
7976 #[inline]
7977 fn from(node: CallExpr) -> Expr { Expr::CallExpr(node) }
7978}
7979impl From<CastExpr> for Expr {
7980 #[inline]
7981 fn from(node: CastExpr) -> Expr { Expr::CastExpr(node) }
7982}
7983impl From<ClosureExpr> for Expr {
7984 #[inline]
7985 fn from(node: ClosureExpr) -> Expr { Expr::ClosureExpr(node) }
7986}
7987impl From<ContinueExpr> for Expr {
7988 #[inline]
7989 fn from(node: ContinueExpr) -> Expr { Expr::ContinueExpr(node) }
7990}
7991impl From<FieldExpr> for Expr {
7992 #[inline]
7993 fn from(node: FieldExpr) -> Expr { Expr::FieldExpr(node) }
7994}
7995impl From<ForExpr> for Expr {
7996 #[inline]
7997 fn from(node: ForExpr) -> Expr { Expr::ForExpr(node) }
7998}
7999impl From<FormatArgsExpr> for Expr {
8000 #[inline]
8001 fn from(node: FormatArgsExpr) -> Expr { Expr::FormatArgsExpr(node) }
8002}
8003impl From<IfExpr> for Expr {
8004 #[inline]
8005 fn from(node: IfExpr) -> Expr { Expr::IfExpr(node) }
8006}
8007impl From<IndexExpr> for Expr {
8008 #[inline]
8009 fn from(node: IndexExpr) -> Expr { Expr::IndexExpr(node) }
8010}
8011impl From<LetExpr> for Expr {
8012 #[inline]
8013 fn from(node: LetExpr) -> Expr { Expr::LetExpr(node) }
8014}
8015impl From<Literal> for Expr {
8016 #[inline]
8017 fn from(node: Literal) -> Expr { Expr::Literal(node) }
8018}
8019impl From<LoopExpr> for Expr {
8020 #[inline]
8021 fn from(node: LoopExpr) -> Expr { Expr::LoopExpr(node) }
8022}
8023impl From<MacroExpr> for Expr {
8024 #[inline]
8025 fn from(node: MacroExpr) -> Expr { Expr::MacroExpr(node) }
8026}
8027impl From<MatchExpr> for Expr {
8028 #[inline]
8029 fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) }
8030}
8031impl From<MethodCallExpr> for Expr {
8032 #[inline]
8033 fn from(node: MethodCallExpr) -> Expr { Expr::MethodCallExpr(node) }
8034}
8035impl From<OffsetOfExpr> for Expr {
8036 #[inline]
8037 fn from(node: OffsetOfExpr) -> Expr { Expr::OffsetOfExpr(node) }
8038}
8039impl From<ParenExpr> for Expr {
8040 #[inline]
8041 fn from(node: ParenExpr) -> Expr { Expr::ParenExpr(node) }
8042}
8043impl From<PathExpr> for Expr {
8044 #[inline]
8045 fn from(node: PathExpr) -> Expr { Expr::PathExpr(node) }
8046}
8047impl From<PrefixExpr> for Expr {
8048 #[inline]
8049 fn from(node: PrefixExpr) -> Expr { Expr::PrefixExpr(node) }
8050}
8051impl From<RangeExpr> for Expr {
8052 #[inline]
8053 fn from(node: RangeExpr) -> Expr { Expr::RangeExpr(node) }
8054}
8055impl From<RecordExpr> for Expr {
8056 #[inline]
8057 fn from(node: RecordExpr) -> Expr { Expr::RecordExpr(node) }
8058}
8059impl From<RefExpr> for Expr {
8060 #[inline]
8061 fn from(node: RefExpr) -> Expr { Expr::RefExpr(node) }
8062}
8063impl From<ReturnExpr> for Expr {
8064 #[inline]
8065 fn from(node: ReturnExpr) -> Expr { Expr::ReturnExpr(node) }
8066}
8067impl From<TryExpr> for Expr {
8068 #[inline]
8069 fn from(node: TryExpr) -> Expr { Expr::TryExpr(node) }
8070}
8071impl From<TupleExpr> for Expr {
8072 #[inline]
8073 fn from(node: TupleExpr) -> Expr { Expr::TupleExpr(node) }
8074}
8075impl From<UnderscoreExpr> for Expr {
8076 #[inline]
8077 fn from(node: UnderscoreExpr) -> Expr { Expr::UnderscoreExpr(node) }
8078}
8079impl From<WhileExpr> for Expr {
8080 #[inline]
8081 fn from(node: WhileExpr) -> Expr { Expr::WhileExpr(node) }
8082}
8083impl From<YeetExpr> for Expr {
8084 #[inline]
8085 fn from(node: YeetExpr) -> Expr { Expr::YeetExpr(node) }
8086}
8087impl From<YieldExpr> for Expr {
8088 #[inline]
8089 fn from(node: YieldExpr) -> Expr { Expr::YieldExpr(node) }
8090}
8091impl AstNode for Expr {
8092 #[inline]
8093 fn can_cast(kind: SyntaxKind) -> bool {
8094 matches!(
8095 kind,
8096 ARRAY_EXPR
8097 | ASM_EXPR
8098 | AWAIT_EXPR
8099 | BECOME_EXPR
8100 | BIN_EXPR
8101 | BLOCK_EXPR
8102 | BREAK_EXPR
8103 | CALL_EXPR
8104 | CAST_EXPR
8105 | CLOSURE_EXPR
8106 | CONTINUE_EXPR
8107 | FIELD_EXPR
8108 | FOR_EXPR
8109 | FORMAT_ARGS_EXPR
8110 | IF_EXPR
8111 | INDEX_EXPR
8112 | LET_EXPR
8113 | LITERAL
8114 | LOOP_EXPR
8115 | MACRO_EXPR
8116 | MATCH_EXPR
8117 | METHOD_CALL_EXPR
8118 | OFFSET_OF_EXPR
8119 | PAREN_EXPR
8120 | PATH_EXPR
8121 | PREFIX_EXPR
8122 | RANGE_EXPR
8123 | RECORD_EXPR
8124 | REF_EXPR
8125 | RETURN_EXPR
8126 | TRY_EXPR
8127 | TUPLE_EXPR
8128 | UNDERSCORE_EXPR
8129 | WHILE_EXPR
8130 | YEET_EXPR
8131 | YIELD_EXPR
8132 )
8133 }
8134 #[inline]
8135 fn cast(syntax: SyntaxNode) -> Option<Self> {
8136 let res = match syntax.kind() {
8137 ARRAY_EXPR => Expr::ArrayExpr(ArrayExpr { syntax }),
8138 ASM_EXPR => Expr::AsmExpr(AsmExpr { syntax }),
8139 AWAIT_EXPR => Expr::AwaitExpr(AwaitExpr { syntax }),
8140 BECOME_EXPR => Expr::BecomeExpr(BecomeExpr { syntax }),
8141 BIN_EXPR => Expr::BinExpr(BinExpr { syntax }),
8142 BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }),
8143 BREAK_EXPR => Expr::BreakExpr(BreakExpr { syntax }),
8144 CALL_EXPR => Expr::CallExpr(CallExpr { syntax }),
8145 CAST_EXPR => Expr::CastExpr(CastExpr { syntax }),
8146 CLOSURE_EXPR => Expr::ClosureExpr(ClosureExpr { syntax }),
8147 CONTINUE_EXPR => Expr::ContinueExpr(ContinueExpr { syntax }),
8148 FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }),
8149 FOR_EXPR => Expr::ForExpr(ForExpr { syntax }),
8150 FORMAT_ARGS_EXPR => Expr::FormatArgsExpr(FormatArgsExpr { syntax }),
8151 IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
8152 INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }),
8153 LET_EXPR => Expr::LetExpr(LetExpr { syntax }),
8154 LITERAL => Expr::Literal(Literal { syntax }),
8155 LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }),
8156 MACRO_EXPR => Expr::MacroExpr(MacroExpr { syntax }),
8157 MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }),
8158 METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }),
8159 OFFSET_OF_EXPR => Expr::OffsetOfExpr(OffsetOfExpr { syntax }),
8160 PAREN_EXPR => Expr::ParenExpr(ParenExpr { syntax }),
8161 PATH_EXPR => Expr::PathExpr(PathExpr { syntax }),
8162 PREFIX_EXPR => Expr::PrefixExpr(PrefixExpr { syntax }),
8163 RANGE_EXPR => Expr::RangeExpr(RangeExpr { syntax }),
8164 RECORD_EXPR => Expr::RecordExpr(RecordExpr { syntax }),
8165 REF_EXPR => Expr::RefExpr(RefExpr { syntax }),
8166 RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }),
8167 TRY_EXPR => Expr::TryExpr(TryExpr { syntax }),
8168 TUPLE_EXPR => Expr::TupleExpr(TupleExpr { syntax }),
8169 UNDERSCORE_EXPR => Expr::UnderscoreExpr(UnderscoreExpr { syntax }),
8170 WHILE_EXPR => Expr::WhileExpr(WhileExpr { syntax }),
8171 YEET_EXPR => Expr::YeetExpr(YeetExpr { syntax }),
8172 YIELD_EXPR => Expr::YieldExpr(YieldExpr { syntax }),
8173 _ => return None,
8174 };
8175 Some(res)
8176 }
8177 #[inline]
8178 fn syntax(&self) -> &SyntaxNode {
8179 match self {
8180 Expr::ArrayExpr(it) => &it.syntax,
8181 Expr::AsmExpr(it) => &it.syntax,
8182 Expr::AwaitExpr(it) => &it.syntax,
8183 Expr::BecomeExpr(it) => &it.syntax,
8184 Expr::BinExpr(it) => &it.syntax,
8185 Expr::BlockExpr(it) => &it.syntax,
8186 Expr::BreakExpr(it) => &it.syntax,
8187 Expr::CallExpr(it) => &it.syntax,
8188 Expr::CastExpr(it) => &it.syntax,
8189 Expr::ClosureExpr(it) => &it.syntax,
8190 Expr::ContinueExpr(it) => &it.syntax,
8191 Expr::FieldExpr(it) => &it.syntax,
8192 Expr::ForExpr(it) => &it.syntax,
8193 Expr::FormatArgsExpr(it) => &it.syntax,
8194 Expr::IfExpr(it) => &it.syntax,
8195 Expr::IndexExpr(it) => &it.syntax,
8196 Expr::LetExpr(it) => &it.syntax,
8197 Expr::Literal(it) => &it.syntax,
8198 Expr::LoopExpr(it) => &it.syntax,
8199 Expr::MacroExpr(it) => &it.syntax,
8200 Expr::MatchExpr(it) => &it.syntax,
8201 Expr::MethodCallExpr(it) => &it.syntax,
8202 Expr::OffsetOfExpr(it) => &it.syntax,
8203 Expr::ParenExpr(it) => &it.syntax,
8204 Expr::PathExpr(it) => &it.syntax,
8205 Expr::PrefixExpr(it) => &it.syntax,
8206 Expr::RangeExpr(it) => &it.syntax,
8207 Expr::RecordExpr(it) => &it.syntax,
8208 Expr::RefExpr(it) => &it.syntax,
8209 Expr::ReturnExpr(it) => &it.syntax,
8210 Expr::TryExpr(it) => &it.syntax,
8211 Expr::TupleExpr(it) => &it.syntax,
8212 Expr::UnderscoreExpr(it) => &it.syntax,
8213 Expr::WhileExpr(it) => &it.syntax,
8214 Expr::YeetExpr(it) => &it.syntax,
8215 Expr::YieldExpr(it) => &it.syntax,
8216 }
8217 }
8218}
8219impl From<Fn> for ExternItem {
8220 #[inline]
8221 fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) }
8222}
8223impl From<MacroCall> for ExternItem {
8224 #[inline]
8225 fn from(node: MacroCall) -> ExternItem { ExternItem::MacroCall(node) }
8226}
8227impl From<Static> for ExternItem {
8228 #[inline]
8229 fn from(node: Static) -> ExternItem { ExternItem::Static(node) }
8230}
8231impl From<TypeAlias> for ExternItem {
8232 #[inline]
8233 fn from(node: TypeAlias) -> ExternItem { ExternItem::TypeAlias(node) }
8234}
8235impl AstNode for ExternItem {
8236 #[inline]
8237 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, FN | MACRO_CALL | STATIC | TYPE_ALIAS) }
8238 #[inline]
8239 fn cast(syntax: SyntaxNode) -> Option<Self> {
8240 let res = match syntax.kind() {
8241 FN => ExternItem::Fn(Fn { syntax }),
8242 MACRO_CALL => ExternItem::MacroCall(MacroCall { syntax }),
8243 STATIC => ExternItem::Static(Static { syntax }),
8244 TYPE_ALIAS => ExternItem::TypeAlias(TypeAlias { syntax }),
8245 _ => return None,
8246 };
8247 Some(res)
8248 }
8249 #[inline]
8250 fn syntax(&self) -> &SyntaxNode {
8251 match self {
8252 ExternItem::Fn(it) => &it.syntax,
8253 ExternItem::MacroCall(it) => &it.syntax,
8254 ExternItem::Static(it) => &it.syntax,
8255 ExternItem::TypeAlias(it) => &it.syntax,
8256 }
8257 }
8258}
8259impl From<RecordFieldList> for FieldList {
8260 #[inline]
8261 fn from(node: RecordFieldList) -> FieldList { FieldList::RecordFieldList(node) }
8262}
8263impl From<TupleFieldList> for FieldList {
8264 #[inline]
8265 fn from(node: TupleFieldList) -> FieldList { FieldList::TupleFieldList(node) }
8266}
8267impl AstNode for FieldList {
8268 #[inline]
8269 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, RECORD_FIELD_LIST | TUPLE_FIELD_LIST) }
8270 #[inline]
8271 fn cast(syntax: SyntaxNode) -> Option<Self> {
8272 let res = match syntax.kind() {
8273 RECORD_FIELD_LIST => FieldList::RecordFieldList(RecordFieldList { syntax }),
8274 TUPLE_FIELD_LIST => FieldList::TupleFieldList(TupleFieldList { syntax }),
8275 _ => return None,
8276 };
8277 Some(res)
8278 }
8279 #[inline]
8280 fn syntax(&self) -> &SyntaxNode {
8281 match self {
8282 FieldList::RecordFieldList(it) => &it.syntax,
8283 FieldList::TupleFieldList(it) => &it.syntax,
8284 }
8285 }
8286}
8287impl From<AssocTypeArg> for GenericArg {
8288 #[inline]
8289 fn from(node: AssocTypeArg) -> GenericArg { GenericArg::AssocTypeArg(node) }
8290}
8291impl From<ConstArg> for GenericArg {
8292 #[inline]
8293 fn from(node: ConstArg) -> GenericArg { GenericArg::ConstArg(node) }
8294}
8295impl From<LifetimeArg> for GenericArg {
8296 #[inline]
8297 fn from(node: LifetimeArg) -> GenericArg { GenericArg::LifetimeArg(node) }
8298}
8299impl From<TypeArg> for GenericArg {
8300 #[inline]
8301 fn from(node: TypeArg) -> GenericArg { GenericArg::TypeArg(node) }
8302}
8303impl AstNode for GenericArg {
8304 #[inline]
8305 fn can_cast(kind: SyntaxKind) -> bool {
8306 matches!(kind, ASSOC_TYPE_ARG | CONST_ARG | LIFETIME_ARG | TYPE_ARG)
8307 }
8308 #[inline]
8309 fn cast(syntax: SyntaxNode) -> Option<Self> {
8310 let res = match syntax.kind() {
8311 ASSOC_TYPE_ARG => GenericArg::AssocTypeArg(AssocTypeArg { syntax }),
8312 CONST_ARG => GenericArg::ConstArg(ConstArg { syntax }),
8313 LIFETIME_ARG => GenericArg::LifetimeArg(LifetimeArg { syntax }),
8314 TYPE_ARG => GenericArg::TypeArg(TypeArg { syntax }),
8315 _ => return None,
8316 };
8317 Some(res)
8318 }
8319 #[inline]
8320 fn syntax(&self) -> &SyntaxNode {
8321 match self {
8322 GenericArg::AssocTypeArg(it) => &it.syntax,
8323 GenericArg::ConstArg(it) => &it.syntax,
8324 GenericArg::LifetimeArg(it) => &it.syntax,
8325 GenericArg::TypeArg(it) => &it.syntax,
8326 }
8327 }
8328}
8329impl From<ConstParam> for GenericParam {
8330 #[inline]
8331 fn from(node: ConstParam) -> GenericParam { GenericParam::ConstParam(node) }
8332}
8333impl From<LifetimeParam> for GenericParam {
8334 #[inline]
8335 fn from(node: LifetimeParam) -> GenericParam { GenericParam::LifetimeParam(node) }
8336}
8337impl From<TypeParam> for GenericParam {
8338 #[inline]
8339 fn from(node: TypeParam) -> GenericParam { GenericParam::TypeParam(node) }
8340}
8341impl AstNode for GenericParam {
8342 #[inline]
8343 fn can_cast(kind: SyntaxKind) -> bool {
8344 matches!(kind, CONST_PARAM | LIFETIME_PARAM | TYPE_PARAM)
8345 }
8346 #[inline]
8347 fn cast(syntax: SyntaxNode) -> Option<Self> {
8348 let res = match syntax.kind() {
8349 CONST_PARAM => GenericParam::ConstParam(ConstParam { syntax }),
8350 LIFETIME_PARAM => GenericParam::LifetimeParam(LifetimeParam { syntax }),
8351 TYPE_PARAM => GenericParam::TypeParam(TypeParam { syntax }),
8352 _ => return None,
8353 };
8354 Some(res)
8355 }
8356 #[inline]
8357 fn syntax(&self) -> &SyntaxNode {
8358 match self {
8359 GenericParam::ConstParam(it) => &it.syntax,
8360 GenericParam::LifetimeParam(it) => &it.syntax,
8361 GenericParam::TypeParam(it) => &it.syntax,
8362 }
8363 }
8364}
8365impl From<Const> for Item {
8366 #[inline]
8367 fn from(node: Const) -> Item { Item::Const(node) }
8368}
8369impl From<Enum> for Item {
8370 #[inline]
8371 fn from(node: Enum) -> Item { Item::Enum(node) }
8372}
8373impl From<ExternBlock> for Item {
8374 #[inline]
8375 fn from(node: ExternBlock) -> Item { Item::ExternBlock(node) }
8376}
8377impl From<ExternCrate> for Item {
8378 #[inline]
8379 fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) }
8380}
8381impl From<Fn> for Item {
8382 #[inline]
8383 fn from(node: Fn) -> Item { Item::Fn(node) }
8384}
8385impl From<Impl> for Item {
8386 #[inline]
8387 fn from(node: Impl) -> Item { Item::Impl(node) }
8388}
8389impl From<MacroCall> for Item {
8390 #[inline]
8391 fn from(node: MacroCall) -> Item { Item::MacroCall(node) }
8392}
8393impl From<MacroDef> for Item {
8394 #[inline]
8395 fn from(node: MacroDef) -> Item { Item::MacroDef(node) }
8396}
8397impl From<MacroRules> for Item {
8398 #[inline]
8399 fn from(node: MacroRules) -> Item { Item::MacroRules(node) }
8400}
8401impl From<Module> for Item {
8402 #[inline]
8403 fn from(node: Module) -> Item { Item::Module(node) }
8404}
8405impl From<Static> for Item {
8406 #[inline]
8407 fn from(node: Static) -> Item { Item::Static(node) }
8408}
8409impl From<Struct> for Item {
8410 #[inline]
8411 fn from(node: Struct) -> Item { Item::Struct(node) }
8412}
8413impl From<Trait> for Item {
8414 #[inline]
8415 fn from(node: Trait) -> Item { Item::Trait(node) }
8416}
8417impl From<TraitAlias> for Item {
8418 #[inline]
8419 fn from(node: TraitAlias) -> Item { Item::TraitAlias(node) }
8420}
8421impl From<TypeAlias> for Item {
8422 #[inline]
8423 fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) }
8424}
8425impl From<Union> for Item {
8426 #[inline]
8427 fn from(node: Union) -> Item { Item::Union(node) }
8428}
8429impl From<Use> for Item {
8430 #[inline]
8431 fn from(node: Use) -> Item { Item::Use(node) }
8432}
8433impl AstNode for Item {
8434 #[inline]
8435 fn can_cast(kind: SyntaxKind) -> bool {
8436 matches!(
8437 kind,
8438 CONST
8439 | ENUM
8440 | EXTERN_BLOCK
8441 | EXTERN_CRATE
8442 | FN
8443 | IMPL
8444 | MACRO_CALL
8445 | MACRO_DEF
8446 | MACRO_RULES
8447 | MODULE
8448 | STATIC
8449 | STRUCT
8450 | TRAIT
8451 | TRAIT_ALIAS
8452 | TYPE_ALIAS
8453 | UNION
8454 | USE
8455 )
8456 }
8457 #[inline]
8458 fn cast(syntax: SyntaxNode) -> Option<Self> {
8459 let res = match syntax.kind() {
8460 CONST => Item::Const(Const { syntax }),
8461 ENUM => Item::Enum(Enum { syntax }),
8462 EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }),
8463 EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }),
8464 FN => Item::Fn(Fn { syntax }),
8465 IMPL => Item::Impl(Impl { syntax }),
8466 MACRO_CALL => Item::MacroCall(MacroCall { syntax }),
8467 MACRO_DEF => Item::MacroDef(MacroDef { syntax }),
8468 MACRO_RULES => Item::MacroRules(MacroRules { syntax }),
8469 MODULE => Item::Module(Module { syntax }),
8470 STATIC => Item::Static(Static { syntax }),
8471 STRUCT => Item::Struct(Struct { syntax }),
8472 TRAIT => Item::Trait(Trait { syntax }),
8473 TRAIT_ALIAS => Item::TraitAlias(TraitAlias { syntax }),
8474 TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }),
8475 UNION => Item::Union(Union { syntax }),
8476 USE => Item::Use(Use { syntax }),
8477 _ => return None,
8478 };
8479 Some(res)
8480 }
8481 #[inline]
8482 fn syntax(&self) -> &SyntaxNode {
8483 match self {
8484 Item::Const(it) => &it.syntax,
8485 Item::Enum(it) => &it.syntax,
8486 Item::ExternBlock(it) => &it.syntax,
8487 Item::ExternCrate(it) => &it.syntax,
8488 Item::Fn(it) => &it.syntax,
8489 Item::Impl(it) => &it.syntax,
8490 Item::MacroCall(it) => &it.syntax,
8491 Item::MacroDef(it) => &it.syntax,
8492 Item::MacroRules(it) => &it.syntax,
8493 Item::Module(it) => &it.syntax,
8494 Item::Static(it) => &it.syntax,
8495 Item::Struct(it) => &it.syntax,
8496 Item::Trait(it) => &it.syntax,
8497 Item::TraitAlias(it) => &it.syntax,
8498 Item::TypeAlias(it) => &it.syntax,
8499 Item::Union(it) => &it.syntax,
8500 Item::Use(it) => &it.syntax,
8501 }
8502 }
8503}
8504impl From<BoxPat> for Pat {
8505 #[inline]
8506 fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) }
8507}
8508impl From<ConstBlockPat> for Pat {
8509 #[inline]
8510 fn from(node: ConstBlockPat) -> Pat { Pat::ConstBlockPat(node) }
8511}
8512impl From<IdentPat> for Pat {
8513 #[inline]
8514 fn from(node: IdentPat) -> Pat { Pat::IdentPat(node) }
8515}
8516impl From<LiteralPat> for Pat {
8517 #[inline]
8518 fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) }
8519}
8520impl From<MacroPat> for Pat {
8521 #[inline]
8522 fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) }
8523}
8524impl From<OrPat> for Pat {
8525 #[inline]
8526 fn from(node: OrPat) -> Pat { Pat::OrPat(node) }
8527}
8528impl From<ParenPat> for Pat {
8529 #[inline]
8530 fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) }
8531}
8532impl From<PathPat> for Pat {
8533 #[inline]
8534 fn from(node: PathPat) -> Pat { Pat::PathPat(node) }
8535}
8536impl From<RangePat> for Pat {
8537 #[inline]
8538 fn from(node: RangePat) -> Pat { Pat::RangePat(node) }
8539}
8540impl From<RecordPat> for Pat {
8541 #[inline]
8542 fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) }
8543}
8544impl From<RefPat> for Pat {
8545 #[inline]
8546 fn from(node: RefPat) -> Pat { Pat::RefPat(node) }
8547}
8548impl From<RestPat> for Pat {
8549 #[inline]
8550 fn from(node: RestPat) -> Pat { Pat::RestPat(node) }
8551}
8552impl From<SlicePat> for Pat {
8553 #[inline]
8554 fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) }
8555}
8556impl From<TuplePat> for Pat {
8557 #[inline]
8558 fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) }
8559}
8560impl From<TupleStructPat> for Pat {
8561 #[inline]
8562 fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) }
8563}
8564impl From<WildcardPat> for Pat {
8565 #[inline]
8566 fn from(node: WildcardPat) -> Pat { Pat::WildcardPat(node) }
8567}
8568impl AstNode for Pat {
8569 #[inline]
8570 fn can_cast(kind: SyntaxKind) -> bool {
8571 matches!(
8572 kind,
8573 BOX_PAT
8574 | CONST_BLOCK_PAT
8575 | IDENT_PAT
8576 | LITERAL_PAT
8577 | MACRO_PAT
8578 | OR_PAT
8579 | PAREN_PAT
8580 | PATH_PAT
8581 | RANGE_PAT
8582 | RECORD_PAT
8583 | REF_PAT
8584 | REST_PAT
8585 | SLICE_PAT
8586 | TUPLE_PAT
8587 | TUPLE_STRUCT_PAT
8588 | WILDCARD_PAT
8589 )
8590 }
8591 #[inline]
8592 fn cast(syntax: SyntaxNode) -> Option<Self> {
8593 let res = match syntax.kind() {
8594 BOX_PAT => Pat::BoxPat(BoxPat { syntax }),
8595 CONST_BLOCK_PAT => Pat::ConstBlockPat(ConstBlockPat { syntax }),
8596 IDENT_PAT => Pat::IdentPat(IdentPat { syntax }),
8597 LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }),
8598 MACRO_PAT => Pat::MacroPat(MacroPat { syntax }),
8599 OR_PAT => Pat::OrPat(OrPat { syntax }),
8600 PAREN_PAT => Pat::ParenPat(ParenPat { syntax }),
8601 PATH_PAT => Pat::PathPat(PathPat { syntax }),
8602 RANGE_PAT => Pat::RangePat(RangePat { syntax }),
8603 RECORD_PAT => Pat::RecordPat(RecordPat { syntax }),
8604 REF_PAT => Pat::RefPat(RefPat { syntax }),
8605 REST_PAT => Pat::RestPat(RestPat { syntax }),
8606 SLICE_PAT => Pat::SlicePat(SlicePat { syntax }),
8607 TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }),
8608 TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }),
8609 WILDCARD_PAT => Pat::WildcardPat(WildcardPat { syntax }),
8610 _ => return None,
8611 };
8612 Some(res)
8613 }
8614 #[inline]
8615 fn syntax(&self) -> &SyntaxNode {
8616 match self {
8617 Pat::BoxPat(it) => &it.syntax,
8618 Pat::ConstBlockPat(it) => &it.syntax,
8619 Pat::IdentPat(it) => &it.syntax,
8620 Pat::LiteralPat(it) => &it.syntax,
8621 Pat::MacroPat(it) => &it.syntax,
8622 Pat::OrPat(it) => &it.syntax,
8623 Pat::ParenPat(it) => &it.syntax,
8624 Pat::PathPat(it) => &it.syntax,
8625 Pat::RangePat(it) => &it.syntax,
8626 Pat::RecordPat(it) => &it.syntax,
8627 Pat::RefPat(it) => &it.syntax,
8628 Pat::RestPat(it) => &it.syntax,
8629 Pat::SlicePat(it) => &it.syntax,
8630 Pat::TuplePat(it) => &it.syntax,
8631 Pat::TupleStructPat(it) => &it.syntax,
8632 Pat::WildcardPat(it) => &it.syntax,
8633 }
8634 }
8635}
8636impl From<ExprStmt> for Stmt {
8637 #[inline]
8638 fn from(node: ExprStmt) -> Stmt { Stmt::ExprStmt(node) }
8639}
8640impl From<Item> for Stmt {
8641 #[inline]
8642 fn from(node: Item) -> Stmt { Stmt::Item(node) }
8643}
8644impl From<LetStmt> for Stmt {
8645 #[inline]
8646 fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) }
8647}
8648impl From<ArrayType> for Type {
8649 #[inline]
8650 fn from(node: ArrayType) -> Type { Type::ArrayType(node) }
8651}
8652impl From<DynTraitType> for Type {
8653 #[inline]
8654 fn from(node: DynTraitType) -> Type { Type::DynTraitType(node) }
8655}
8656impl From<FnPtrType> for Type {
8657 #[inline]
8658 fn from(node: FnPtrType) -> Type { Type::FnPtrType(node) }
8659}
8660impl From<ForType> for Type {
8661 #[inline]
8662 fn from(node: ForType) -> Type { Type::ForType(node) }
8663}
8664impl From<ImplTraitType> for Type {
8665 #[inline]
8666 fn from(node: ImplTraitType) -> Type { Type::ImplTraitType(node) }
8667}
8668impl From<InferType> for Type {
8669 #[inline]
8670 fn from(node: InferType) -> Type { Type::InferType(node) }
8671}
8672impl From<MacroType> for Type {
8673 #[inline]
8674 fn from(node: MacroType) -> Type { Type::MacroType(node) }
8675}
8676impl From<NeverType> for Type {
8677 #[inline]
8678 fn from(node: NeverType) -> Type { Type::NeverType(node) }
8679}
8680impl From<ParenType> for Type {
8681 #[inline]
8682 fn from(node: ParenType) -> Type { Type::ParenType(node) }
8683}
8684impl From<PathType> for Type {
8685 #[inline]
8686 fn from(node: PathType) -> Type { Type::PathType(node) }
8687}
8688impl From<PtrType> for Type {
8689 #[inline]
8690 fn from(node: PtrType) -> Type { Type::PtrType(node) }
8691}
8692impl From<RefType> for Type {
8693 #[inline]
8694 fn from(node: RefType) -> Type { Type::RefType(node) }
8695}
8696impl From<SliceType> for Type {
8697 #[inline]
8698 fn from(node: SliceType) -> Type { Type::SliceType(node) }
8699}
8700impl From<TupleType> for Type {
8701 #[inline]
8702 fn from(node: TupleType) -> Type { Type::TupleType(node) }
8703}
8704impl AstNode for Type {
8705 #[inline]
8706 fn can_cast(kind: SyntaxKind) -> bool {
8707 matches!(
8708 kind,
8709 ARRAY_TYPE
8710 | DYN_TRAIT_TYPE
8711 | FN_PTR_TYPE
8712 | FOR_TYPE
8713 | IMPL_TRAIT_TYPE
8714 | INFER_TYPE
8715 | MACRO_TYPE
8716 | NEVER_TYPE
8717 | PAREN_TYPE
8718 | PATH_TYPE
8719 | PTR_TYPE
8720 | REF_TYPE
8721 | SLICE_TYPE
8722 | TUPLE_TYPE
8723 )
8724 }
8725 #[inline]
8726 fn cast(syntax: SyntaxNode) -> Option<Self> {
8727 let res = match syntax.kind() {
8728 ARRAY_TYPE => Type::ArrayType(ArrayType { syntax }),
8729 DYN_TRAIT_TYPE => Type::DynTraitType(DynTraitType { syntax }),
8730 FN_PTR_TYPE => Type::FnPtrType(FnPtrType { syntax }),
8731 FOR_TYPE => Type::ForType(ForType { syntax }),
8732 IMPL_TRAIT_TYPE => Type::ImplTraitType(ImplTraitType { syntax }),
8733 INFER_TYPE => Type::InferType(InferType { syntax }),
8734 MACRO_TYPE => Type::MacroType(MacroType { syntax }),
8735 NEVER_TYPE => Type::NeverType(NeverType { syntax }),
8736 PAREN_TYPE => Type::ParenType(ParenType { syntax }),
8737 PATH_TYPE => Type::PathType(PathType { syntax }),
8738 PTR_TYPE => Type::PtrType(PtrType { syntax }),
8739 REF_TYPE => Type::RefType(RefType { syntax }),
8740 SLICE_TYPE => Type::SliceType(SliceType { syntax }),
8741 TUPLE_TYPE => Type::TupleType(TupleType { syntax }),
8742 _ => return None,
8743 };
8744 Some(res)
8745 }
8746 #[inline]
8747 fn syntax(&self) -> &SyntaxNode {
8748 match self {
8749 Type::ArrayType(it) => &it.syntax,
8750 Type::DynTraitType(it) => &it.syntax,
8751 Type::FnPtrType(it) => &it.syntax,
8752 Type::ForType(it) => &it.syntax,
8753 Type::ImplTraitType(it) => &it.syntax,
8754 Type::InferType(it) => &it.syntax,
8755 Type::MacroType(it) => &it.syntax,
8756 Type::NeverType(it) => &it.syntax,
8757 Type::ParenType(it) => &it.syntax,
8758 Type::PathType(it) => &it.syntax,
8759 Type::PtrType(it) => &it.syntax,
8760 Type::RefType(it) => &it.syntax,
8761 Type::SliceType(it) => &it.syntax,
8762 Type::TupleType(it) => &it.syntax,
8763 }
8764 }
8765}
8766impl From<Lifetime> for UseBoundGenericArg {
8767 #[inline]
8768 fn from(node: Lifetime) -> UseBoundGenericArg { UseBoundGenericArg::Lifetime(node) }
8769}
8770impl From<NameRef> for UseBoundGenericArg {
8771 #[inline]
8772 fn from(node: NameRef) -> UseBoundGenericArg { UseBoundGenericArg::NameRef(node) }
8773}
8774impl AstNode for UseBoundGenericArg {
8775 #[inline]
8776 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, LIFETIME | NAME_REF) }
8777 #[inline]
8778 fn cast(syntax: SyntaxNode) -> Option<Self> {
8779 let res = match syntax.kind() {
8780 LIFETIME => UseBoundGenericArg::Lifetime(Lifetime { syntax }),
8781 NAME_REF => UseBoundGenericArg::NameRef(NameRef { syntax }),
8782 _ => return None,
8783 };
8784 Some(res)
8785 }
8786 #[inline]
8787 fn syntax(&self) -> &SyntaxNode {
8788 match self {
8789 UseBoundGenericArg::Lifetime(it) => &it.syntax,
8790 UseBoundGenericArg::NameRef(it) => &it.syntax,
8791 }
8792 }
8793}
8794impl From<Struct> for VariantDef {
8795 #[inline]
8796 fn from(node: Struct) -> VariantDef { VariantDef::Struct(node) }
8797}
8798impl From<Union> for VariantDef {
8799 #[inline]
8800 fn from(node: Union) -> VariantDef { VariantDef::Union(node) }
8801}
8802impl From<Variant> for VariantDef {
8803 #[inline]
8804 fn from(node: Variant) -> VariantDef { VariantDef::Variant(node) }
8805}
8806impl AstNode for VariantDef {
8807 #[inline]
8808 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, STRUCT | UNION | VARIANT) }
8809 #[inline]
8810 fn cast(syntax: SyntaxNode) -> Option<Self> {
8811 let res = match syntax.kind() {
8812 STRUCT => VariantDef::Struct(Struct { syntax }),
8813 UNION => VariantDef::Union(Union { syntax }),
8814 VARIANT => VariantDef::Variant(Variant { syntax }),
8815 _ => return None,
8816 };
8817 Some(res)
8818 }
8819 #[inline]
8820 fn syntax(&self) -> &SyntaxNode {
8821 match self {
8822 VariantDef::Struct(it) => &it.syntax,
8823 VariantDef::Union(it) => &it.syntax,
8824 VariantDef::Variant(it) => &it.syntax,
8825 }
8826 }
8827}
8828impl ast::HasArgList for AnyHasArgList {}
8829impl AstNode for AnyHasArgList {
8830 #[inline]
8831 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, CALL_EXPR | METHOD_CALL_EXPR) }
8832 #[inline]
8833 fn cast(syntax: SyntaxNode) -> Option<Self> {
8834 Self::can_cast(syntax.kind()).then_some(AnyHasArgList { syntax })
8835 }
8836 #[inline]
8837 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8838}
8839impl hash::Hash for AnyHasArgList {
8840 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8841}
8842impl Eq for AnyHasArgList {}
8843impl PartialEq for AnyHasArgList {
8844 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8845}
8846impl Clone for AnyHasArgList {
8847 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8848}
8849impl fmt::Debug for AnyHasArgList {
8850 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8851 f.debug_struct("AnyHasArgList").field("syntax", &self.syntax).finish()
8852 }
8853}
8854impl From<CallExpr> for AnyHasArgList {
8855 #[inline]
8856 fn from(node: CallExpr) -> AnyHasArgList { AnyHasArgList { syntax: node.syntax } }
8857}
8858impl From<MethodCallExpr> for AnyHasArgList {
8859 #[inline]
8860 fn from(node: MethodCallExpr) -> AnyHasArgList { AnyHasArgList { syntax: node.syntax } }
8861}
8862impl ast::HasAttrs for AnyHasAttrs {}
8863impl AstNode for AnyHasAttrs {
8864 #[inline]
8865 fn can_cast(kind: SyntaxKind) -> bool {
8866 matches!(
8867 kind,
8868 ARRAY_EXPR
8869 | ASM_EXPR
8870 | ASSOC_ITEM_LIST
8871 | AWAIT_EXPR
8872 | BECOME_EXPR
8873 | BIN_EXPR
8874 | BLOCK_EXPR
8875 | BREAK_EXPR
8876 | CALL_EXPR
8877 | CAST_EXPR
8878 | CLOSURE_EXPR
8879 | CONST
8880 | CONST_PARAM
8881 | CONTINUE_EXPR
8882 | ENUM
8883 | EXTERN_BLOCK
8884 | EXTERN_CRATE
8885 | EXTERN_ITEM_LIST
8886 | FIELD_EXPR
8887 | FN
8888 | FOR_EXPR
8889 | FORMAT_ARGS_EXPR
8890 | IDENT_PAT
8891 | IF_EXPR
8892 | IMPL
8893 | INDEX_EXPR
8894 | ITEM_LIST
8895 | LET_EXPR
8896 | LET_STMT
8897 | LIFETIME_PARAM
8898 | LITERAL
8899 | LOOP_EXPR
8900 | MACRO_CALL
8901 | MACRO_DEF
8902 | MACRO_RULES
8903 | MATCH_ARM
8904 | MATCH_ARM_LIST
8905 | MATCH_EXPR
8906 | METHOD_CALL_EXPR
8907 | MODULE
8908 | OFFSET_OF_EXPR
8909 | PARAM
8910 | PAREN_EXPR
8911 | PATH_EXPR
8912 | PREFIX_EXPR
8913 | RANGE_EXPR
8914 | RECORD_EXPR_FIELD
8915 | RECORD_EXPR_FIELD_LIST
8916 | RECORD_FIELD
8917 | RECORD_PAT_FIELD
8918 | REF_EXPR
8919 | REST_PAT
8920 | RETURN_EXPR
8921 | SELF_PARAM
8922 | SOURCE_FILE
8923 | STATIC
8924 | STMT_LIST
8925 | STRUCT
8926 | TRAIT
8927 | TRAIT_ALIAS
8928 | TRY_EXPR
8929 | TUPLE_EXPR
8930 | TUPLE_FIELD
8931 | TYPE_ALIAS
8932 | TYPE_PARAM
8933 | UNDERSCORE_EXPR
8934 | UNION
8935 | USE
8936 | VARIANT
8937 | WHILE_EXPR
8938 | YEET_EXPR
8939 | YIELD_EXPR
8940 )
8941 }
8942 #[inline]
8943 fn cast(syntax: SyntaxNode) -> Option<Self> {
8944 Self::can_cast(syntax.kind()).then_some(AnyHasAttrs { syntax })
8945 }
8946 #[inline]
8947 fn syntax(&self) -> &SyntaxNode { &self.syntax }
8948}
8949impl hash::Hash for AnyHasAttrs {
8950 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
8951}
8952impl Eq for AnyHasAttrs {}
8953impl PartialEq for AnyHasAttrs {
8954 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
8955}
8956impl Clone for AnyHasAttrs {
8957 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
8958}
8959impl fmt::Debug for AnyHasAttrs {
8960 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8961 f.debug_struct("AnyHasAttrs").field("syntax", &self.syntax).finish()
8962 }
8963}
8964impl From<ArrayExpr> for AnyHasAttrs {
8965 #[inline]
8966 fn from(node: ArrayExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8967}
8968impl From<AsmExpr> for AnyHasAttrs {
8969 #[inline]
8970 fn from(node: AsmExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8971}
8972impl From<AssocItemList> for AnyHasAttrs {
8973 #[inline]
8974 fn from(node: AssocItemList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8975}
8976impl From<AwaitExpr> for AnyHasAttrs {
8977 #[inline]
8978 fn from(node: AwaitExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8979}
8980impl From<BecomeExpr> for AnyHasAttrs {
8981 #[inline]
8982 fn from(node: BecomeExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8983}
8984impl From<BinExpr> for AnyHasAttrs {
8985 #[inline]
8986 fn from(node: BinExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8987}
8988impl From<BlockExpr> for AnyHasAttrs {
8989 #[inline]
8990 fn from(node: BlockExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8991}
8992impl From<BreakExpr> for AnyHasAttrs {
8993 #[inline]
8994 fn from(node: BreakExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8995}
8996impl From<CallExpr> for AnyHasAttrs {
8997 #[inline]
8998 fn from(node: CallExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
8999}
9000impl From<CastExpr> for AnyHasAttrs {
9001 #[inline]
9002 fn from(node: CastExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9003}
9004impl From<ClosureExpr> for AnyHasAttrs {
9005 #[inline]
9006 fn from(node: ClosureExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9007}
9008impl From<Const> for AnyHasAttrs {
9009 #[inline]
9010 fn from(node: Const) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9011}
9012impl From<ConstParam> for AnyHasAttrs {
9013 #[inline]
9014 fn from(node: ConstParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9015}
9016impl From<ContinueExpr> for AnyHasAttrs {
9017 #[inline]
9018 fn from(node: ContinueExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9019}
9020impl From<Enum> for AnyHasAttrs {
9021 #[inline]
9022 fn from(node: Enum) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9023}
9024impl From<ExternBlock> for AnyHasAttrs {
9025 #[inline]
9026 fn from(node: ExternBlock) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9027}
9028impl From<ExternCrate> for AnyHasAttrs {
9029 #[inline]
9030 fn from(node: ExternCrate) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9031}
9032impl From<ExternItemList> for AnyHasAttrs {
9033 #[inline]
9034 fn from(node: ExternItemList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9035}
9036impl From<FieldExpr> for AnyHasAttrs {
9037 #[inline]
9038 fn from(node: FieldExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9039}
9040impl From<Fn> for AnyHasAttrs {
9041 #[inline]
9042 fn from(node: Fn) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9043}
9044impl From<ForExpr> for AnyHasAttrs {
9045 #[inline]
9046 fn from(node: ForExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9047}
9048impl From<FormatArgsExpr> for AnyHasAttrs {
9049 #[inline]
9050 fn from(node: FormatArgsExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9051}
9052impl From<IdentPat> for AnyHasAttrs {
9053 #[inline]
9054 fn from(node: IdentPat) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9055}
9056impl From<IfExpr> for AnyHasAttrs {
9057 #[inline]
9058 fn from(node: IfExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9059}
9060impl From<Impl> for AnyHasAttrs {
9061 #[inline]
9062 fn from(node: Impl) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9063}
9064impl From<IndexExpr> for AnyHasAttrs {
9065 #[inline]
9066 fn from(node: IndexExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9067}
9068impl From<ItemList> for AnyHasAttrs {
9069 #[inline]
9070 fn from(node: ItemList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9071}
9072impl From<LetExpr> for AnyHasAttrs {
9073 #[inline]
9074 fn from(node: LetExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9075}
9076impl From<LetStmt> for AnyHasAttrs {
9077 #[inline]
9078 fn from(node: LetStmt) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9079}
9080impl From<LifetimeParam> for AnyHasAttrs {
9081 #[inline]
9082 fn from(node: LifetimeParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9083}
9084impl From<Literal> for AnyHasAttrs {
9085 #[inline]
9086 fn from(node: Literal) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9087}
9088impl From<LoopExpr> for AnyHasAttrs {
9089 #[inline]
9090 fn from(node: LoopExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9091}
9092impl From<MacroCall> for AnyHasAttrs {
9093 #[inline]
9094 fn from(node: MacroCall) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9095}
9096impl From<MacroDef> for AnyHasAttrs {
9097 #[inline]
9098 fn from(node: MacroDef) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9099}
9100impl From<MacroRules> for AnyHasAttrs {
9101 #[inline]
9102 fn from(node: MacroRules) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9103}
9104impl From<MatchArm> for AnyHasAttrs {
9105 #[inline]
9106 fn from(node: MatchArm) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9107}
9108impl From<MatchArmList> for AnyHasAttrs {
9109 #[inline]
9110 fn from(node: MatchArmList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9111}
9112impl From<MatchExpr> for AnyHasAttrs {
9113 #[inline]
9114 fn from(node: MatchExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9115}
9116impl From<MethodCallExpr> for AnyHasAttrs {
9117 #[inline]
9118 fn from(node: MethodCallExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9119}
9120impl From<Module> for AnyHasAttrs {
9121 #[inline]
9122 fn from(node: Module) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9123}
9124impl From<OffsetOfExpr> for AnyHasAttrs {
9125 #[inline]
9126 fn from(node: OffsetOfExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9127}
9128impl From<Param> for AnyHasAttrs {
9129 #[inline]
9130 fn from(node: Param) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9131}
9132impl From<ParenExpr> for AnyHasAttrs {
9133 #[inline]
9134 fn from(node: ParenExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9135}
9136impl From<PathExpr> for AnyHasAttrs {
9137 #[inline]
9138 fn from(node: PathExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9139}
9140impl From<PrefixExpr> for AnyHasAttrs {
9141 #[inline]
9142 fn from(node: PrefixExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9143}
9144impl From<RangeExpr> for AnyHasAttrs {
9145 #[inline]
9146 fn from(node: RangeExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9147}
9148impl From<RecordExprField> for AnyHasAttrs {
9149 #[inline]
9150 fn from(node: RecordExprField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9151}
9152impl From<RecordExprFieldList> for AnyHasAttrs {
9153 #[inline]
9154 fn from(node: RecordExprFieldList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9155}
9156impl From<RecordField> for AnyHasAttrs {
9157 #[inline]
9158 fn from(node: RecordField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9159}
9160impl From<RecordPatField> for AnyHasAttrs {
9161 #[inline]
9162 fn from(node: RecordPatField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9163}
9164impl From<RefExpr> for AnyHasAttrs {
9165 #[inline]
9166 fn from(node: RefExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9167}
9168impl From<RestPat> for AnyHasAttrs {
9169 #[inline]
9170 fn from(node: RestPat) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9171}
9172impl From<ReturnExpr> for AnyHasAttrs {
9173 #[inline]
9174 fn from(node: ReturnExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9175}
9176impl From<SelfParam> for AnyHasAttrs {
9177 #[inline]
9178 fn from(node: SelfParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9179}
9180impl From<SourceFile> for AnyHasAttrs {
9181 #[inline]
9182 fn from(node: SourceFile) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9183}
9184impl From<Static> for AnyHasAttrs {
9185 #[inline]
9186 fn from(node: Static) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9187}
9188impl From<StmtList> for AnyHasAttrs {
9189 #[inline]
9190 fn from(node: StmtList) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9191}
9192impl From<Struct> for AnyHasAttrs {
9193 #[inline]
9194 fn from(node: Struct) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9195}
9196impl From<Trait> for AnyHasAttrs {
9197 #[inline]
9198 fn from(node: Trait) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9199}
9200impl From<TraitAlias> for AnyHasAttrs {
9201 #[inline]
9202 fn from(node: TraitAlias) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9203}
9204impl From<TryExpr> for AnyHasAttrs {
9205 #[inline]
9206 fn from(node: TryExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9207}
9208impl From<TupleExpr> for AnyHasAttrs {
9209 #[inline]
9210 fn from(node: TupleExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9211}
9212impl From<TupleField> for AnyHasAttrs {
9213 #[inline]
9214 fn from(node: TupleField) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9215}
9216impl From<TypeAlias> for AnyHasAttrs {
9217 #[inline]
9218 fn from(node: TypeAlias) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9219}
9220impl From<TypeParam> for AnyHasAttrs {
9221 #[inline]
9222 fn from(node: TypeParam) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9223}
9224impl From<UnderscoreExpr> for AnyHasAttrs {
9225 #[inline]
9226 fn from(node: UnderscoreExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9227}
9228impl From<Union> for AnyHasAttrs {
9229 #[inline]
9230 fn from(node: Union) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9231}
9232impl From<Use> for AnyHasAttrs {
9233 #[inline]
9234 fn from(node: Use) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9235}
9236impl From<Variant> for AnyHasAttrs {
9237 #[inline]
9238 fn from(node: Variant) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9239}
9240impl From<WhileExpr> for AnyHasAttrs {
9241 #[inline]
9242 fn from(node: WhileExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9243}
9244impl From<YeetExpr> for AnyHasAttrs {
9245 #[inline]
9246 fn from(node: YeetExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9247}
9248impl From<YieldExpr> for AnyHasAttrs {
9249 #[inline]
9250 fn from(node: YieldExpr) -> AnyHasAttrs { AnyHasAttrs { syntax: node.syntax } }
9251}
9252impl ast::HasDocComments for AnyHasDocComments {}
9253impl AstNode for AnyHasDocComments {
9254 #[inline]
9255 fn can_cast(kind: SyntaxKind) -> bool {
9256 matches!(
9257 kind,
9258 CONST
9259 | ENUM
9260 | EXTERN_BLOCK
9261 | EXTERN_CRATE
9262 | FN
9263 | IMPL
9264 | MACRO_CALL
9265 | MACRO_DEF
9266 | MACRO_RULES
9267 | MODULE
9268 | RECORD_FIELD
9269 | SOURCE_FILE
9270 | STATIC
9271 | STRUCT
9272 | TRAIT
9273 | TRAIT_ALIAS
9274 | TUPLE_FIELD
9275 | TYPE_ALIAS
9276 | UNION
9277 | USE
9278 | VARIANT
9279 )
9280 }
9281 #[inline]
9282 fn cast(syntax: SyntaxNode) -> Option<Self> {
9283 Self::can_cast(syntax.kind()).then_some(AnyHasDocComments { syntax })
9284 }
9285 #[inline]
9286 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9287}
9288impl hash::Hash for AnyHasDocComments {
9289 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9290}
9291impl Eq for AnyHasDocComments {}
9292impl PartialEq for AnyHasDocComments {
9293 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9294}
9295impl Clone for AnyHasDocComments {
9296 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9297}
9298impl fmt::Debug for AnyHasDocComments {
9299 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9300 f.debug_struct("AnyHasDocComments").field("syntax", &self.syntax).finish()
9301 }
9302}
9303impl From<Const> for AnyHasDocComments {
9304 #[inline]
9305 fn from(node: Const) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9306}
9307impl From<Enum> for AnyHasDocComments {
9308 #[inline]
9309 fn from(node: Enum) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9310}
9311impl From<ExternBlock> for AnyHasDocComments {
9312 #[inline]
9313 fn from(node: ExternBlock) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9314}
9315impl From<ExternCrate> for AnyHasDocComments {
9316 #[inline]
9317 fn from(node: ExternCrate) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9318}
9319impl From<Fn> for AnyHasDocComments {
9320 #[inline]
9321 fn from(node: Fn) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9322}
9323impl From<Impl> for AnyHasDocComments {
9324 #[inline]
9325 fn from(node: Impl) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9326}
9327impl From<MacroCall> for AnyHasDocComments {
9328 #[inline]
9329 fn from(node: MacroCall) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9330}
9331impl From<MacroDef> for AnyHasDocComments {
9332 #[inline]
9333 fn from(node: MacroDef) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9334}
9335impl From<MacroRules> for AnyHasDocComments {
9336 #[inline]
9337 fn from(node: MacroRules) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9338}
9339impl From<Module> for AnyHasDocComments {
9340 #[inline]
9341 fn from(node: Module) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9342}
9343impl From<RecordField> for AnyHasDocComments {
9344 #[inline]
9345 fn from(node: RecordField) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9346}
9347impl From<SourceFile> for AnyHasDocComments {
9348 #[inline]
9349 fn from(node: SourceFile) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9350}
9351impl From<Static> for AnyHasDocComments {
9352 #[inline]
9353 fn from(node: Static) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9354}
9355impl From<Struct> for AnyHasDocComments {
9356 #[inline]
9357 fn from(node: Struct) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9358}
9359impl From<Trait> for AnyHasDocComments {
9360 #[inline]
9361 fn from(node: Trait) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9362}
9363impl From<TraitAlias> for AnyHasDocComments {
9364 #[inline]
9365 fn from(node: TraitAlias) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9366}
9367impl From<TupleField> for AnyHasDocComments {
9368 #[inline]
9369 fn from(node: TupleField) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9370}
9371impl From<TypeAlias> for AnyHasDocComments {
9372 #[inline]
9373 fn from(node: TypeAlias) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9374}
9375impl From<Union> for AnyHasDocComments {
9376 #[inline]
9377 fn from(node: Union) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9378}
9379impl From<Use> for AnyHasDocComments {
9380 #[inline]
9381 fn from(node: Use) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9382}
9383impl From<Variant> for AnyHasDocComments {
9384 #[inline]
9385 fn from(node: Variant) -> AnyHasDocComments { AnyHasDocComments { syntax: node.syntax } }
9386}
9387impl ast::HasGenericArgs for AnyHasGenericArgs {}
9388impl AstNode for AnyHasGenericArgs {
9389 #[inline]
9390 fn can_cast(kind: SyntaxKind) -> bool {
9391 matches!(kind, ASSOC_TYPE_ARG | METHOD_CALL_EXPR | PATH_SEGMENT)
9392 }
9393 #[inline]
9394 fn cast(syntax: SyntaxNode) -> Option<Self> {
9395 Self::can_cast(syntax.kind()).then_some(AnyHasGenericArgs { syntax })
9396 }
9397 #[inline]
9398 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9399}
9400impl hash::Hash for AnyHasGenericArgs {
9401 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9402}
9403impl Eq for AnyHasGenericArgs {}
9404impl PartialEq for AnyHasGenericArgs {
9405 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9406}
9407impl Clone for AnyHasGenericArgs {
9408 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9409}
9410impl fmt::Debug for AnyHasGenericArgs {
9411 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9412 f.debug_struct("AnyHasGenericArgs").field("syntax", &self.syntax).finish()
9413 }
9414}
9415impl From<AssocTypeArg> for AnyHasGenericArgs {
9416 #[inline]
9417 fn from(node: AssocTypeArg) -> AnyHasGenericArgs { AnyHasGenericArgs { syntax: node.syntax } }
9418}
9419impl From<MethodCallExpr> for AnyHasGenericArgs {
9420 #[inline]
9421 fn from(node: MethodCallExpr) -> AnyHasGenericArgs { AnyHasGenericArgs { syntax: node.syntax } }
9422}
9423impl From<PathSegment> for AnyHasGenericArgs {
9424 #[inline]
9425 fn from(node: PathSegment) -> AnyHasGenericArgs { AnyHasGenericArgs { syntax: node.syntax } }
9426}
9427impl ast::HasGenericParams for AnyHasGenericParams {}
9428impl AstNode for AnyHasGenericParams {
9429 #[inline]
9430 fn can_cast(kind: SyntaxKind) -> bool {
9431 matches!(kind, CONST | ENUM | FN | IMPL | STRUCT | TRAIT | TRAIT_ALIAS | TYPE_ALIAS | UNION)
9432 }
9433 #[inline]
9434 fn cast(syntax: SyntaxNode) -> Option<Self> {
9435 Self::can_cast(syntax.kind()).then_some(AnyHasGenericParams { syntax })
9436 }
9437 #[inline]
9438 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9439}
9440impl hash::Hash for AnyHasGenericParams {
9441 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9442}
9443impl Eq for AnyHasGenericParams {}
9444impl PartialEq for AnyHasGenericParams {
9445 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9446}
9447impl Clone for AnyHasGenericParams {
9448 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9449}
9450impl fmt::Debug for AnyHasGenericParams {
9451 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9452 f.debug_struct("AnyHasGenericParams").field("syntax", &self.syntax).finish()
9453 }
9454}
9455impl From<Const> for AnyHasGenericParams {
9456 #[inline]
9457 fn from(node: Const) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
9458}
9459impl From<Enum> for AnyHasGenericParams {
9460 #[inline]
9461 fn from(node: Enum) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
9462}
9463impl From<Fn> for AnyHasGenericParams {
9464 #[inline]
9465 fn from(node: Fn) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
9466}
9467impl From<Impl> for AnyHasGenericParams {
9468 #[inline]
9469 fn from(node: Impl) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
9470}
9471impl From<Struct> for AnyHasGenericParams {
9472 #[inline]
9473 fn from(node: Struct) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
9474}
9475impl From<Trait> for AnyHasGenericParams {
9476 #[inline]
9477 fn from(node: Trait) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
9478}
9479impl From<TraitAlias> for AnyHasGenericParams {
9480 #[inline]
9481 fn from(node: TraitAlias) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
9482}
9483impl From<TypeAlias> for AnyHasGenericParams {
9484 #[inline]
9485 fn from(node: TypeAlias) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
9486}
9487impl From<Union> for AnyHasGenericParams {
9488 #[inline]
9489 fn from(node: Union) -> AnyHasGenericParams { AnyHasGenericParams { syntax: node.syntax } }
9490}
9491impl ast::HasLoopBody for AnyHasLoopBody {}
9492impl AstNode for AnyHasLoopBody {
9493 #[inline]
9494 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, FOR_EXPR | LOOP_EXPR | WHILE_EXPR) }
9495 #[inline]
9496 fn cast(syntax: SyntaxNode) -> Option<Self> {
9497 Self::can_cast(syntax.kind()).then_some(AnyHasLoopBody { syntax })
9498 }
9499 #[inline]
9500 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9501}
9502impl hash::Hash for AnyHasLoopBody {
9503 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9504}
9505impl Eq for AnyHasLoopBody {}
9506impl PartialEq for AnyHasLoopBody {
9507 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9508}
9509impl Clone for AnyHasLoopBody {
9510 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9511}
9512impl fmt::Debug for AnyHasLoopBody {
9513 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9514 f.debug_struct("AnyHasLoopBody").field("syntax", &self.syntax).finish()
9515 }
9516}
9517impl From<ForExpr> for AnyHasLoopBody {
9518 #[inline]
9519 fn from(node: ForExpr) -> AnyHasLoopBody { AnyHasLoopBody { syntax: node.syntax } }
9520}
9521impl From<LoopExpr> for AnyHasLoopBody {
9522 #[inline]
9523 fn from(node: LoopExpr) -> AnyHasLoopBody { AnyHasLoopBody { syntax: node.syntax } }
9524}
9525impl From<WhileExpr> for AnyHasLoopBody {
9526 #[inline]
9527 fn from(node: WhileExpr) -> AnyHasLoopBody { AnyHasLoopBody { syntax: node.syntax } }
9528}
9529impl ast::HasModuleItem for AnyHasModuleItem {}
9530impl AstNode for AnyHasModuleItem {
9531 #[inline]
9532 fn can_cast(kind: SyntaxKind) -> bool { matches!(kind, ITEM_LIST | MACRO_ITEMS | SOURCE_FILE) }
9533 #[inline]
9534 fn cast(syntax: SyntaxNode) -> Option<Self> {
9535 Self::can_cast(syntax.kind()).then_some(AnyHasModuleItem { syntax })
9536 }
9537 #[inline]
9538 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9539}
9540impl hash::Hash for AnyHasModuleItem {
9541 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9542}
9543impl Eq for AnyHasModuleItem {}
9544impl PartialEq for AnyHasModuleItem {
9545 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9546}
9547impl Clone for AnyHasModuleItem {
9548 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9549}
9550impl fmt::Debug for AnyHasModuleItem {
9551 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9552 f.debug_struct("AnyHasModuleItem").field("syntax", &self.syntax).finish()
9553 }
9554}
9555impl From<ItemList> for AnyHasModuleItem {
9556 #[inline]
9557 fn from(node: ItemList) -> AnyHasModuleItem { AnyHasModuleItem { syntax: node.syntax } }
9558}
9559impl From<MacroItems> for AnyHasModuleItem {
9560 #[inline]
9561 fn from(node: MacroItems) -> AnyHasModuleItem { AnyHasModuleItem { syntax: node.syntax } }
9562}
9563impl From<SourceFile> for AnyHasModuleItem {
9564 #[inline]
9565 fn from(node: SourceFile) -> AnyHasModuleItem { AnyHasModuleItem { syntax: node.syntax } }
9566}
9567impl ast::HasName for AnyHasName {}
9568impl AstNode for AnyHasName {
9569 #[inline]
9570 fn can_cast(kind: SyntaxKind) -> bool {
9571 matches!(
9572 kind,
9573 ASM_OPERAND_NAMED
9574 | CONST
9575 | CONST_PARAM
9576 | ENUM
9577 | FN
9578 | FORMAT_ARGS_ARG
9579 | IDENT_PAT
9580 | MACRO_DEF
9581 | MACRO_RULES
9582 | MODULE
9583 | RECORD_FIELD
9584 | RENAME
9585 | SELF_PARAM
9586 | STATIC
9587 | STRUCT
9588 | TRAIT
9589 | TRAIT_ALIAS
9590 | TYPE_ALIAS
9591 | TYPE_PARAM
9592 | UNION
9593 | VARIANT
9594 )
9595 }
9596 #[inline]
9597 fn cast(syntax: SyntaxNode) -> Option<Self> {
9598 Self::can_cast(syntax.kind()).then_some(AnyHasName { syntax })
9599 }
9600 #[inline]
9601 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9602}
9603impl hash::Hash for AnyHasName {
9604 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9605}
9606impl Eq for AnyHasName {}
9607impl PartialEq for AnyHasName {
9608 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9609}
9610impl Clone for AnyHasName {
9611 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9612}
9613impl fmt::Debug for AnyHasName {
9614 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9615 f.debug_struct("AnyHasName").field("syntax", &self.syntax).finish()
9616 }
9617}
9618impl From<AsmOperandNamed> for AnyHasName {
9619 #[inline]
9620 fn from(node: AsmOperandNamed) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9621}
9622impl From<Const> for AnyHasName {
9623 #[inline]
9624 fn from(node: Const) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9625}
9626impl From<ConstParam> for AnyHasName {
9627 #[inline]
9628 fn from(node: ConstParam) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9629}
9630impl From<Enum> for AnyHasName {
9631 #[inline]
9632 fn from(node: Enum) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9633}
9634impl From<Fn> for AnyHasName {
9635 #[inline]
9636 fn from(node: Fn) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9637}
9638impl From<FormatArgsArg> for AnyHasName {
9639 #[inline]
9640 fn from(node: FormatArgsArg) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9641}
9642impl From<IdentPat> for AnyHasName {
9643 #[inline]
9644 fn from(node: IdentPat) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9645}
9646impl From<MacroDef> for AnyHasName {
9647 #[inline]
9648 fn from(node: MacroDef) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9649}
9650impl From<MacroRules> for AnyHasName {
9651 #[inline]
9652 fn from(node: MacroRules) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9653}
9654impl From<Module> for AnyHasName {
9655 #[inline]
9656 fn from(node: Module) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9657}
9658impl From<RecordField> for AnyHasName {
9659 #[inline]
9660 fn from(node: RecordField) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9661}
9662impl From<Rename> for AnyHasName {
9663 #[inline]
9664 fn from(node: Rename) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9665}
9666impl From<SelfParam> for AnyHasName {
9667 #[inline]
9668 fn from(node: SelfParam) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9669}
9670impl From<Static> for AnyHasName {
9671 #[inline]
9672 fn from(node: Static) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9673}
9674impl From<Struct> for AnyHasName {
9675 #[inline]
9676 fn from(node: Struct) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9677}
9678impl From<Trait> for AnyHasName {
9679 #[inline]
9680 fn from(node: Trait) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9681}
9682impl From<TraitAlias> for AnyHasName {
9683 #[inline]
9684 fn from(node: TraitAlias) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9685}
9686impl From<TypeAlias> for AnyHasName {
9687 #[inline]
9688 fn from(node: TypeAlias) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9689}
9690impl From<TypeParam> for AnyHasName {
9691 #[inline]
9692 fn from(node: TypeParam) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9693}
9694impl From<Union> for AnyHasName {
9695 #[inline]
9696 fn from(node: Union) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9697}
9698impl From<Variant> for AnyHasName {
9699 #[inline]
9700 fn from(node: Variant) -> AnyHasName { AnyHasName { syntax: node.syntax } }
9701}
9702impl ast::HasTypeBounds for AnyHasTypeBounds {}
9703impl AstNode for AnyHasTypeBounds {
9704 #[inline]
9705 fn can_cast(kind: SyntaxKind) -> bool {
9706 matches!(
9707 kind,
9708 ASSOC_TYPE_ARG | LIFETIME_PARAM | TRAIT | TYPE_ALIAS | TYPE_PARAM | WHERE_PRED
9709 )
9710 }
9711 #[inline]
9712 fn cast(syntax: SyntaxNode) -> Option<Self> {
9713 Self::can_cast(syntax.kind()).then_some(AnyHasTypeBounds { syntax })
9714 }
9715 #[inline]
9716 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9717}
9718impl hash::Hash for AnyHasTypeBounds {
9719 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9720}
9721impl Eq for AnyHasTypeBounds {}
9722impl PartialEq for AnyHasTypeBounds {
9723 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9724}
9725impl Clone for AnyHasTypeBounds {
9726 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9727}
9728impl fmt::Debug for AnyHasTypeBounds {
9729 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9730 f.debug_struct("AnyHasTypeBounds").field("syntax", &self.syntax).finish()
9731 }
9732}
9733impl From<AssocTypeArg> for AnyHasTypeBounds {
9734 #[inline]
9735 fn from(node: AssocTypeArg) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9736}
9737impl From<LifetimeParam> for AnyHasTypeBounds {
9738 #[inline]
9739 fn from(node: LifetimeParam) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9740}
9741impl From<Trait> for AnyHasTypeBounds {
9742 #[inline]
9743 fn from(node: Trait) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9744}
9745impl From<TypeAlias> for AnyHasTypeBounds {
9746 #[inline]
9747 fn from(node: TypeAlias) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9748}
9749impl From<TypeParam> for AnyHasTypeBounds {
9750 #[inline]
9751 fn from(node: TypeParam) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9752}
9753impl From<WherePred> for AnyHasTypeBounds {
9754 #[inline]
9755 fn from(node: WherePred) -> AnyHasTypeBounds { AnyHasTypeBounds { syntax: node.syntax } }
9756}
9757impl ast::HasVisibility for AnyHasVisibility {}
9758impl AstNode for AnyHasVisibility {
9759 #[inline]
9760 fn can_cast(kind: SyntaxKind) -> bool {
9761 matches!(
9762 kind,
9763 CONST
9764 | ENUM
9765 | EXTERN_CRATE
9766 | FN
9767 | IMPL
9768 | MACRO_DEF
9769 | MACRO_RULES
9770 | MODULE
9771 | RECORD_FIELD
9772 | STATIC
9773 | STRUCT
9774 | TRAIT
9775 | TRAIT_ALIAS
9776 | TUPLE_FIELD
9777 | TYPE_ALIAS
9778 | UNION
9779 | USE
9780 | VARIANT
9781 )
9782 }
9783 #[inline]
9784 fn cast(syntax: SyntaxNode) -> Option<Self> {
9785 Self::can_cast(syntax.kind()).then_some(AnyHasVisibility { syntax })
9786 }
9787 #[inline]
9788 fn syntax(&self) -> &SyntaxNode { &self.syntax }
9789}
9790impl hash::Hash for AnyHasVisibility {
9791 fn hash<H: hash::Hasher>(&self, state: &mut H) { self.syntax.hash(state); }
9792}
9793impl Eq for AnyHasVisibility {}
9794impl PartialEq for AnyHasVisibility {
9795 fn eq(&self, other: &Self) -> bool { self.syntax == other.syntax }
9796}
9797impl Clone for AnyHasVisibility {
9798 fn clone(&self) -> Self { Self { syntax: self.syntax.clone() } }
9799}
9800impl fmt::Debug for AnyHasVisibility {
9801 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9802 f.debug_struct("AnyHasVisibility").field("syntax", &self.syntax).finish()
9803 }
9804}
9805impl From<Const> for AnyHasVisibility {
9806 #[inline]
9807 fn from(node: Const) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9808}
9809impl From<Enum> for AnyHasVisibility {
9810 #[inline]
9811 fn from(node: Enum) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9812}
9813impl From<ExternCrate> for AnyHasVisibility {
9814 #[inline]
9815 fn from(node: ExternCrate) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9816}
9817impl From<Fn> for AnyHasVisibility {
9818 #[inline]
9819 fn from(node: Fn) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9820}
9821impl From<Impl> for AnyHasVisibility {
9822 #[inline]
9823 fn from(node: Impl) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9824}
9825impl From<MacroDef> for AnyHasVisibility {
9826 #[inline]
9827 fn from(node: MacroDef) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9828}
9829impl From<MacroRules> for AnyHasVisibility {
9830 #[inline]
9831 fn from(node: MacroRules) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9832}
9833impl From<Module> for AnyHasVisibility {
9834 #[inline]
9835 fn from(node: Module) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9836}
9837impl From<RecordField> for AnyHasVisibility {
9838 #[inline]
9839 fn from(node: RecordField) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9840}
9841impl From<Static> for AnyHasVisibility {
9842 #[inline]
9843 fn from(node: Static) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9844}
9845impl From<Struct> for AnyHasVisibility {
9846 #[inline]
9847 fn from(node: Struct) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9848}
9849impl From<Trait> for AnyHasVisibility {
9850 #[inline]
9851 fn from(node: Trait) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9852}
9853impl From<TraitAlias> for AnyHasVisibility {
9854 #[inline]
9855 fn from(node: TraitAlias) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9856}
9857impl From<TupleField> for AnyHasVisibility {
9858 #[inline]
9859 fn from(node: TupleField) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9860}
9861impl From<TypeAlias> for AnyHasVisibility {
9862 #[inline]
9863 fn from(node: TypeAlias) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9864}
9865impl From<Union> for AnyHasVisibility {
9866 #[inline]
9867 fn from(node: Union) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9868}
9869impl From<Use> for AnyHasVisibility {
9870 #[inline]
9871 fn from(node: Use) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9872}
9873impl From<Variant> for AnyHasVisibility {
9874 #[inline]
9875 fn from(node: Variant) -> AnyHasVisibility { AnyHasVisibility { syntax: node.syntax } }
9876}
9877impl std::fmt::Display for Adt {
9878 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9879 std::fmt::Display::fmt(self.syntax(), f)
9880 }
9881}
9882impl std::fmt::Display for AsmOperand {
9883 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9884 std::fmt::Display::fmt(self.syntax(), f)
9885 }
9886}
9887impl std::fmt::Display for AsmPiece {
9888 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9889 std::fmt::Display::fmt(self.syntax(), f)
9890 }
9891}
9892impl std::fmt::Display for AssocItem {
9893 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9894 std::fmt::Display::fmt(self.syntax(), f)
9895 }
9896}
9897impl std::fmt::Display for Expr {
9898 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9899 std::fmt::Display::fmt(self.syntax(), f)
9900 }
9901}
9902impl std::fmt::Display for ExternItem {
9903 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9904 std::fmt::Display::fmt(self.syntax(), f)
9905 }
9906}
9907impl std::fmt::Display for FieldList {
9908 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9909 std::fmt::Display::fmt(self.syntax(), f)
9910 }
9911}
9912impl std::fmt::Display for GenericArg {
9913 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9914 std::fmt::Display::fmt(self.syntax(), f)
9915 }
9916}
9917impl std::fmt::Display for GenericParam {
9918 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9919 std::fmt::Display::fmt(self.syntax(), f)
9920 }
9921}
9922impl std::fmt::Display for Item {
9923 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9924 std::fmt::Display::fmt(self.syntax(), f)
9925 }
9926}
9927impl std::fmt::Display for Pat {
9928 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9929 std::fmt::Display::fmt(self.syntax(), f)
9930 }
9931}
9932impl std::fmt::Display for Stmt {
9933 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9934 std::fmt::Display::fmt(self.syntax(), f)
9935 }
9936}
9937impl std::fmt::Display for Type {
9938 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9939 std::fmt::Display::fmt(self.syntax(), f)
9940 }
9941}
9942impl std::fmt::Display for UseBoundGenericArg {
9943 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9944 std::fmt::Display::fmt(self.syntax(), f)
9945 }
9946}
9947impl std::fmt::Display for VariantDef {
9948 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9949 std::fmt::Display::fmt(self.syntax(), f)
9950 }
9951}
9952impl std::fmt::Display for Abi {
9953 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9954 std::fmt::Display::fmt(self.syntax(), f)
9955 }
9956}
9957impl std::fmt::Display for ArgList {
9958 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9959 std::fmt::Display::fmt(self.syntax(), f)
9960 }
9961}
9962impl std::fmt::Display for ArrayExpr {
9963 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9964 std::fmt::Display::fmt(self.syntax(), f)
9965 }
9966}
9967impl std::fmt::Display for ArrayType {
9968 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9969 std::fmt::Display::fmt(self.syntax(), f)
9970 }
9971}
9972impl std::fmt::Display for AsmClobberAbi {
9973 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9974 std::fmt::Display::fmt(self.syntax(), f)
9975 }
9976}
9977impl std::fmt::Display for AsmConst {
9978 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9979 std::fmt::Display::fmt(self.syntax(), f)
9980 }
9981}
9982impl std::fmt::Display for AsmDirSpec {
9983 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9984 std::fmt::Display::fmt(self.syntax(), f)
9985 }
9986}
9987impl std::fmt::Display for AsmExpr {
9988 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9989 std::fmt::Display::fmt(self.syntax(), f)
9990 }
9991}
9992impl std::fmt::Display for AsmLabel {
9993 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9994 std::fmt::Display::fmt(self.syntax(), f)
9995 }
9996}
9997impl std::fmt::Display for AsmOperandExpr {
9998 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9999 std::fmt::Display::fmt(self.syntax(), f)
10000 }
10001}
10002impl std::fmt::Display for AsmOperandNamed {
10003 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10004 std::fmt::Display::fmt(self.syntax(), f)
10005 }
10006}
10007impl std::fmt::Display for AsmOption {
10008 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10009 std::fmt::Display::fmt(self.syntax(), f)
10010 }
10011}
10012impl std::fmt::Display for AsmOptions {
10013 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10014 std::fmt::Display::fmt(self.syntax(), f)
10015 }
10016}
10017impl std::fmt::Display for AsmRegOperand {
10018 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10019 std::fmt::Display::fmt(self.syntax(), f)
10020 }
10021}
10022impl std::fmt::Display for AsmRegSpec {
10023 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10024 std::fmt::Display::fmt(self.syntax(), f)
10025 }
10026}
10027impl std::fmt::Display for AsmSym {
10028 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10029 std::fmt::Display::fmt(self.syntax(), f)
10030 }
10031}
10032impl std::fmt::Display for AssocItemList {
10033 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10034 std::fmt::Display::fmt(self.syntax(), f)
10035 }
10036}
10037impl std::fmt::Display for AssocTypeArg {
10038 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10039 std::fmt::Display::fmt(self.syntax(), f)
10040 }
10041}
10042impl std::fmt::Display for Attr {
10043 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10044 std::fmt::Display::fmt(self.syntax(), f)
10045 }
10046}
10047impl std::fmt::Display for AwaitExpr {
10048 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10049 std::fmt::Display::fmt(self.syntax(), f)
10050 }
10051}
10052impl std::fmt::Display for BecomeExpr {
10053 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10054 std::fmt::Display::fmt(self.syntax(), f)
10055 }
10056}
10057impl std::fmt::Display for BinExpr {
10058 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10059 std::fmt::Display::fmt(self.syntax(), f)
10060 }
10061}
10062impl std::fmt::Display for BlockExpr {
10063 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10064 std::fmt::Display::fmt(self.syntax(), f)
10065 }
10066}
10067impl std::fmt::Display for BoxPat {
10068 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10069 std::fmt::Display::fmt(self.syntax(), f)
10070 }
10071}
10072impl std::fmt::Display for BreakExpr {
10073 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10074 std::fmt::Display::fmt(self.syntax(), f)
10075 }
10076}
10077impl std::fmt::Display for CallExpr {
10078 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10079 std::fmt::Display::fmt(self.syntax(), f)
10080 }
10081}
10082impl std::fmt::Display for CastExpr {
10083 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10084 std::fmt::Display::fmt(self.syntax(), f)
10085 }
10086}
10087impl std::fmt::Display for ClosureBinder {
10088 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10089 std::fmt::Display::fmt(self.syntax(), f)
10090 }
10091}
10092impl std::fmt::Display for ClosureExpr {
10093 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10094 std::fmt::Display::fmt(self.syntax(), f)
10095 }
10096}
10097impl std::fmt::Display for Const {
10098 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10099 std::fmt::Display::fmt(self.syntax(), f)
10100 }
10101}
10102impl std::fmt::Display for ConstArg {
10103 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10104 std::fmt::Display::fmt(self.syntax(), f)
10105 }
10106}
10107impl std::fmt::Display for ConstBlockPat {
10108 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10109 std::fmt::Display::fmt(self.syntax(), f)
10110 }
10111}
10112impl std::fmt::Display for ConstParam {
10113 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10114 std::fmt::Display::fmt(self.syntax(), f)
10115 }
10116}
10117impl std::fmt::Display for ContinueExpr {
10118 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10119 std::fmt::Display::fmt(self.syntax(), f)
10120 }
10121}
10122impl std::fmt::Display for DynTraitType {
10123 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10124 std::fmt::Display::fmt(self.syntax(), f)
10125 }
10126}
10127impl std::fmt::Display for Enum {
10128 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10129 std::fmt::Display::fmt(self.syntax(), f)
10130 }
10131}
10132impl std::fmt::Display for ExprStmt {
10133 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10134 std::fmt::Display::fmt(self.syntax(), f)
10135 }
10136}
10137impl std::fmt::Display for ExternBlock {
10138 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10139 std::fmt::Display::fmt(self.syntax(), f)
10140 }
10141}
10142impl std::fmt::Display for ExternCrate {
10143 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10144 std::fmt::Display::fmt(self.syntax(), f)
10145 }
10146}
10147impl std::fmt::Display for ExternItemList {
10148 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10149 std::fmt::Display::fmt(self.syntax(), f)
10150 }
10151}
10152impl std::fmt::Display for FieldExpr {
10153 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10154 std::fmt::Display::fmt(self.syntax(), f)
10155 }
10156}
10157impl std::fmt::Display for Fn {
10158 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10159 std::fmt::Display::fmt(self.syntax(), f)
10160 }
10161}
10162impl std::fmt::Display for FnPtrType {
10163 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10164 std::fmt::Display::fmt(self.syntax(), f)
10165 }
10166}
10167impl std::fmt::Display for ForExpr {
10168 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10169 std::fmt::Display::fmt(self.syntax(), f)
10170 }
10171}
10172impl std::fmt::Display for ForType {
10173 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10174 std::fmt::Display::fmt(self.syntax(), f)
10175 }
10176}
10177impl std::fmt::Display for FormatArgsArg {
10178 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10179 std::fmt::Display::fmt(self.syntax(), f)
10180 }
10181}
10182impl std::fmt::Display for FormatArgsExpr {
10183 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10184 std::fmt::Display::fmt(self.syntax(), f)
10185 }
10186}
10187impl std::fmt::Display for GenericArgList {
10188 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10189 std::fmt::Display::fmt(self.syntax(), f)
10190 }
10191}
10192impl std::fmt::Display for GenericParamList {
10193 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10194 std::fmt::Display::fmt(self.syntax(), f)
10195 }
10196}
10197impl std::fmt::Display for IdentPat {
10198 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10199 std::fmt::Display::fmt(self.syntax(), f)
10200 }
10201}
10202impl std::fmt::Display for IfExpr {
10203 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10204 std::fmt::Display::fmt(self.syntax(), f)
10205 }
10206}
10207impl std::fmt::Display for Impl {
10208 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10209 std::fmt::Display::fmt(self.syntax(), f)
10210 }
10211}
10212impl std::fmt::Display for ImplTraitType {
10213 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10214 std::fmt::Display::fmt(self.syntax(), f)
10215 }
10216}
10217impl std::fmt::Display for IndexExpr {
10218 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10219 std::fmt::Display::fmt(self.syntax(), f)
10220 }
10221}
10222impl std::fmt::Display for InferType {
10223 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10224 std::fmt::Display::fmt(self.syntax(), f)
10225 }
10226}
10227impl std::fmt::Display for ItemList {
10228 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10229 std::fmt::Display::fmt(self.syntax(), f)
10230 }
10231}
10232impl std::fmt::Display for Label {
10233 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10234 std::fmt::Display::fmt(self.syntax(), f)
10235 }
10236}
10237impl std::fmt::Display for LetElse {
10238 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10239 std::fmt::Display::fmt(self.syntax(), f)
10240 }
10241}
10242impl std::fmt::Display for LetExpr {
10243 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10244 std::fmt::Display::fmt(self.syntax(), f)
10245 }
10246}
10247impl std::fmt::Display for LetStmt {
10248 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10249 std::fmt::Display::fmt(self.syntax(), f)
10250 }
10251}
10252impl std::fmt::Display for Lifetime {
10253 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10254 std::fmt::Display::fmt(self.syntax(), f)
10255 }
10256}
10257impl std::fmt::Display for LifetimeArg {
10258 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10259 std::fmt::Display::fmt(self.syntax(), f)
10260 }
10261}
10262impl std::fmt::Display for LifetimeParam {
10263 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10264 std::fmt::Display::fmt(self.syntax(), f)
10265 }
10266}
10267impl std::fmt::Display for Literal {
10268 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10269 std::fmt::Display::fmt(self.syntax(), f)
10270 }
10271}
10272impl std::fmt::Display for LiteralPat {
10273 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10274 std::fmt::Display::fmt(self.syntax(), f)
10275 }
10276}
10277impl std::fmt::Display for LoopExpr {
10278 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10279 std::fmt::Display::fmt(self.syntax(), f)
10280 }
10281}
10282impl std::fmt::Display for MacroCall {
10283 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10284 std::fmt::Display::fmt(self.syntax(), f)
10285 }
10286}
10287impl std::fmt::Display for MacroDef {
10288 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10289 std::fmt::Display::fmt(self.syntax(), f)
10290 }
10291}
10292impl std::fmt::Display for MacroExpr {
10293 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10294 std::fmt::Display::fmt(self.syntax(), f)
10295 }
10296}
10297impl std::fmt::Display for MacroItems {
10298 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10299 std::fmt::Display::fmt(self.syntax(), f)
10300 }
10301}
10302impl std::fmt::Display for MacroPat {
10303 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10304 std::fmt::Display::fmt(self.syntax(), f)
10305 }
10306}
10307impl std::fmt::Display for MacroRules {
10308 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10309 std::fmt::Display::fmt(self.syntax(), f)
10310 }
10311}
10312impl std::fmt::Display for MacroStmts {
10313 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10314 std::fmt::Display::fmt(self.syntax(), f)
10315 }
10316}
10317impl std::fmt::Display for MacroType {
10318 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10319 std::fmt::Display::fmt(self.syntax(), f)
10320 }
10321}
10322impl std::fmt::Display for MatchArm {
10323 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10324 std::fmt::Display::fmt(self.syntax(), f)
10325 }
10326}
10327impl std::fmt::Display for MatchArmList {
10328 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10329 std::fmt::Display::fmt(self.syntax(), f)
10330 }
10331}
10332impl std::fmt::Display for MatchExpr {
10333 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10334 std::fmt::Display::fmt(self.syntax(), f)
10335 }
10336}
10337impl std::fmt::Display for MatchGuard {
10338 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10339 std::fmt::Display::fmt(self.syntax(), f)
10340 }
10341}
10342impl std::fmt::Display for Meta {
10343 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10344 std::fmt::Display::fmt(self.syntax(), f)
10345 }
10346}
10347impl std::fmt::Display for MethodCallExpr {
10348 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10349 std::fmt::Display::fmt(self.syntax(), f)
10350 }
10351}
10352impl std::fmt::Display for Module {
10353 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10354 std::fmt::Display::fmt(self.syntax(), f)
10355 }
10356}
10357impl std::fmt::Display for Name {
10358 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10359 std::fmt::Display::fmt(self.syntax(), f)
10360 }
10361}
10362impl std::fmt::Display for NameRef {
10363 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10364 std::fmt::Display::fmt(self.syntax(), f)
10365 }
10366}
10367impl std::fmt::Display for NeverType {
10368 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10369 std::fmt::Display::fmt(self.syntax(), f)
10370 }
10371}
10372impl std::fmt::Display for OffsetOfExpr {
10373 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10374 std::fmt::Display::fmt(self.syntax(), f)
10375 }
10376}
10377impl std::fmt::Display for OrPat {
10378 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10379 std::fmt::Display::fmt(self.syntax(), f)
10380 }
10381}
10382impl std::fmt::Display for Param {
10383 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10384 std::fmt::Display::fmt(self.syntax(), f)
10385 }
10386}
10387impl std::fmt::Display for ParamList {
10388 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10389 std::fmt::Display::fmt(self.syntax(), f)
10390 }
10391}
10392impl std::fmt::Display for ParenExpr {
10393 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10394 std::fmt::Display::fmt(self.syntax(), f)
10395 }
10396}
10397impl std::fmt::Display for ParenPat {
10398 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10399 std::fmt::Display::fmt(self.syntax(), f)
10400 }
10401}
10402impl std::fmt::Display for ParenType {
10403 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10404 std::fmt::Display::fmt(self.syntax(), f)
10405 }
10406}
10407impl std::fmt::Display for ParenthesizedArgList {
10408 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10409 std::fmt::Display::fmt(self.syntax(), f)
10410 }
10411}
10412impl std::fmt::Display for Path {
10413 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10414 std::fmt::Display::fmt(self.syntax(), f)
10415 }
10416}
10417impl std::fmt::Display for PathExpr {
10418 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10419 std::fmt::Display::fmt(self.syntax(), f)
10420 }
10421}
10422impl std::fmt::Display for PathPat {
10423 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10424 std::fmt::Display::fmt(self.syntax(), f)
10425 }
10426}
10427impl std::fmt::Display for PathSegment {
10428 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10429 std::fmt::Display::fmt(self.syntax(), f)
10430 }
10431}
10432impl std::fmt::Display for PathType {
10433 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10434 std::fmt::Display::fmt(self.syntax(), f)
10435 }
10436}
10437impl std::fmt::Display for PrefixExpr {
10438 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10439 std::fmt::Display::fmt(self.syntax(), f)
10440 }
10441}
10442impl std::fmt::Display for PtrType {
10443 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10444 std::fmt::Display::fmt(self.syntax(), f)
10445 }
10446}
10447impl std::fmt::Display for RangeExpr {
10448 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10449 std::fmt::Display::fmt(self.syntax(), f)
10450 }
10451}
10452impl std::fmt::Display for RangePat {
10453 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10454 std::fmt::Display::fmt(self.syntax(), f)
10455 }
10456}
10457impl std::fmt::Display for RecordExpr {
10458 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10459 std::fmt::Display::fmt(self.syntax(), f)
10460 }
10461}
10462impl std::fmt::Display for RecordExprField {
10463 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10464 std::fmt::Display::fmt(self.syntax(), f)
10465 }
10466}
10467impl std::fmt::Display for RecordExprFieldList {
10468 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10469 std::fmt::Display::fmt(self.syntax(), f)
10470 }
10471}
10472impl std::fmt::Display for RecordField {
10473 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10474 std::fmt::Display::fmt(self.syntax(), f)
10475 }
10476}
10477impl std::fmt::Display for RecordFieldList {
10478 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10479 std::fmt::Display::fmt(self.syntax(), f)
10480 }
10481}
10482impl std::fmt::Display for RecordPat {
10483 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10484 std::fmt::Display::fmt(self.syntax(), f)
10485 }
10486}
10487impl std::fmt::Display for RecordPatField {
10488 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10489 std::fmt::Display::fmt(self.syntax(), f)
10490 }
10491}
10492impl std::fmt::Display for RecordPatFieldList {
10493 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10494 std::fmt::Display::fmt(self.syntax(), f)
10495 }
10496}
10497impl std::fmt::Display for RefExpr {
10498 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10499 std::fmt::Display::fmt(self.syntax(), f)
10500 }
10501}
10502impl std::fmt::Display for RefPat {
10503 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10504 std::fmt::Display::fmt(self.syntax(), f)
10505 }
10506}
10507impl std::fmt::Display for RefType {
10508 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10509 std::fmt::Display::fmt(self.syntax(), f)
10510 }
10511}
10512impl std::fmt::Display for Rename {
10513 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10514 std::fmt::Display::fmt(self.syntax(), f)
10515 }
10516}
10517impl std::fmt::Display for RestPat {
10518 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10519 std::fmt::Display::fmt(self.syntax(), f)
10520 }
10521}
10522impl std::fmt::Display for RetType {
10523 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10524 std::fmt::Display::fmt(self.syntax(), f)
10525 }
10526}
10527impl std::fmt::Display for ReturnExpr {
10528 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10529 std::fmt::Display::fmt(self.syntax(), f)
10530 }
10531}
10532impl std::fmt::Display for ReturnTypeSyntax {
10533 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10534 std::fmt::Display::fmt(self.syntax(), f)
10535 }
10536}
10537impl std::fmt::Display for SelfParam {
10538 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10539 std::fmt::Display::fmt(self.syntax(), f)
10540 }
10541}
10542impl std::fmt::Display for SlicePat {
10543 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10544 std::fmt::Display::fmt(self.syntax(), f)
10545 }
10546}
10547impl std::fmt::Display for SliceType {
10548 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10549 std::fmt::Display::fmt(self.syntax(), f)
10550 }
10551}
10552impl std::fmt::Display for SourceFile {
10553 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10554 std::fmt::Display::fmt(self.syntax(), f)
10555 }
10556}
10557impl std::fmt::Display for Static {
10558 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10559 std::fmt::Display::fmt(self.syntax(), f)
10560 }
10561}
10562impl std::fmt::Display for StmtList {
10563 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10564 std::fmt::Display::fmt(self.syntax(), f)
10565 }
10566}
10567impl std::fmt::Display for Struct {
10568 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10569 std::fmt::Display::fmt(self.syntax(), f)
10570 }
10571}
10572impl std::fmt::Display for TokenTree {
10573 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10574 std::fmt::Display::fmt(self.syntax(), f)
10575 }
10576}
10577impl std::fmt::Display for Trait {
10578 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10579 std::fmt::Display::fmt(self.syntax(), f)
10580 }
10581}
10582impl std::fmt::Display for TraitAlias {
10583 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10584 std::fmt::Display::fmt(self.syntax(), f)
10585 }
10586}
10587impl std::fmt::Display for TryExpr {
10588 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10589 std::fmt::Display::fmt(self.syntax(), f)
10590 }
10591}
10592impl std::fmt::Display for TupleExpr {
10593 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10594 std::fmt::Display::fmt(self.syntax(), f)
10595 }
10596}
10597impl std::fmt::Display for TupleField {
10598 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10599 std::fmt::Display::fmt(self.syntax(), f)
10600 }
10601}
10602impl std::fmt::Display for TupleFieldList {
10603 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10604 std::fmt::Display::fmt(self.syntax(), f)
10605 }
10606}
10607impl std::fmt::Display for TuplePat {
10608 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10609 std::fmt::Display::fmt(self.syntax(), f)
10610 }
10611}
10612impl std::fmt::Display for TupleStructPat {
10613 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10614 std::fmt::Display::fmt(self.syntax(), f)
10615 }
10616}
10617impl std::fmt::Display for TupleType {
10618 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10619 std::fmt::Display::fmt(self.syntax(), f)
10620 }
10621}
10622impl std::fmt::Display for TypeAlias {
10623 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10624 std::fmt::Display::fmt(self.syntax(), f)
10625 }
10626}
10627impl std::fmt::Display for TypeArg {
10628 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10629 std::fmt::Display::fmt(self.syntax(), f)
10630 }
10631}
10632impl std::fmt::Display for TypeBound {
10633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10634 std::fmt::Display::fmt(self.syntax(), f)
10635 }
10636}
10637impl std::fmt::Display for TypeBoundList {
10638 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10639 std::fmt::Display::fmt(self.syntax(), f)
10640 }
10641}
10642impl std::fmt::Display for TypeParam {
10643 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10644 std::fmt::Display::fmt(self.syntax(), f)
10645 }
10646}
10647impl std::fmt::Display for UnderscoreExpr {
10648 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10649 std::fmt::Display::fmt(self.syntax(), f)
10650 }
10651}
10652impl std::fmt::Display for Union {
10653 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10654 std::fmt::Display::fmt(self.syntax(), f)
10655 }
10656}
10657impl std::fmt::Display for Use {
10658 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10659 std::fmt::Display::fmt(self.syntax(), f)
10660 }
10661}
10662impl std::fmt::Display for UseBoundGenericArgs {
10663 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10664 std::fmt::Display::fmt(self.syntax(), f)
10665 }
10666}
10667impl std::fmt::Display for UseTree {
10668 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10669 std::fmt::Display::fmt(self.syntax(), f)
10670 }
10671}
10672impl std::fmt::Display for UseTreeList {
10673 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10674 std::fmt::Display::fmt(self.syntax(), f)
10675 }
10676}
10677impl std::fmt::Display for Variant {
10678 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10679 std::fmt::Display::fmt(self.syntax(), f)
10680 }
10681}
10682impl std::fmt::Display for VariantList {
10683 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10684 std::fmt::Display::fmt(self.syntax(), f)
10685 }
10686}
10687impl std::fmt::Display for Visibility {
10688 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10689 std::fmt::Display::fmt(self.syntax(), f)
10690 }
10691}
10692impl std::fmt::Display for WhereClause {
10693 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10694 std::fmt::Display::fmt(self.syntax(), f)
10695 }
10696}
10697impl std::fmt::Display for WherePred {
10698 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10699 std::fmt::Display::fmt(self.syntax(), f)
10700 }
10701}
10702impl std::fmt::Display for WhileExpr {
10703 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10704 std::fmt::Display::fmt(self.syntax(), f)
10705 }
10706}
10707impl std::fmt::Display for WildcardPat {
10708 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10709 std::fmt::Display::fmt(self.syntax(), f)
10710 }
10711}
10712impl std::fmt::Display for YeetExpr {
10713 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10714 std::fmt::Display::fmt(self.syntax(), f)
10715 }
10716}
10717impl std::fmt::Display for YieldExpr {
10718 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10719 std::fmt::Display::fmt(self.syntax(), f)
10720 }
10721}