aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs1328
1 files changed, 669 insertions, 659 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index 763fd20f4..186db538b 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -349,7 +349,6 @@ pub struct BlockExpr {
349} 349}
350impl ast::AttrsOwner for BlockExpr {} 350impl ast::AttrsOwner for BlockExpr {}
351impl BlockExpr { 351impl BlockExpr {
352 pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
353 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } 352 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
354 pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) } 353 pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
355 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 354 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
@@ -468,6 +467,19 @@ impl ExternItemList {
468 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } 467 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
469} 468}
470#[derive(Debug, Clone, PartialEq, Eq, Hash)] 469#[derive(Debug, Clone, PartialEq, Eq, Hash)]
470pub struct ConstParam {
471 pub(crate) syntax: SyntaxNode,
472}
473impl ast::AttrsOwner for ConstParam {}
474impl ast::NameOwner for ConstParam {}
475impl ConstParam {
476 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
477 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
478 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
479 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
480 pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) }
481}
482#[derive(Debug, Clone, PartialEq, Eq, Hash)]
471pub struct LifetimeParam { 483pub struct LifetimeParam {
472 pub(crate) syntax: SyntaxNode, 484 pub(crate) syntax: SyntaxNode,
473} 485}
@@ -490,19 +502,6 @@ impl TypeParam {
490 pub fn default_type(&self) -> Option<Type> { support::child(&self.syntax) } 502 pub fn default_type(&self) -> Option<Type> { support::child(&self.syntax) }
491} 503}
492#[derive(Debug, Clone, PartialEq, Eq, Hash)] 504#[derive(Debug, Clone, PartialEq, Eq, Hash)]
493pub struct ConstParam {
494 pub(crate) syntax: SyntaxNode,
495}
496impl ast::AttrsOwner for ConstParam {}
497impl ast::NameOwner for ConstParam {}
498impl ConstParam {
499 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
500 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
501 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
502 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
503 pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) }
504}
505#[derive(Debug, Clone, PartialEq, Eq, Hash)]
506pub struct WherePred { 505pub struct WherePred {
507 pub(crate) syntax: SyntaxNode, 506 pub(crate) syntax: SyntaxNode,
508} 507}
@@ -519,6 +518,7 @@ impl WherePred {
519pub struct Literal { 518pub struct Literal {
520 pub(crate) syntax: SyntaxNode, 519 pub(crate) syntax: SyntaxNode,
521} 520}
521impl ast::AttrsOwner for Literal {}
522impl Literal {} 522impl Literal {}
523#[derive(Debug, Clone, PartialEq, Eq, Hash)] 523#[derive(Debug, Clone, PartialEq, Eq, Hash)]
524pub struct TokenTree { 524pub struct TokenTree {
@@ -533,6 +533,15 @@ impl TokenTree {
533 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } 533 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
534} 534}
535#[derive(Debug, Clone, PartialEq, Eq, Hash)] 535#[derive(Debug, Clone, PartialEq, Eq, Hash)]
536pub struct ExprStmt {
537 pub(crate) syntax: SyntaxNode,
538}
539impl ast::AttrsOwner for ExprStmt {}
540impl ExprStmt {
541 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
542 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
543}
544#[derive(Debug, Clone, PartialEq, Eq, Hash)]
536pub struct LetStmt { 545pub struct LetStmt {
537 pub(crate) syntax: SyntaxNode, 546 pub(crate) syntax: SyntaxNode,
538} 547}
@@ -547,165 +556,196 @@ impl LetStmt {
547 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } 556 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
548} 557}
549#[derive(Debug, Clone, PartialEq, Eq, Hash)] 558#[derive(Debug, Clone, PartialEq, Eq, Hash)]
550pub struct ExprStmt { 559pub struct ArrayExpr {
551 pub(crate) syntax: SyntaxNode, 560 pub(crate) syntax: SyntaxNode,
552} 561}
553impl ast::AttrsOwner for ExprStmt {} 562impl ast::AttrsOwner for ArrayExpr {}
554impl ExprStmt { 563impl ArrayExpr {
564 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
565 pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
555 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 566 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
556 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } 567 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
568 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
557} 569}
558#[derive(Debug, Clone, PartialEq, Eq, Hash)] 570#[derive(Debug, Clone, PartialEq, Eq, Hash)]
559pub struct ParenType { 571pub struct AwaitExpr {
560 pub(crate) syntax: SyntaxNode,
561}
562impl ParenType {
563 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
564 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
565 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
566}
567#[derive(Debug, Clone, PartialEq, Eq, Hash)]
568pub struct TupleType {
569 pub(crate) syntax: SyntaxNode, 572 pub(crate) syntax: SyntaxNode,
570} 573}
571impl TupleType { 574impl ast::AttrsOwner for AwaitExpr {}
572 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } 575impl AwaitExpr {
573 pub fn fields(&self) -> AstChildren<Type> { support::children(&self.syntax) } 576 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
574 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } 577 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
578 pub fn await_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![await]) }
575} 579}
576#[derive(Debug, Clone, PartialEq, Eq, Hash)] 580#[derive(Debug, Clone, PartialEq, Eq, Hash)]
577pub struct NeverType { 581pub struct BinExpr {
578 pub(crate) syntax: SyntaxNode, 582 pub(crate) syntax: SyntaxNode,
579} 583}
580impl NeverType { 584impl ast::AttrsOwner for BinExpr {}
581 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } 585impl BinExpr {
586 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
582} 587}
583#[derive(Debug, Clone, PartialEq, Eq, Hash)] 588#[derive(Debug, Clone, PartialEq, Eq, Hash)]
584pub struct PathType { 589pub struct BoxExpr {
585 pub(crate) syntax: SyntaxNode, 590 pub(crate) syntax: SyntaxNode,
586} 591}
587impl PathType { 592impl ast::AttrsOwner for BoxExpr {}
588 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } 593impl BoxExpr {
594 pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) }
595 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
589} 596}
590#[derive(Debug, Clone, PartialEq, Eq, Hash)] 597#[derive(Debug, Clone, PartialEq, Eq, Hash)]
591pub struct PointerType { 598pub struct BreakExpr {
592 pub(crate) syntax: SyntaxNode, 599 pub(crate) syntax: SyntaxNode,
593} 600}
594impl PointerType { 601impl ast::AttrsOwner for BreakExpr {}
595 pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) } 602impl BreakExpr {
596 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } 603 pub fn break_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![break]) }
597 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } 604 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
598 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } 605 support::token(&self.syntax, T![lifetime])
606 }
607 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
599} 608}
600#[derive(Debug, Clone, PartialEq, Eq, Hash)] 609#[derive(Debug, Clone, PartialEq, Eq, Hash)]
601pub struct ArrayType { 610pub struct CallExpr {
602 pub(crate) syntax: SyntaxNode, 611 pub(crate) syntax: SyntaxNode,
603} 612}
604impl ArrayType { 613impl ast::AttrsOwner for CallExpr {}
605 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } 614impl ast::ArgListOwner for CallExpr {}
606 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } 615impl CallExpr {
607 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
608 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 616 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
609 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
610} 617}
611#[derive(Debug, Clone, PartialEq, Eq, Hash)] 618#[derive(Debug, Clone, PartialEq, Eq, Hash)]
612pub struct SliceType { 619pub struct CastExpr {
613 pub(crate) syntax: SyntaxNode, 620 pub(crate) syntax: SyntaxNode,
614} 621}
615impl SliceType { 622impl ast::AttrsOwner for CastExpr {}
616 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } 623impl CastExpr {
624 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
625 pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
617 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } 626 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
618 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
619} 627}
620#[derive(Debug, Clone, PartialEq, Eq, Hash)] 628#[derive(Debug, Clone, PartialEq, Eq, Hash)]
621pub struct ReferenceType { 629pub struct ContinueExpr {
622 pub(crate) syntax: SyntaxNode, 630 pub(crate) syntax: SyntaxNode,
623} 631}
624impl ReferenceType { 632impl ast::AttrsOwner for ContinueExpr {}
625 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } 633impl ContinueExpr {
634 pub fn continue_token(&self) -> Option<SyntaxToken> {
635 support::token(&self.syntax, T![continue])
636 }
626 pub fn lifetime_token(&self) -> Option<SyntaxToken> { 637 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
627 support::token(&self.syntax, T![lifetime]) 638 support::token(&self.syntax, T![lifetime])
628 } 639 }
629 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
630 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
631} 640}
632#[derive(Debug, Clone, PartialEq, Eq, Hash)] 641#[derive(Debug, Clone, PartialEq, Eq, Hash)]
633pub struct InferType { 642pub struct EffectExpr {
634 pub(crate) syntax: SyntaxNode, 643 pub(crate) syntax: SyntaxNode,
635} 644}
636impl InferType { 645impl ast::AttrsOwner for EffectExpr {}
637 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } 646impl EffectExpr {
647 pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
648 pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) }
649 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
650 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
651 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
638} 652}
639#[derive(Debug, Clone, PartialEq, Eq, Hash)] 653#[derive(Debug, Clone, PartialEq, Eq, Hash)]
640pub struct FnPointerType { 654pub struct FieldExpr {
641 pub(crate) syntax: SyntaxNode, 655 pub(crate) syntax: SyntaxNode,
642} 656}
643impl FnPointerType { 657impl ast::AttrsOwner for FieldExpr {}
644 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } 658impl FieldExpr {
645 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } 659 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
646 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } 660 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
647 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } 661 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
648 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
649 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
650 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
651} 662}
652#[derive(Debug, Clone, PartialEq, Eq, Hash)] 663#[derive(Debug, Clone, PartialEq, Eq, Hash)]
653pub struct ForType { 664pub struct ForExpr {
654 pub(crate) syntax: SyntaxNode, 665 pub(crate) syntax: SyntaxNode,
655} 666}
656impl ForType { 667impl ast::AttrsOwner for ForExpr {}
668impl ast::LoopBodyOwner for ForExpr {}
669impl ForExpr {
657 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } 670 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
658 pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) } 671 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
659 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } 672 pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
673 pub fn iterable(&self) -> Option<Expr> { support::child(&self.syntax) }
660} 674}
661#[derive(Debug, Clone, PartialEq, Eq, Hash)] 675#[derive(Debug, Clone, PartialEq, Eq, Hash)]
662pub struct ImplTraitType { 676pub struct IfExpr {
663 pub(crate) syntax: SyntaxNode, 677 pub(crate) syntax: SyntaxNode,
664} 678}
665impl ImplTraitType { 679impl ast::AttrsOwner for IfExpr {}
666 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } 680impl IfExpr {
667 pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) } 681 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
682 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) }
683 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
684 pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
685 pub fn if_expr(&self) -> Option<IfExpr> { support::child(&self.syntax) }
668} 686}
669#[derive(Debug, Clone, PartialEq, Eq, Hash)] 687#[derive(Debug, Clone, PartialEq, Eq, Hash)]
670pub struct DynTraitType { 688pub struct IndexExpr {
671 pub(crate) syntax: SyntaxNode, 689 pub(crate) syntax: SyntaxNode,
672} 690}
673impl DynTraitType { 691impl ast::AttrsOwner for IndexExpr {}
674 pub fn dyn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![dyn]) } 692impl IndexExpr {
675 pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) } 693 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
694 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
695 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
676} 696}
677#[derive(Debug, Clone, PartialEq, Eq, Hash)] 697#[derive(Debug, Clone, PartialEq, Eq, Hash)]
678pub struct TypeBound { 698pub struct Label {
679 pub(crate) syntax: SyntaxNode, 699 pub(crate) syntax: SyntaxNode,
680} 700}
681impl TypeBound { 701impl Label {
682 pub fn lifetime_token(&self) -> Option<SyntaxToken> { 702 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
683 support::token(&self.syntax, T![lifetime]) 703 support::token(&self.syntax, T![lifetime])
684 } 704 }
685 pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
686 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
687} 705}
688#[derive(Debug, Clone, PartialEq, Eq, Hash)] 706#[derive(Debug, Clone, PartialEq, Eq, Hash)]
689pub struct TupleExpr { 707pub struct LambdaExpr {
690 pub(crate) syntax: SyntaxNode, 708 pub(crate) syntax: SyntaxNode,
691} 709}
692impl ast::AttrsOwner for TupleExpr {} 710impl ast::AttrsOwner for LambdaExpr {}
693impl TupleExpr { 711impl LambdaExpr {
694 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } 712 pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
695 pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } 713 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
696 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } 714 pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
715 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
716 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
717 pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
697} 718}
698#[derive(Debug, Clone, PartialEq, Eq, Hash)] 719#[derive(Debug, Clone, PartialEq, Eq, Hash)]
699pub struct ArrayExpr { 720pub struct LoopExpr {
700 pub(crate) syntax: SyntaxNode, 721 pub(crate) syntax: SyntaxNode,
701} 722}
702impl ast::AttrsOwner for ArrayExpr {} 723impl ast::AttrsOwner for LoopExpr {}
703impl ArrayExpr { 724impl ast::LoopBodyOwner for LoopExpr {}
704 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } 725impl LoopExpr {
705 pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } 726 pub fn loop_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![loop]) }
727}
728#[derive(Debug, Clone, PartialEq, Eq, Hash)]
729pub struct MatchExpr {
730 pub(crate) syntax: SyntaxNode,
731}
732impl ast::AttrsOwner for MatchExpr {}
733impl MatchExpr {
734 pub fn match_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![match]) }
706 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 735 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
707 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } 736 pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) }
708 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } 737}
738#[derive(Debug, Clone, PartialEq, Eq, Hash)]
739pub struct MethodCallExpr {
740 pub(crate) syntax: SyntaxNode,
741}
742impl ast::AttrsOwner for MethodCallExpr {}
743impl ast::ArgListOwner for MethodCallExpr {}
744impl MethodCallExpr {
745 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
746 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
747 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
748 pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) }
709} 749}
710#[derive(Debug, Clone, PartialEq, Eq, Hash)] 750#[derive(Debug, Clone, PartialEq, Eq, Hash)]
711pub struct ParenExpr { 751pub struct ParenExpr {
@@ -721,82 +761,75 @@ impl ParenExpr {
721pub struct PathExpr { 761pub struct PathExpr {
722 pub(crate) syntax: SyntaxNode, 762 pub(crate) syntax: SyntaxNode,
723} 763}
764impl ast::AttrsOwner for PathExpr {}
724impl PathExpr { 765impl PathExpr {
725 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } 766 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
726} 767}
727#[derive(Debug, Clone, PartialEq, Eq, Hash)] 768#[derive(Debug, Clone, PartialEq, Eq, Hash)]
728pub struct LambdaExpr { 769pub struct PrefixExpr {
729 pub(crate) syntax: SyntaxNode, 770 pub(crate) syntax: SyntaxNode,
730} 771}
731impl ast::AttrsOwner for LambdaExpr {} 772impl ast::AttrsOwner for PrefixExpr {}
732impl LambdaExpr { 773impl PrefixExpr {
733 pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } 774 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
734 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
735 pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
736 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
737 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
738 pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
739} 775}
740#[derive(Debug, Clone, PartialEq, Eq, Hash)] 776#[derive(Debug, Clone, PartialEq, Eq, Hash)]
741pub struct IfExpr { 777pub struct RangeExpr {
742 pub(crate) syntax: SyntaxNode, 778 pub(crate) syntax: SyntaxNode,
743} 779}
744impl ast::AttrsOwner for IfExpr {} 780impl ast::AttrsOwner for RangeExpr {}
745impl IfExpr { 781impl RangeExpr {
746 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) } 782 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
747 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) }
748} 783}
749#[derive(Debug, Clone, PartialEq, Eq, Hash)] 784#[derive(Debug, Clone, PartialEq, Eq, Hash)]
750pub struct Condition { 785pub struct RecordExpr {
751 pub(crate) syntax: SyntaxNode, 786 pub(crate) syntax: SyntaxNode,
752} 787}
753impl Condition { 788impl RecordExpr {
754 pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) } 789 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
755 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } 790 pub fn record_expr_field_list(&self) -> Option<RecordExprFieldList> {
756 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } 791 support::child(&self.syntax)
757 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 792 }
758} 793}
759#[derive(Debug, Clone, PartialEq, Eq, Hash)] 794#[derive(Debug, Clone, PartialEq, Eq, Hash)]
760pub struct EffectExpr { 795pub struct RefExpr {
761 pub(crate) syntax: SyntaxNode, 796 pub(crate) syntax: SyntaxNode,
762} 797}
763impl ast::AttrsOwner for EffectExpr {} 798impl ast::AttrsOwner for RefExpr {}
764impl EffectExpr { 799impl RefExpr {
765 pub fn label(&self) -> Option<Label> { support::child(&self.syntax) } 800 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
766 pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) } 801 pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) }
767 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } 802 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
768 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } 803 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
769 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) } 804 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
770} 805}
771#[derive(Debug, Clone, PartialEq, Eq, Hash)] 806#[derive(Debug, Clone, PartialEq, Eq, Hash)]
772pub struct Label { 807pub struct ReturnExpr {
773 pub(crate) syntax: SyntaxNode, 808 pub(crate) syntax: SyntaxNode,
774} 809}
775impl Label { 810impl ast::AttrsOwner for ReturnExpr {}
776 pub fn lifetime_token(&self) -> Option<SyntaxToken> { 811impl ReturnExpr {
777 support::token(&self.syntax, T![lifetime]) 812 pub fn return_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![return]) }
778 } 813 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
779} 814}
780#[derive(Debug, Clone, PartialEq, Eq, Hash)] 815#[derive(Debug, Clone, PartialEq, Eq, Hash)]
781pub struct LoopExpr { 816pub struct TryExpr {
782 pub(crate) syntax: SyntaxNode, 817 pub(crate) syntax: SyntaxNode,
783} 818}
784impl ast::AttrsOwner for LoopExpr {} 819impl ast::AttrsOwner for TryExpr {}
785impl ast::LoopBodyOwner for LoopExpr {} 820impl TryExpr {
786impl LoopExpr { 821 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
787 pub fn loop_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![loop]) } 822 pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
788} 823}
789#[derive(Debug, Clone, PartialEq, Eq, Hash)] 824#[derive(Debug, Clone, PartialEq, Eq, Hash)]
790pub struct ForExpr { 825pub struct TupleExpr {
791 pub(crate) syntax: SyntaxNode, 826 pub(crate) syntax: SyntaxNode,
792} 827}
793impl ast::AttrsOwner for ForExpr {} 828impl ast::AttrsOwner for TupleExpr {}
794impl ast::LoopBodyOwner for ForExpr {} 829impl TupleExpr {
795impl ForExpr { 830 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
796 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } 831 pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
797 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } 832 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
798 pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
799 pub fn iterable(&self) -> Option<Expr> { support::child(&self.syntax) }
800} 833}
801#[derive(Debug, Clone, PartialEq, Eq, Hash)] 834#[derive(Debug, Clone, PartialEq, Eq, Hash)]
802pub struct WhileExpr { 835pub struct WhileExpr {
@@ -809,46 +842,25 @@ impl WhileExpr {
809 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } 842 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) }
810} 843}
811#[derive(Debug, Clone, PartialEq, Eq, Hash)] 844#[derive(Debug, Clone, PartialEq, Eq, Hash)]
812pub struct ContinueExpr { 845pub struct RecordExprFieldList {
813 pub(crate) syntax: SyntaxNode,
814}
815impl ast::AttrsOwner for ContinueExpr {}
816impl ContinueExpr {
817 pub fn continue_token(&self) -> Option<SyntaxToken> {
818 support::token(&self.syntax, T![continue])
819 }
820 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
821 support::token(&self.syntax, T![lifetime])
822 }
823}
824#[derive(Debug, Clone, PartialEq, Eq, Hash)]
825pub struct BreakExpr {
826 pub(crate) syntax: SyntaxNode,
827}
828impl ast::AttrsOwner for BreakExpr {}
829impl BreakExpr {
830 pub fn break_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![break]) }
831 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
832 support::token(&self.syntax, T![lifetime])
833 }
834 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
835}
836#[derive(Debug, Clone, PartialEq, Eq, Hash)]
837pub struct ReturnExpr {
838 pub(crate) syntax: SyntaxNode, 846 pub(crate) syntax: SyntaxNode,
839} 847}
840impl ast::AttrsOwner for ReturnExpr {} 848impl ast::AttrsOwner for RecordExprFieldList {}
841impl ReturnExpr { 849impl RecordExprFieldList {
842 pub fn return_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![return]) } 850 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
843 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 851 pub fn fields(&self) -> AstChildren<RecordExprField> { support::children(&self.syntax) }
852 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
853 pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) }
854 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
844} 855}
845#[derive(Debug, Clone, PartialEq, Eq, Hash)] 856#[derive(Debug, Clone, PartialEq, Eq, Hash)]
846pub struct CallExpr { 857pub struct RecordExprField {
847 pub(crate) syntax: SyntaxNode, 858 pub(crate) syntax: SyntaxNode,
848} 859}
849impl ast::AttrsOwner for CallExpr {} 860impl ast::AttrsOwner for RecordExprField {}
850impl ast::ArgListOwner for CallExpr {} 861impl RecordExprField {
851impl CallExpr { 862 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
863 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
852 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 864 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
853} 865}
854#[derive(Debug, Clone, PartialEq, Eq, Hash)] 866#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -861,18 +873,6 @@ impl ArgList {
861 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } 873 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
862} 874}
863#[derive(Debug, Clone, PartialEq, Eq, Hash)] 875#[derive(Debug, Clone, PartialEq, Eq, Hash)]
864pub struct MethodCallExpr {
865 pub(crate) syntax: SyntaxNode,
866}
867impl ast::AttrsOwner for MethodCallExpr {}
868impl ast::ArgListOwner for MethodCallExpr {}
869impl MethodCallExpr {
870 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
871 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
872 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
873 pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) }
874}
875#[derive(Debug, Clone, PartialEq, Eq, Hash)]
876pub struct TypeArgList { 876pub struct TypeArgList {
877 pub(crate) syntax: SyntaxNode, 877 pub(crate) syntax: SyntaxNode,
878} 878}
@@ -886,162 +886,174 @@ impl TypeArgList {
886 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) } 886 pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
887} 887}
888#[derive(Debug, Clone, PartialEq, Eq, Hash)] 888#[derive(Debug, Clone, PartialEq, Eq, Hash)]
889pub struct FieldExpr { 889pub struct Condition {
890 pub(crate) syntax: SyntaxNode, 890 pub(crate) syntax: SyntaxNode,
891} 891}
892impl ast::AttrsOwner for FieldExpr {} 892impl Condition {
893impl FieldExpr { 893 pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) }
894 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
895 pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
894 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 896 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
895 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
896 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
897} 897}
898#[derive(Debug, Clone, PartialEq, Eq, Hash)] 898#[derive(Debug, Clone, PartialEq, Eq, Hash)]
899pub struct IndexExpr { 899pub struct MatchArmList {
900 pub(crate) syntax: SyntaxNode, 900 pub(crate) syntax: SyntaxNode,
901} 901}
902impl ast::AttrsOwner for IndexExpr {} 902impl ast::AttrsOwner for MatchArmList {}
903impl IndexExpr { 903impl MatchArmList {
904 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } 904 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
905 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } 905 pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) }
906 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
906} 907}
907#[derive(Debug, Clone, PartialEq, Eq, Hash)] 908#[derive(Debug, Clone, PartialEq, Eq, Hash)]
908pub struct AwaitExpr { 909pub struct MatchArm {
909 pub(crate) syntax: SyntaxNode, 910 pub(crate) syntax: SyntaxNode,
910} 911}
911impl ast::AttrsOwner for AwaitExpr {} 912impl ast::AttrsOwner for MatchArm {}
912impl AwaitExpr { 913impl MatchArm {
914 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
915 pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) }
916 pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) }
913 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 917 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
914 pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) } 918 pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
915 pub fn await_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![await]) }
916} 919}
917#[derive(Debug, Clone, PartialEq, Eq, Hash)] 920#[derive(Debug, Clone, PartialEq, Eq, Hash)]
918pub struct TryExpr { 921pub struct MatchGuard {
919 pub(crate) syntax: SyntaxNode, 922 pub(crate) syntax: SyntaxNode,
920} 923}
921impl ast::AttrsOwner for TryExpr {} 924impl MatchGuard {
922impl TryExpr { 925 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
923 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 926 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
924 pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
925} 927}
926#[derive(Debug, Clone, PartialEq, Eq, Hash)] 928#[derive(Debug, Clone, PartialEq, Eq, Hash)]
927pub struct CastExpr { 929pub struct ArrayType {
928 pub(crate) syntax: SyntaxNode, 930 pub(crate) syntax: SyntaxNode,
929} 931}
930impl ast::AttrsOwner for CastExpr {} 932impl ArrayType {
931impl CastExpr { 933 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
932 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
933 pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
934 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } 934 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
935 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
936 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
937 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
935} 938}
936#[derive(Debug, Clone, PartialEq, Eq, Hash)] 939#[derive(Debug, Clone, PartialEq, Eq, Hash)]
937pub struct RefExpr { 940pub struct DynTraitType {
938 pub(crate) syntax: SyntaxNode, 941 pub(crate) syntax: SyntaxNode,
939} 942}
940impl ast::AttrsOwner for RefExpr {} 943impl DynTraitType {
941impl RefExpr { 944 pub fn dyn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![dyn]) }
942 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } 945 pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
943 pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) }
944 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
945 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
946 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
947} 946}
948#[derive(Debug, Clone, PartialEq, Eq, Hash)] 947#[derive(Debug, Clone, PartialEq, Eq, Hash)]
949pub struct PrefixExpr { 948pub struct FnPointerType {
950 pub(crate) syntax: SyntaxNode, 949 pub(crate) syntax: SyntaxNode,
951} 950}
952impl ast::AttrsOwner for PrefixExpr {} 951impl FnPointerType {
953impl PrefixExpr { 952 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
954 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 953 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
954 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
955 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
956 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
957 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
958 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
955} 959}
956#[derive(Debug, Clone, PartialEq, Eq, Hash)] 960#[derive(Debug, Clone, PartialEq, Eq, Hash)]
957pub struct BoxExpr { 961pub struct ForType {
958 pub(crate) syntax: SyntaxNode, 962 pub(crate) syntax: SyntaxNode,
959} 963}
960impl ast::AttrsOwner for BoxExpr {} 964impl ForType {
961impl BoxExpr { 965 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
962 pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) } 966 pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
963 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 967 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
964} 968}
965#[derive(Debug, Clone, PartialEq, Eq, Hash)] 969#[derive(Debug, Clone, PartialEq, Eq, Hash)]
966pub struct RangeExpr { 970pub struct ImplTraitType {
967 pub(crate) syntax: SyntaxNode, 971 pub(crate) syntax: SyntaxNode,
968} 972}
969impl ast::AttrsOwner for RangeExpr {} 973impl ImplTraitType {
970impl RangeExpr {} 974 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
975 pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) }
976}
971#[derive(Debug, Clone, PartialEq, Eq, Hash)] 977#[derive(Debug, Clone, PartialEq, Eq, Hash)]
972pub struct BinExpr { 978pub struct InferType {
973 pub(crate) syntax: SyntaxNode, 979 pub(crate) syntax: SyntaxNode,
974} 980}
975impl ast::AttrsOwner for BinExpr {} 981impl InferType {
976impl BinExpr {} 982 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
983}
977#[derive(Debug, Clone, PartialEq, Eq, Hash)] 984#[derive(Debug, Clone, PartialEq, Eq, Hash)]
978pub struct MatchExpr { 985pub struct NeverType {
979 pub(crate) syntax: SyntaxNode, 986 pub(crate) syntax: SyntaxNode,
980} 987}
981impl ast::AttrsOwner for MatchExpr {} 988impl NeverType {
982impl MatchExpr { 989 pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
983 pub fn match_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![match]) }
984 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
985 pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) }
986} 990}
987#[derive(Debug, Clone, PartialEq, Eq, Hash)] 991#[derive(Debug, Clone, PartialEq, Eq, Hash)]
988pub struct MatchArmList { 992pub struct ParenType {
989 pub(crate) syntax: SyntaxNode, 993 pub(crate) syntax: SyntaxNode,
990} 994}
991impl MatchArmList { 995impl ParenType {
992 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } 996 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
993 pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) } 997 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
994 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } 998 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
995} 999}
996#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1000#[derive(Debug, Clone, PartialEq, Eq, Hash)]
997pub struct MatchArm { 1001pub struct PathType {
998 pub(crate) syntax: SyntaxNode, 1002 pub(crate) syntax: SyntaxNode,
999} 1003}
1000impl ast::AttrsOwner for MatchArm {} 1004impl PathType {
1001impl MatchArm { 1005 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
1002 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1003 pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) }
1004 pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) }
1005 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1006} 1006}
1007#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1007#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1008pub struct MatchGuard { 1008pub struct PointerType {
1009 pub(crate) syntax: SyntaxNode, 1009 pub(crate) syntax: SyntaxNode,
1010} 1010}
1011impl MatchGuard { 1011impl PointerType {
1012 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) } 1012 pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) }
1013 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 1013 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
1014 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1015 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1014} 1016}
1015#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1017#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1016pub struct RecordExpr { 1018pub struct ReferenceType {
1017 pub(crate) syntax: SyntaxNode, 1019 pub(crate) syntax: SyntaxNode,
1018} 1020}
1019impl RecordExpr { 1021impl ReferenceType {
1020 pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } 1022 pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
1021 pub fn record_expr_field_list(&self) -> Option<RecordExprFieldList> { 1023 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
1022 support::child(&self.syntax) 1024 support::token(&self.syntax, T![lifetime])
1023 } 1025 }
1026 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
1027 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1024} 1028}
1025#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1029#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1026pub struct RecordExprFieldList { 1030pub struct SliceType {
1027 pub(crate) syntax: SyntaxNode, 1031 pub(crate) syntax: SyntaxNode,
1028} 1032}
1029impl RecordExprFieldList { 1033impl SliceType {
1030 pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } 1034 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
1031 pub fn fields(&self) -> AstChildren<RecordExprField> { support::children(&self.syntax) } 1035 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1032 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } 1036 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
1033 pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) }
1034 pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
1035} 1037}
1036#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1038#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1037pub struct RecordExprField { 1039pub struct TupleType {
1038 pub(crate) syntax: SyntaxNode, 1040 pub(crate) syntax: SyntaxNode,
1039} 1041}
1040impl ast::AttrsOwner for RecordExprField {} 1042impl TupleType {
1041impl RecordExprField { 1043 pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
1042 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } 1044 pub fn fields(&self) -> AstChildren<Type> { support::children(&self.syntax) }
1043 pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } 1045 pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
1044 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 1046}
1047#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1048pub struct TypeBound {
1049 pub(crate) syntax: SyntaxNode,
1050}
1051impl TypeBound {
1052 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
1053 support::token(&self.syntax, T![lifetime])
1054 }
1055 pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
1056 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
1045} 1057}
1046#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1058#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1047pub struct OrPat { 1059pub struct OrPat {
@@ -1285,19 +1297,19 @@ pub enum Item {
1285impl ast::AttrsOwner for Item {} 1297impl ast::AttrsOwner for Item {}
1286#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1298#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1287pub enum Type { 1299pub enum Type {
1288 ParenType(ParenType),
1289 TupleType(TupleType),
1290 NeverType(NeverType),
1291 PathType(PathType),
1292 PointerType(PointerType),
1293 ArrayType(ArrayType), 1300 ArrayType(ArrayType),
1294 SliceType(SliceType), 1301 DynTraitType(DynTraitType),
1295 ReferenceType(ReferenceType),
1296 InferType(InferType),
1297 FnPointerType(FnPointerType), 1302 FnPointerType(FnPointerType),
1298 ForType(ForType), 1303 ForType(ForType),
1299 ImplTraitType(ImplTraitType), 1304 ImplTraitType(ImplTraitType),
1300 DynTraitType(DynTraitType), 1305 InferType(InferType),
1306 NeverType(NeverType),
1307 ParenType(ParenType),
1308 PathType(PathType),
1309 PointerType(PointerType),
1310 ReferenceType(ReferenceType),
1311 SliceType(SliceType),
1312 TupleType(TupleType),
1301} 1313}
1302#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1314#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1303pub enum Pat { 1315pub enum Pat {
@@ -1324,42 +1336,42 @@ pub enum FieldList {
1324} 1336}
1325#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1337#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1326pub enum Expr { 1338pub enum Expr {
1327 TupleExpr(TupleExpr),
1328 ArrayExpr(ArrayExpr), 1339 ArrayExpr(ArrayExpr),
1329 ParenExpr(ParenExpr), 1340 AwaitExpr(AwaitExpr),
1330 PathExpr(PathExpr), 1341 BinExpr(BinExpr),
1331 LambdaExpr(LambdaExpr),
1332 IfExpr(IfExpr),
1333 LoopExpr(LoopExpr),
1334 ForExpr(ForExpr),
1335 WhileExpr(WhileExpr),
1336 ContinueExpr(ContinueExpr),
1337 BreakExpr(BreakExpr),
1338 Label(Label),
1339 BlockExpr(BlockExpr), 1342 BlockExpr(BlockExpr),
1340 ReturnExpr(ReturnExpr), 1343 BoxExpr(BoxExpr),
1341 MatchExpr(MatchExpr), 1344 BreakExpr(BreakExpr),
1342 RecordExpr(RecordExpr),
1343 CallExpr(CallExpr), 1345 CallExpr(CallExpr),
1346 CastExpr(CastExpr),
1347 ContinueExpr(ContinueExpr),
1348 EffectExpr(EffectExpr),
1349 FieldExpr(FieldExpr),
1350 ForExpr(ForExpr),
1351 IfExpr(IfExpr),
1344 IndexExpr(IndexExpr), 1352 IndexExpr(IndexExpr),
1353 Label(Label),
1354 LambdaExpr(LambdaExpr),
1355 Literal(Literal),
1356 LoopExpr(LoopExpr),
1357 MacroCall(MacroCall),
1358 MatchExpr(MatchExpr),
1345 MethodCallExpr(MethodCallExpr), 1359 MethodCallExpr(MethodCallExpr),
1346 FieldExpr(FieldExpr), 1360 ParenExpr(ParenExpr),
1347 AwaitExpr(AwaitExpr), 1361 PathExpr(PathExpr),
1348 TryExpr(TryExpr),
1349 EffectExpr(EffectExpr),
1350 CastExpr(CastExpr),
1351 RefExpr(RefExpr),
1352 PrefixExpr(PrefixExpr), 1362 PrefixExpr(PrefixExpr),
1353 RangeExpr(RangeExpr), 1363 RangeExpr(RangeExpr),
1354 BinExpr(BinExpr), 1364 RecordExpr(RecordExpr),
1355 Literal(Literal), 1365 RefExpr(RefExpr),
1356 MacroCall(MacroCall), 1366 ReturnExpr(ReturnExpr),
1357 BoxExpr(BoxExpr), 1367 TryExpr(TryExpr),
1368 TupleExpr(TupleExpr),
1369 WhileExpr(WhileExpr),
1358} 1370}
1359#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1371#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1360pub enum AdtDef { 1372pub enum AdtDef {
1361 Struct(Struct),
1362 Enum(Enum), 1373 Enum(Enum),
1374 Struct(Struct),
1363 Union(Union), 1375 Union(Union),
1364} 1376}
1365impl ast::AttrsOwner for AdtDef {} 1377impl ast::AttrsOwner for AdtDef {}
@@ -1368,10 +1380,10 @@ impl ast::NameOwner for AdtDef {}
1368impl ast::VisibilityOwner for AdtDef {} 1380impl ast::VisibilityOwner for AdtDef {}
1369#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1381#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1370pub enum AssocItem { 1382pub enum AssocItem {
1371 Fn(Fn),
1372 TypeAlias(TypeAlias),
1373 Const(Const), 1383 Const(Const),
1384 Fn(Fn),
1374 MacroCall(MacroCall), 1385 MacroCall(MacroCall),
1386 TypeAlias(TypeAlias),
1375} 1387}
1376impl ast::AttrsOwner for AssocItem {} 1388impl ast::AttrsOwner for AssocItem {}
1377impl ast::NameOwner for AssocItem {} 1389impl ast::NameOwner for AssocItem {}
@@ -1385,16 +1397,16 @@ impl ast::AttrsOwner for ExternItem {}
1385impl ast::NameOwner for ExternItem {} 1397impl ast::NameOwner for ExternItem {}
1386#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1398#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1387pub enum GenericParam { 1399pub enum GenericParam {
1400 ConstParam(ConstParam),
1388 LifetimeParam(LifetimeParam), 1401 LifetimeParam(LifetimeParam),
1389 TypeParam(TypeParam), 1402 TypeParam(TypeParam),
1390 ConstParam(ConstParam),
1391} 1403}
1392impl ast::AttrsOwner for GenericParam {} 1404impl ast::AttrsOwner for GenericParam {}
1393#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1405#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1394pub enum Stmt { 1406pub enum Stmt {
1395 LetStmt(LetStmt),
1396 ExprStmt(ExprStmt), 1407 ExprStmt(ExprStmt),
1397 Item(Item), 1408 Item(Item),
1409 LetStmt(LetStmt),
1398} 1410}
1399impl AstNode for SourceFile { 1411impl AstNode for SourceFile {
1400 fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE } 1412 fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE }
@@ -1847,8 +1859,8 @@ impl AstNode for ExternItemList {
1847 } 1859 }
1848 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1860 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1849} 1861}
1850impl AstNode for LifetimeParam { 1862impl AstNode for ConstParam {
1851 fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_PARAM } 1863 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_PARAM }
1852 fn cast(syntax: SyntaxNode) -> Option<Self> { 1864 fn cast(syntax: SyntaxNode) -> Option<Self> {
1853 if Self::can_cast(syntax.kind()) { 1865 if Self::can_cast(syntax.kind()) {
1854 Some(Self { syntax }) 1866 Some(Self { syntax })
@@ -1858,8 +1870,8 @@ impl AstNode for LifetimeParam {
1858 } 1870 }
1859 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1871 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1860} 1872}
1861impl AstNode for TypeParam { 1873impl AstNode for LifetimeParam {
1862 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_PARAM } 1874 fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_PARAM }
1863 fn cast(syntax: SyntaxNode) -> Option<Self> { 1875 fn cast(syntax: SyntaxNode) -> Option<Self> {
1864 if Self::can_cast(syntax.kind()) { 1876 if Self::can_cast(syntax.kind()) {
1865 Some(Self { syntax }) 1877 Some(Self { syntax })
@@ -1869,8 +1881,8 @@ impl AstNode for TypeParam {
1869 } 1881 }
1870 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1882 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1871} 1883}
1872impl AstNode for ConstParam { 1884impl AstNode for TypeParam {
1873 fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_PARAM } 1885 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_PARAM }
1874 fn cast(syntax: SyntaxNode) -> Option<Self> { 1886 fn cast(syntax: SyntaxNode) -> Option<Self> {
1875 if Self::can_cast(syntax.kind()) { 1887 if Self::can_cast(syntax.kind()) {
1876 Some(Self { syntax }) 1888 Some(Self { syntax })
@@ -1913,8 +1925,8 @@ impl AstNode for TokenTree {
1913 } 1925 }
1914 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1926 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1915} 1927}
1916impl AstNode for LetStmt { 1928impl AstNode for ExprStmt {
1917 fn can_cast(kind: SyntaxKind) -> bool { kind == LET_STMT } 1929 fn can_cast(kind: SyntaxKind) -> bool { kind == EXPR_STMT }
1918 fn cast(syntax: SyntaxNode) -> Option<Self> { 1930 fn cast(syntax: SyntaxNode) -> Option<Self> {
1919 if Self::can_cast(syntax.kind()) { 1931 if Self::can_cast(syntax.kind()) {
1920 Some(Self { syntax }) 1932 Some(Self { syntax })
@@ -1924,8 +1936,8 @@ impl AstNode for LetStmt {
1924 } 1936 }
1925 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1937 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1926} 1938}
1927impl AstNode for ExprStmt { 1939impl AstNode for LetStmt {
1928 fn can_cast(kind: SyntaxKind) -> bool { kind == EXPR_STMT } 1940 fn can_cast(kind: SyntaxKind) -> bool { kind == LET_STMT }
1929 fn cast(syntax: SyntaxNode) -> Option<Self> { 1941 fn cast(syntax: SyntaxNode) -> Option<Self> {
1930 if Self::can_cast(syntax.kind()) { 1942 if Self::can_cast(syntax.kind()) {
1931 Some(Self { syntax }) 1943 Some(Self { syntax })
@@ -1935,8 +1947,8 @@ impl AstNode for ExprStmt {
1935 } 1947 }
1936 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1948 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1937} 1949}
1938impl AstNode for ParenType { 1950impl AstNode for ArrayExpr {
1939 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_TYPE } 1951 fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_EXPR }
1940 fn cast(syntax: SyntaxNode) -> Option<Self> { 1952 fn cast(syntax: SyntaxNode) -> Option<Self> {
1941 if Self::can_cast(syntax.kind()) { 1953 if Self::can_cast(syntax.kind()) {
1942 Some(Self { syntax }) 1954 Some(Self { syntax })
@@ -1946,8 +1958,8 @@ impl AstNode for ParenType {
1946 } 1958 }
1947 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1959 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1948} 1960}
1949impl AstNode for TupleType { 1961impl AstNode for AwaitExpr {
1950 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_TYPE } 1962 fn can_cast(kind: SyntaxKind) -> bool { kind == AWAIT_EXPR }
1951 fn cast(syntax: SyntaxNode) -> Option<Self> { 1963 fn cast(syntax: SyntaxNode) -> Option<Self> {
1952 if Self::can_cast(syntax.kind()) { 1964 if Self::can_cast(syntax.kind()) {
1953 Some(Self { syntax }) 1965 Some(Self { syntax })
@@ -1957,8 +1969,8 @@ impl AstNode for TupleType {
1957 } 1969 }
1958 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1970 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1959} 1971}
1960impl AstNode for NeverType { 1972impl AstNode for BinExpr {
1961 fn can_cast(kind: SyntaxKind) -> bool { kind == NEVER_TYPE } 1973 fn can_cast(kind: SyntaxKind) -> bool { kind == BIN_EXPR }
1962 fn cast(syntax: SyntaxNode) -> Option<Self> { 1974 fn cast(syntax: SyntaxNode) -> Option<Self> {
1963 if Self::can_cast(syntax.kind()) { 1975 if Self::can_cast(syntax.kind()) {
1964 Some(Self { syntax }) 1976 Some(Self { syntax })
@@ -1968,8 +1980,8 @@ impl AstNode for NeverType {
1968 } 1980 }
1969 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1981 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1970} 1982}
1971impl AstNode for PathType { 1983impl AstNode for BoxExpr {
1972 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_TYPE } 1984 fn can_cast(kind: SyntaxKind) -> bool { kind == BOX_EXPR }
1973 fn cast(syntax: SyntaxNode) -> Option<Self> { 1985 fn cast(syntax: SyntaxNode) -> Option<Self> {
1974 if Self::can_cast(syntax.kind()) { 1986 if Self::can_cast(syntax.kind()) {
1975 Some(Self { syntax }) 1987 Some(Self { syntax })
@@ -1979,8 +1991,8 @@ impl AstNode for PathType {
1979 } 1991 }
1980 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1992 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1981} 1993}
1982impl AstNode for PointerType { 1994impl AstNode for BreakExpr {
1983 fn can_cast(kind: SyntaxKind) -> bool { kind == POINTER_TYPE } 1995 fn can_cast(kind: SyntaxKind) -> bool { kind == BREAK_EXPR }
1984 fn cast(syntax: SyntaxNode) -> Option<Self> { 1996 fn cast(syntax: SyntaxNode) -> Option<Self> {
1985 if Self::can_cast(syntax.kind()) { 1997 if Self::can_cast(syntax.kind()) {
1986 Some(Self { syntax }) 1998 Some(Self { syntax })
@@ -1990,8 +2002,8 @@ impl AstNode for PointerType {
1990 } 2002 }
1991 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2003 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1992} 2004}
1993impl AstNode for ArrayType { 2005impl AstNode for CallExpr {
1994 fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_TYPE } 2006 fn can_cast(kind: SyntaxKind) -> bool { kind == CALL_EXPR }
1995 fn cast(syntax: SyntaxNode) -> Option<Self> { 2007 fn cast(syntax: SyntaxNode) -> Option<Self> {
1996 if Self::can_cast(syntax.kind()) { 2008 if Self::can_cast(syntax.kind()) {
1997 Some(Self { syntax }) 2009 Some(Self { syntax })
@@ -2001,8 +2013,8 @@ impl AstNode for ArrayType {
2001 } 2013 }
2002 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2014 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2003} 2015}
2004impl AstNode for SliceType { 2016impl AstNode for CastExpr {
2005 fn can_cast(kind: SyntaxKind) -> bool { kind == SLICE_TYPE } 2017 fn can_cast(kind: SyntaxKind) -> bool { kind == CAST_EXPR }
2006 fn cast(syntax: SyntaxNode) -> Option<Self> { 2018 fn cast(syntax: SyntaxNode) -> Option<Self> {
2007 if Self::can_cast(syntax.kind()) { 2019 if Self::can_cast(syntax.kind()) {
2008 Some(Self { syntax }) 2020 Some(Self { syntax })
@@ -2012,8 +2024,8 @@ impl AstNode for SliceType {
2012 } 2024 }
2013 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2025 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2014} 2026}
2015impl AstNode for ReferenceType { 2027impl AstNode for ContinueExpr {
2016 fn can_cast(kind: SyntaxKind) -> bool { kind == REFERENCE_TYPE } 2028 fn can_cast(kind: SyntaxKind) -> bool { kind == CONTINUE_EXPR }
2017 fn cast(syntax: SyntaxNode) -> Option<Self> { 2029 fn cast(syntax: SyntaxNode) -> Option<Self> {
2018 if Self::can_cast(syntax.kind()) { 2030 if Self::can_cast(syntax.kind()) {
2019 Some(Self { syntax }) 2031 Some(Self { syntax })
@@ -2023,8 +2035,8 @@ impl AstNode for ReferenceType {
2023 } 2035 }
2024 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2036 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2025} 2037}
2026impl AstNode for InferType { 2038impl AstNode for EffectExpr {
2027 fn can_cast(kind: SyntaxKind) -> bool { kind == INFER_TYPE } 2039 fn can_cast(kind: SyntaxKind) -> bool { kind == EFFECT_EXPR }
2028 fn cast(syntax: SyntaxNode) -> Option<Self> { 2040 fn cast(syntax: SyntaxNode) -> Option<Self> {
2029 if Self::can_cast(syntax.kind()) { 2041 if Self::can_cast(syntax.kind()) {
2030 Some(Self { syntax }) 2042 Some(Self { syntax })
@@ -2034,8 +2046,8 @@ impl AstNode for InferType {
2034 } 2046 }
2035 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2047 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2036} 2048}
2037impl AstNode for FnPointerType { 2049impl AstNode for FieldExpr {
2038 fn can_cast(kind: SyntaxKind) -> bool { kind == FN_POINTER_TYPE } 2050 fn can_cast(kind: SyntaxKind) -> bool { kind == FIELD_EXPR }
2039 fn cast(syntax: SyntaxNode) -> Option<Self> { 2051 fn cast(syntax: SyntaxNode) -> Option<Self> {
2040 if Self::can_cast(syntax.kind()) { 2052 if Self::can_cast(syntax.kind()) {
2041 Some(Self { syntax }) 2053 Some(Self { syntax })
@@ -2045,8 +2057,8 @@ impl AstNode for FnPointerType {
2045 } 2057 }
2046 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2058 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2047} 2059}
2048impl AstNode for ForType { 2060impl AstNode for ForExpr {
2049 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_TYPE } 2061 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_EXPR }
2050 fn cast(syntax: SyntaxNode) -> Option<Self> { 2062 fn cast(syntax: SyntaxNode) -> Option<Self> {
2051 if Self::can_cast(syntax.kind()) { 2063 if Self::can_cast(syntax.kind()) {
2052 Some(Self { syntax }) 2064 Some(Self { syntax })
@@ -2056,8 +2068,8 @@ impl AstNode for ForType {
2056 } 2068 }
2057 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2069 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2058} 2070}
2059impl AstNode for ImplTraitType { 2071impl AstNode for IfExpr {
2060 fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL_TRAIT_TYPE } 2072 fn can_cast(kind: SyntaxKind) -> bool { kind == IF_EXPR }
2061 fn cast(syntax: SyntaxNode) -> Option<Self> { 2073 fn cast(syntax: SyntaxNode) -> Option<Self> {
2062 if Self::can_cast(syntax.kind()) { 2074 if Self::can_cast(syntax.kind()) {
2063 Some(Self { syntax }) 2075 Some(Self { syntax })
@@ -2067,8 +2079,8 @@ impl AstNode for ImplTraitType {
2067 } 2079 }
2068 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2080 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2069} 2081}
2070impl AstNode for DynTraitType { 2082impl AstNode for IndexExpr {
2071 fn can_cast(kind: SyntaxKind) -> bool { kind == DYN_TRAIT_TYPE } 2083 fn can_cast(kind: SyntaxKind) -> bool { kind == INDEX_EXPR }
2072 fn cast(syntax: SyntaxNode) -> Option<Self> { 2084 fn cast(syntax: SyntaxNode) -> Option<Self> {
2073 if Self::can_cast(syntax.kind()) { 2085 if Self::can_cast(syntax.kind()) {
2074 Some(Self { syntax }) 2086 Some(Self { syntax })
@@ -2078,8 +2090,8 @@ impl AstNode for DynTraitType {
2078 } 2090 }
2079 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2091 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2080} 2092}
2081impl AstNode for TypeBound { 2093impl AstNode for Label {
2082 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND } 2094 fn can_cast(kind: SyntaxKind) -> bool { kind == LABEL }
2083 fn cast(syntax: SyntaxNode) -> Option<Self> { 2095 fn cast(syntax: SyntaxNode) -> Option<Self> {
2084 if Self::can_cast(syntax.kind()) { 2096 if Self::can_cast(syntax.kind()) {
2085 Some(Self { syntax }) 2097 Some(Self { syntax })
@@ -2089,8 +2101,8 @@ impl AstNode for TypeBound {
2089 } 2101 }
2090 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2102 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2091} 2103}
2092impl AstNode for TupleExpr { 2104impl AstNode for LambdaExpr {
2093 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_EXPR } 2105 fn can_cast(kind: SyntaxKind) -> bool { kind == LAMBDA_EXPR }
2094 fn cast(syntax: SyntaxNode) -> Option<Self> { 2106 fn cast(syntax: SyntaxNode) -> Option<Self> {
2095 if Self::can_cast(syntax.kind()) { 2107 if Self::can_cast(syntax.kind()) {
2096 Some(Self { syntax }) 2108 Some(Self { syntax })
@@ -2100,8 +2112,8 @@ impl AstNode for TupleExpr {
2100 } 2112 }
2101 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2113 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2102} 2114}
2103impl AstNode for ArrayExpr { 2115impl AstNode for LoopExpr {
2104 fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_EXPR } 2116 fn can_cast(kind: SyntaxKind) -> bool { kind == LOOP_EXPR }
2105 fn cast(syntax: SyntaxNode) -> Option<Self> { 2117 fn cast(syntax: SyntaxNode) -> Option<Self> {
2106 if Self::can_cast(syntax.kind()) { 2118 if Self::can_cast(syntax.kind()) {
2107 Some(Self { syntax }) 2119 Some(Self { syntax })
@@ -2111,8 +2123,8 @@ impl AstNode for ArrayExpr {
2111 } 2123 }
2112 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2124 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2113} 2125}
2114impl AstNode for ParenExpr { 2126impl AstNode for MatchExpr {
2115 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_EXPR } 2127 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_EXPR }
2116 fn cast(syntax: SyntaxNode) -> Option<Self> { 2128 fn cast(syntax: SyntaxNode) -> Option<Self> {
2117 if Self::can_cast(syntax.kind()) { 2129 if Self::can_cast(syntax.kind()) {
2118 Some(Self { syntax }) 2130 Some(Self { syntax })
@@ -2122,8 +2134,8 @@ impl AstNode for ParenExpr {
2122 } 2134 }
2123 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2135 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2124} 2136}
2125impl AstNode for PathExpr { 2137impl AstNode for MethodCallExpr {
2126 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_EXPR } 2138 fn can_cast(kind: SyntaxKind) -> bool { kind == METHOD_CALL_EXPR }
2127 fn cast(syntax: SyntaxNode) -> Option<Self> { 2139 fn cast(syntax: SyntaxNode) -> Option<Self> {
2128 if Self::can_cast(syntax.kind()) { 2140 if Self::can_cast(syntax.kind()) {
2129 Some(Self { syntax }) 2141 Some(Self { syntax })
@@ -2133,8 +2145,8 @@ impl AstNode for PathExpr {
2133 } 2145 }
2134 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2146 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2135} 2147}
2136impl AstNode for LambdaExpr { 2148impl AstNode for ParenExpr {
2137 fn can_cast(kind: SyntaxKind) -> bool { kind == LAMBDA_EXPR } 2149 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_EXPR }
2138 fn cast(syntax: SyntaxNode) -> Option<Self> { 2150 fn cast(syntax: SyntaxNode) -> Option<Self> {
2139 if Self::can_cast(syntax.kind()) { 2151 if Self::can_cast(syntax.kind()) {
2140 Some(Self { syntax }) 2152 Some(Self { syntax })
@@ -2144,8 +2156,8 @@ impl AstNode for LambdaExpr {
2144 } 2156 }
2145 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2157 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2146} 2158}
2147impl AstNode for IfExpr { 2159impl AstNode for PathExpr {
2148 fn can_cast(kind: SyntaxKind) -> bool { kind == IF_EXPR } 2160 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_EXPR }
2149 fn cast(syntax: SyntaxNode) -> Option<Self> { 2161 fn cast(syntax: SyntaxNode) -> Option<Self> {
2150 if Self::can_cast(syntax.kind()) { 2162 if Self::can_cast(syntax.kind()) {
2151 Some(Self { syntax }) 2163 Some(Self { syntax })
@@ -2155,8 +2167,8 @@ impl AstNode for IfExpr {
2155 } 2167 }
2156 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2168 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2157} 2169}
2158impl AstNode for Condition { 2170impl AstNode for PrefixExpr {
2159 fn can_cast(kind: SyntaxKind) -> bool { kind == CONDITION } 2171 fn can_cast(kind: SyntaxKind) -> bool { kind == PREFIX_EXPR }
2160 fn cast(syntax: SyntaxNode) -> Option<Self> { 2172 fn cast(syntax: SyntaxNode) -> Option<Self> {
2161 if Self::can_cast(syntax.kind()) { 2173 if Self::can_cast(syntax.kind()) {
2162 Some(Self { syntax }) 2174 Some(Self { syntax })
@@ -2166,8 +2178,8 @@ impl AstNode for Condition {
2166 } 2178 }
2167 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2179 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2168} 2180}
2169impl AstNode for EffectExpr { 2181impl AstNode for RangeExpr {
2170 fn can_cast(kind: SyntaxKind) -> bool { kind == EFFECT_EXPR } 2182 fn can_cast(kind: SyntaxKind) -> bool { kind == RANGE_EXPR }
2171 fn cast(syntax: SyntaxNode) -> Option<Self> { 2183 fn cast(syntax: SyntaxNode) -> Option<Self> {
2172 if Self::can_cast(syntax.kind()) { 2184 if Self::can_cast(syntax.kind()) {
2173 Some(Self { syntax }) 2185 Some(Self { syntax })
@@ -2177,8 +2189,8 @@ impl AstNode for EffectExpr {
2177 } 2189 }
2178 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2190 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2179} 2191}
2180impl AstNode for Label { 2192impl AstNode for RecordExpr {
2181 fn can_cast(kind: SyntaxKind) -> bool { kind == LABEL } 2193 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR }
2182 fn cast(syntax: SyntaxNode) -> Option<Self> { 2194 fn cast(syntax: SyntaxNode) -> Option<Self> {
2183 if Self::can_cast(syntax.kind()) { 2195 if Self::can_cast(syntax.kind()) {
2184 Some(Self { syntax }) 2196 Some(Self { syntax })
@@ -2188,8 +2200,8 @@ impl AstNode for Label {
2188 } 2200 }
2189 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2201 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2190} 2202}
2191impl AstNode for LoopExpr { 2203impl AstNode for RefExpr {
2192 fn can_cast(kind: SyntaxKind) -> bool { kind == LOOP_EXPR } 2204 fn can_cast(kind: SyntaxKind) -> bool { kind == REF_EXPR }
2193 fn cast(syntax: SyntaxNode) -> Option<Self> { 2205 fn cast(syntax: SyntaxNode) -> Option<Self> {
2194 if Self::can_cast(syntax.kind()) { 2206 if Self::can_cast(syntax.kind()) {
2195 Some(Self { syntax }) 2207 Some(Self { syntax })
@@ -2199,8 +2211,8 @@ impl AstNode for LoopExpr {
2199 } 2211 }
2200 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2212 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2201} 2213}
2202impl AstNode for ForExpr { 2214impl AstNode for ReturnExpr {
2203 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_EXPR } 2215 fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_EXPR }
2204 fn cast(syntax: SyntaxNode) -> Option<Self> { 2216 fn cast(syntax: SyntaxNode) -> Option<Self> {
2205 if Self::can_cast(syntax.kind()) { 2217 if Self::can_cast(syntax.kind()) {
2206 Some(Self { syntax }) 2218 Some(Self { syntax })
@@ -2210,8 +2222,8 @@ impl AstNode for ForExpr {
2210 } 2222 }
2211 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2223 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2212} 2224}
2213impl AstNode for WhileExpr { 2225impl AstNode for TryExpr {
2214 fn can_cast(kind: SyntaxKind) -> bool { kind == WHILE_EXPR } 2226 fn can_cast(kind: SyntaxKind) -> bool { kind == TRY_EXPR }
2215 fn cast(syntax: SyntaxNode) -> Option<Self> { 2227 fn cast(syntax: SyntaxNode) -> Option<Self> {
2216 if Self::can_cast(syntax.kind()) { 2228 if Self::can_cast(syntax.kind()) {
2217 Some(Self { syntax }) 2229 Some(Self { syntax })
@@ -2221,8 +2233,8 @@ impl AstNode for WhileExpr {
2221 } 2233 }
2222 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2234 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2223} 2235}
2224impl AstNode for ContinueExpr { 2236impl AstNode for TupleExpr {
2225 fn can_cast(kind: SyntaxKind) -> bool { kind == CONTINUE_EXPR } 2237 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_EXPR }
2226 fn cast(syntax: SyntaxNode) -> Option<Self> { 2238 fn cast(syntax: SyntaxNode) -> Option<Self> {
2227 if Self::can_cast(syntax.kind()) { 2239 if Self::can_cast(syntax.kind()) {
2228 Some(Self { syntax }) 2240 Some(Self { syntax })
@@ -2232,8 +2244,8 @@ impl AstNode for ContinueExpr {
2232 } 2244 }
2233 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2245 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2234} 2246}
2235impl AstNode for BreakExpr { 2247impl AstNode for WhileExpr {
2236 fn can_cast(kind: SyntaxKind) -> bool { kind == BREAK_EXPR } 2248 fn can_cast(kind: SyntaxKind) -> bool { kind == WHILE_EXPR }
2237 fn cast(syntax: SyntaxNode) -> Option<Self> { 2249 fn cast(syntax: SyntaxNode) -> Option<Self> {
2238 if Self::can_cast(syntax.kind()) { 2250 if Self::can_cast(syntax.kind()) {
2239 Some(Self { syntax }) 2251 Some(Self { syntax })
@@ -2243,8 +2255,8 @@ impl AstNode for BreakExpr {
2243 } 2255 }
2244 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2256 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2245} 2257}
2246impl AstNode for ReturnExpr { 2258impl AstNode for RecordExprFieldList {
2247 fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_EXPR } 2259 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD_LIST }
2248 fn cast(syntax: SyntaxNode) -> Option<Self> { 2260 fn cast(syntax: SyntaxNode) -> Option<Self> {
2249 if Self::can_cast(syntax.kind()) { 2261 if Self::can_cast(syntax.kind()) {
2250 Some(Self { syntax }) 2262 Some(Self { syntax })
@@ -2254,8 +2266,8 @@ impl AstNode for ReturnExpr {
2254 } 2266 }
2255 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2267 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2256} 2268}
2257impl AstNode for CallExpr { 2269impl AstNode for RecordExprField {
2258 fn can_cast(kind: SyntaxKind) -> bool { kind == CALL_EXPR } 2270 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD }
2259 fn cast(syntax: SyntaxNode) -> Option<Self> { 2271 fn cast(syntax: SyntaxNode) -> Option<Self> {
2260 if Self::can_cast(syntax.kind()) { 2272 if Self::can_cast(syntax.kind()) {
2261 Some(Self { syntax }) 2273 Some(Self { syntax })
@@ -2276,8 +2288,8 @@ impl AstNode for ArgList {
2276 } 2288 }
2277 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2289 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2278} 2290}
2279impl AstNode for MethodCallExpr { 2291impl AstNode for TypeArgList {
2280 fn can_cast(kind: SyntaxKind) -> bool { kind == METHOD_CALL_EXPR } 2292 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ARG_LIST }
2281 fn cast(syntax: SyntaxNode) -> Option<Self> { 2293 fn cast(syntax: SyntaxNode) -> Option<Self> {
2282 if Self::can_cast(syntax.kind()) { 2294 if Self::can_cast(syntax.kind()) {
2283 Some(Self { syntax }) 2295 Some(Self { syntax })
@@ -2287,8 +2299,8 @@ impl AstNode for MethodCallExpr {
2287 } 2299 }
2288 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2300 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2289} 2301}
2290impl AstNode for TypeArgList { 2302impl AstNode for Condition {
2291 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ARG_LIST } 2303 fn can_cast(kind: SyntaxKind) -> bool { kind == CONDITION }
2292 fn cast(syntax: SyntaxNode) -> Option<Self> { 2304 fn cast(syntax: SyntaxNode) -> Option<Self> {
2293 if Self::can_cast(syntax.kind()) { 2305 if Self::can_cast(syntax.kind()) {
2294 Some(Self { syntax }) 2306 Some(Self { syntax })
@@ -2298,8 +2310,8 @@ impl AstNode for TypeArgList {
2298 } 2310 }
2299 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2311 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2300} 2312}
2301impl AstNode for FieldExpr { 2313impl AstNode for MatchArmList {
2302 fn can_cast(kind: SyntaxKind) -> bool { kind == FIELD_EXPR } 2314 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM_LIST }
2303 fn cast(syntax: SyntaxNode) -> Option<Self> { 2315 fn cast(syntax: SyntaxNode) -> Option<Self> {
2304 if Self::can_cast(syntax.kind()) { 2316 if Self::can_cast(syntax.kind()) {
2305 Some(Self { syntax }) 2317 Some(Self { syntax })
@@ -2309,8 +2321,8 @@ impl AstNode for FieldExpr {
2309 } 2321 }
2310 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2322 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2311} 2323}
2312impl AstNode for IndexExpr { 2324impl AstNode for MatchArm {
2313 fn can_cast(kind: SyntaxKind) -> bool { kind == INDEX_EXPR } 2325 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM }
2314 fn cast(syntax: SyntaxNode) -> Option<Self> { 2326 fn cast(syntax: SyntaxNode) -> Option<Self> {
2315 if Self::can_cast(syntax.kind()) { 2327 if Self::can_cast(syntax.kind()) {
2316 Some(Self { syntax }) 2328 Some(Self { syntax })
@@ -2320,8 +2332,8 @@ impl AstNode for IndexExpr {
2320 } 2332 }
2321 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2333 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2322} 2334}
2323impl AstNode for AwaitExpr { 2335impl AstNode for MatchGuard {
2324 fn can_cast(kind: SyntaxKind) -> bool { kind == AWAIT_EXPR } 2336 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_GUARD }
2325 fn cast(syntax: SyntaxNode) -> Option<Self> { 2337 fn cast(syntax: SyntaxNode) -> Option<Self> {
2326 if Self::can_cast(syntax.kind()) { 2338 if Self::can_cast(syntax.kind()) {
2327 Some(Self { syntax }) 2339 Some(Self { syntax })
@@ -2331,8 +2343,8 @@ impl AstNode for AwaitExpr {
2331 } 2343 }
2332 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2344 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2333} 2345}
2334impl AstNode for TryExpr { 2346impl AstNode for ArrayType {
2335 fn can_cast(kind: SyntaxKind) -> bool { kind == TRY_EXPR } 2347 fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_TYPE }
2336 fn cast(syntax: SyntaxNode) -> Option<Self> { 2348 fn cast(syntax: SyntaxNode) -> Option<Self> {
2337 if Self::can_cast(syntax.kind()) { 2349 if Self::can_cast(syntax.kind()) {
2338 Some(Self { syntax }) 2350 Some(Self { syntax })
@@ -2342,8 +2354,8 @@ impl AstNode for TryExpr {
2342 } 2354 }
2343 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2355 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2344} 2356}
2345impl AstNode for CastExpr { 2357impl AstNode for DynTraitType {
2346 fn can_cast(kind: SyntaxKind) -> bool { kind == CAST_EXPR } 2358 fn can_cast(kind: SyntaxKind) -> bool { kind == DYN_TRAIT_TYPE }
2347 fn cast(syntax: SyntaxNode) -> Option<Self> { 2359 fn cast(syntax: SyntaxNode) -> Option<Self> {
2348 if Self::can_cast(syntax.kind()) { 2360 if Self::can_cast(syntax.kind()) {
2349 Some(Self { syntax }) 2361 Some(Self { syntax })
@@ -2353,8 +2365,8 @@ impl AstNode for CastExpr {
2353 } 2365 }
2354 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2366 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2355} 2367}
2356impl AstNode for RefExpr { 2368impl AstNode for FnPointerType {
2357 fn can_cast(kind: SyntaxKind) -> bool { kind == REF_EXPR } 2369 fn can_cast(kind: SyntaxKind) -> bool { kind == FN_POINTER_TYPE }
2358 fn cast(syntax: SyntaxNode) -> Option<Self> { 2370 fn cast(syntax: SyntaxNode) -> Option<Self> {
2359 if Self::can_cast(syntax.kind()) { 2371 if Self::can_cast(syntax.kind()) {
2360 Some(Self { syntax }) 2372 Some(Self { syntax })
@@ -2364,8 +2376,8 @@ impl AstNode for RefExpr {
2364 } 2376 }
2365 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2377 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2366} 2378}
2367impl AstNode for PrefixExpr { 2379impl AstNode for ForType {
2368 fn can_cast(kind: SyntaxKind) -> bool { kind == PREFIX_EXPR } 2380 fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_TYPE }
2369 fn cast(syntax: SyntaxNode) -> Option<Self> { 2381 fn cast(syntax: SyntaxNode) -> Option<Self> {
2370 if Self::can_cast(syntax.kind()) { 2382 if Self::can_cast(syntax.kind()) {
2371 Some(Self { syntax }) 2383 Some(Self { syntax })
@@ -2375,8 +2387,8 @@ impl AstNode for PrefixExpr {
2375 } 2387 }
2376 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2388 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2377} 2389}
2378impl AstNode for BoxExpr { 2390impl AstNode for ImplTraitType {
2379 fn can_cast(kind: SyntaxKind) -> bool { kind == BOX_EXPR } 2391 fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL_TRAIT_TYPE }
2380 fn cast(syntax: SyntaxNode) -> Option<Self> { 2392 fn cast(syntax: SyntaxNode) -> Option<Self> {
2381 if Self::can_cast(syntax.kind()) { 2393 if Self::can_cast(syntax.kind()) {
2382 Some(Self { syntax }) 2394 Some(Self { syntax })
@@ -2386,8 +2398,8 @@ impl AstNode for BoxExpr {
2386 } 2398 }
2387 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2399 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2388} 2400}
2389impl AstNode for RangeExpr { 2401impl AstNode for InferType {
2390 fn can_cast(kind: SyntaxKind) -> bool { kind == RANGE_EXPR } 2402 fn can_cast(kind: SyntaxKind) -> bool { kind == INFER_TYPE }
2391 fn cast(syntax: SyntaxNode) -> Option<Self> { 2403 fn cast(syntax: SyntaxNode) -> Option<Self> {
2392 if Self::can_cast(syntax.kind()) { 2404 if Self::can_cast(syntax.kind()) {
2393 Some(Self { syntax }) 2405 Some(Self { syntax })
@@ -2397,8 +2409,8 @@ impl AstNode for RangeExpr {
2397 } 2409 }
2398 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2410 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2399} 2411}
2400impl AstNode for BinExpr { 2412impl AstNode for NeverType {
2401 fn can_cast(kind: SyntaxKind) -> bool { kind == BIN_EXPR } 2413 fn can_cast(kind: SyntaxKind) -> bool { kind == NEVER_TYPE }
2402 fn cast(syntax: SyntaxNode) -> Option<Self> { 2414 fn cast(syntax: SyntaxNode) -> Option<Self> {
2403 if Self::can_cast(syntax.kind()) { 2415 if Self::can_cast(syntax.kind()) {
2404 Some(Self { syntax }) 2416 Some(Self { syntax })
@@ -2408,8 +2420,8 @@ impl AstNode for BinExpr {
2408 } 2420 }
2409 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2421 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2410} 2422}
2411impl AstNode for MatchExpr { 2423impl AstNode for ParenType {
2412 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_EXPR } 2424 fn can_cast(kind: SyntaxKind) -> bool { kind == PAREN_TYPE }
2413 fn cast(syntax: SyntaxNode) -> Option<Self> { 2425 fn cast(syntax: SyntaxNode) -> Option<Self> {
2414 if Self::can_cast(syntax.kind()) { 2426 if Self::can_cast(syntax.kind()) {
2415 Some(Self { syntax }) 2427 Some(Self { syntax })
@@ -2419,8 +2431,8 @@ impl AstNode for MatchExpr {
2419 } 2431 }
2420 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2432 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2421} 2433}
2422impl AstNode for MatchArmList { 2434impl AstNode for PathType {
2423 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM_LIST } 2435 fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_TYPE }
2424 fn cast(syntax: SyntaxNode) -> Option<Self> { 2436 fn cast(syntax: SyntaxNode) -> Option<Self> {
2425 if Self::can_cast(syntax.kind()) { 2437 if Self::can_cast(syntax.kind()) {
2426 Some(Self { syntax }) 2438 Some(Self { syntax })
@@ -2430,8 +2442,8 @@ impl AstNode for MatchArmList {
2430 } 2442 }
2431 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2443 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2432} 2444}
2433impl AstNode for MatchArm { 2445impl AstNode for PointerType {
2434 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_ARM } 2446 fn can_cast(kind: SyntaxKind) -> bool { kind == POINTER_TYPE }
2435 fn cast(syntax: SyntaxNode) -> Option<Self> { 2447 fn cast(syntax: SyntaxNode) -> Option<Self> {
2436 if Self::can_cast(syntax.kind()) { 2448 if Self::can_cast(syntax.kind()) {
2437 Some(Self { syntax }) 2449 Some(Self { syntax })
@@ -2441,8 +2453,8 @@ impl AstNode for MatchArm {
2441 } 2453 }
2442 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2454 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2443} 2455}
2444impl AstNode for MatchGuard { 2456impl AstNode for ReferenceType {
2445 fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_GUARD } 2457 fn can_cast(kind: SyntaxKind) -> bool { kind == REFERENCE_TYPE }
2446 fn cast(syntax: SyntaxNode) -> Option<Self> { 2458 fn cast(syntax: SyntaxNode) -> Option<Self> {
2447 if Self::can_cast(syntax.kind()) { 2459 if Self::can_cast(syntax.kind()) {
2448 Some(Self { syntax }) 2460 Some(Self { syntax })
@@ -2452,8 +2464,8 @@ impl AstNode for MatchGuard {
2452 } 2464 }
2453 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2465 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2454} 2466}
2455impl AstNode for RecordExpr { 2467impl AstNode for SliceType {
2456 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR } 2468 fn can_cast(kind: SyntaxKind) -> bool { kind == SLICE_TYPE }
2457 fn cast(syntax: SyntaxNode) -> Option<Self> { 2469 fn cast(syntax: SyntaxNode) -> Option<Self> {
2458 if Self::can_cast(syntax.kind()) { 2470 if Self::can_cast(syntax.kind()) {
2459 Some(Self { syntax }) 2471 Some(Self { syntax })
@@ -2463,8 +2475,8 @@ impl AstNode for RecordExpr {
2463 } 2475 }
2464 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2476 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2465} 2477}
2466impl AstNode for RecordExprFieldList { 2478impl AstNode for TupleType {
2467 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD_LIST } 2479 fn can_cast(kind: SyntaxKind) -> bool { kind == TUPLE_TYPE }
2468 fn cast(syntax: SyntaxNode) -> Option<Self> { 2480 fn cast(syntax: SyntaxNode) -> Option<Self> {
2469 if Self::can_cast(syntax.kind()) { 2481 if Self::can_cast(syntax.kind()) {
2470 Some(Self { syntax }) 2482 Some(Self { syntax })
@@ -2474,8 +2486,8 @@ impl AstNode for RecordExprFieldList {
2474 } 2486 }
2475 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2487 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2476} 2488}
2477impl AstNode for RecordExprField { 2489impl AstNode for TypeBound {
2478 fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD } 2490 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND }
2479 fn cast(syntax: SyntaxNode) -> Option<Self> { 2491 fn cast(syntax: SyntaxNode) -> Option<Self> {
2480 if Self::can_cast(syntax.kind()) { 2492 if Self::can_cast(syntax.kind()) {
2481 Some(Self { syntax }) 2493 Some(Self { syntax })
@@ -2849,88 +2861,88 @@ impl AstNode for Item {
2849 } 2861 }
2850 } 2862 }
2851} 2863}
2852impl From<ParenType> for Type { 2864impl From<ArrayType> for Type {
2853 fn from(node: ParenType) -> Type { Type::ParenType(node) } 2865 fn from(node: ArrayType) -> Type { Type::ArrayType(node) }
2854} 2866}
2855impl From<TupleType> for Type { 2867impl From<DynTraitType> for Type {
2856 fn from(node: TupleType) -> Type { Type::TupleType(node) } 2868 fn from(node: DynTraitType) -> Type { Type::DynTraitType(node) }
2869}
2870impl From<FnPointerType> for Type {
2871 fn from(node: FnPointerType) -> Type { Type::FnPointerType(node) }
2872}
2873impl From<ForType> for Type {
2874 fn from(node: ForType) -> Type { Type::ForType(node) }
2875}
2876impl From<ImplTraitType> for Type {
2877 fn from(node: ImplTraitType) -> Type { Type::ImplTraitType(node) }
2878}
2879impl From<InferType> for Type {
2880 fn from(node: InferType) -> Type { Type::InferType(node) }
2857} 2881}
2858impl From<NeverType> for Type { 2882impl From<NeverType> for Type {
2859 fn from(node: NeverType) -> Type { Type::NeverType(node) } 2883 fn from(node: NeverType) -> Type { Type::NeverType(node) }
2860} 2884}
2885impl From<ParenType> for Type {
2886 fn from(node: ParenType) -> Type { Type::ParenType(node) }
2887}
2861impl From<PathType> for Type { 2888impl From<PathType> for Type {
2862 fn from(node: PathType) -> Type { Type::PathType(node) } 2889 fn from(node: PathType) -> Type { Type::PathType(node) }
2863} 2890}
2864impl From<PointerType> for Type { 2891impl From<PointerType> for Type {
2865 fn from(node: PointerType) -> Type { Type::PointerType(node) } 2892 fn from(node: PointerType) -> Type { Type::PointerType(node) }
2866} 2893}
2867impl From<ArrayType> for Type {
2868 fn from(node: ArrayType) -> Type { Type::ArrayType(node) }
2869}
2870impl From<SliceType> for Type {
2871 fn from(node: SliceType) -> Type { Type::SliceType(node) }
2872}
2873impl From<ReferenceType> for Type { 2894impl From<ReferenceType> for Type {
2874 fn from(node: ReferenceType) -> Type { Type::ReferenceType(node) } 2895 fn from(node: ReferenceType) -> Type { Type::ReferenceType(node) }
2875} 2896}
2876impl From<InferType> for Type { 2897impl From<SliceType> for Type {
2877 fn from(node: InferType) -> Type { Type::InferType(node) } 2898 fn from(node: SliceType) -> Type { Type::SliceType(node) }
2878}
2879impl From<FnPointerType> for Type {
2880 fn from(node: FnPointerType) -> Type { Type::FnPointerType(node) }
2881}
2882impl From<ForType> for Type {
2883 fn from(node: ForType) -> Type { Type::ForType(node) }
2884}
2885impl From<ImplTraitType> for Type {
2886 fn from(node: ImplTraitType) -> Type { Type::ImplTraitType(node) }
2887} 2899}
2888impl From<DynTraitType> for Type { 2900impl From<TupleType> for Type {
2889 fn from(node: DynTraitType) -> Type { Type::DynTraitType(node) } 2901 fn from(node: TupleType) -> Type { Type::TupleType(node) }
2890} 2902}
2891impl AstNode for Type { 2903impl AstNode for Type {
2892 fn can_cast(kind: SyntaxKind) -> bool { 2904 fn can_cast(kind: SyntaxKind) -> bool {
2893 match kind { 2905 match kind {
2894 PAREN_TYPE | TUPLE_TYPE | NEVER_TYPE | PATH_TYPE | POINTER_TYPE | ARRAY_TYPE 2906 ARRAY_TYPE | DYN_TRAIT_TYPE | FN_POINTER_TYPE | FOR_TYPE | IMPL_TRAIT_TYPE
2895 | SLICE_TYPE | REFERENCE_TYPE | INFER_TYPE | FN_POINTER_TYPE | FOR_TYPE 2907 | INFER_TYPE | NEVER_TYPE | PAREN_TYPE | PATH_TYPE | POINTER_TYPE | REFERENCE_TYPE
2896 | IMPL_TRAIT_TYPE | DYN_TRAIT_TYPE => true, 2908 | SLICE_TYPE | TUPLE_TYPE => true,
2897 _ => false, 2909 _ => false,
2898 } 2910 }
2899 } 2911 }
2900 fn cast(syntax: SyntaxNode) -> Option<Self> { 2912 fn cast(syntax: SyntaxNode) -> Option<Self> {
2901 let res = match syntax.kind() { 2913 let res = match syntax.kind() {
2902 PAREN_TYPE => Type::ParenType(ParenType { syntax }),
2903 TUPLE_TYPE => Type::TupleType(TupleType { syntax }),
2904 NEVER_TYPE => Type::NeverType(NeverType { syntax }),
2905 PATH_TYPE => Type::PathType(PathType { syntax }),
2906 POINTER_TYPE => Type::PointerType(PointerType { syntax }),
2907 ARRAY_TYPE => Type::ArrayType(ArrayType { syntax }), 2914 ARRAY_TYPE => Type::ArrayType(ArrayType { syntax }),
2908 SLICE_TYPE => Type::SliceType(SliceType { syntax }), 2915 DYN_TRAIT_TYPE => Type::DynTraitType(DynTraitType { syntax }),
2909 REFERENCE_TYPE => Type::ReferenceType(ReferenceType { syntax }),
2910 INFER_TYPE => Type::InferType(InferType { syntax }),
2911 FN_POINTER_TYPE => Type::FnPointerType(FnPointerType { syntax }), 2916 FN_POINTER_TYPE => Type::FnPointerType(FnPointerType { syntax }),
2912 FOR_TYPE => Type::ForType(ForType { syntax }), 2917 FOR_TYPE => Type::ForType(ForType { syntax }),
2913 IMPL_TRAIT_TYPE => Type::ImplTraitType(ImplTraitType { syntax }), 2918 IMPL_TRAIT_TYPE => Type::ImplTraitType(ImplTraitType { syntax }),
2914 DYN_TRAIT_TYPE => Type::DynTraitType(DynTraitType { syntax }), 2919 INFER_TYPE => Type::InferType(InferType { syntax }),
2920 NEVER_TYPE => Type::NeverType(NeverType { syntax }),
2921 PAREN_TYPE => Type::ParenType(ParenType { syntax }),
2922 PATH_TYPE => Type::PathType(PathType { syntax }),
2923 POINTER_TYPE => Type::PointerType(PointerType { syntax }),
2924 REFERENCE_TYPE => Type::ReferenceType(ReferenceType { syntax }),
2925 SLICE_TYPE => Type::SliceType(SliceType { syntax }),
2926 TUPLE_TYPE => Type::TupleType(TupleType { syntax }),
2915 _ => return None, 2927 _ => return None,
2916 }; 2928 };
2917 Some(res) 2929 Some(res)
2918 } 2930 }
2919 fn syntax(&self) -> &SyntaxNode { 2931 fn syntax(&self) -> &SyntaxNode {
2920 match self { 2932 match self {
2921 Type::ParenType(it) => &it.syntax,
2922 Type::TupleType(it) => &it.syntax,
2923 Type::NeverType(it) => &it.syntax,
2924 Type::PathType(it) => &it.syntax,
2925 Type::PointerType(it) => &it.syntax,
2926 Type::ArrayType(it) => &it.syntax, 2933 Type::ArrayType(it) => &it.syntax,
2927 Type::SliceType(it) => &it.syntax, 2934 Type::DynTraitType(it) => &it.syntax,
2928 Type::ReferenceType(it) => &it.syntax,
2929 Type::InferType(it) => &it.syntax,
2930 Type::FnPointerType(it) => &it.syntax, 2935 Type::FnPointerType(it) => &it.syntax,
2931 Type::ForType(it) => &it.syntax, 2936 Type::ForType(it) => &it.syntax,
2932 Type::ImplTraitType(it) => &it.syntax, 2937 Type::ImplTraitType(it) => &it.syntax,
2933 Type::DynTraitType(it) => &it.syntax, 2938 Type::InferType(it) => &it.syntax,
2939 Type::NeverType(it) => &it.syntax,
2940 Type::ParenType(it) => &it.syntax,
2941 Type::PathType(it) => &it.syntax,
2942 Type::PointerType(it) => &it.syntax,
2943 Type::ReferenceType(it) => &it.syntax,
2944 Type::SliceType(it) => &it.syntax,
2945 Type::TupleType(it) => &it.syntax,
2934 } 2946 }
2935 } 2947 }
2936} 2948}
@@ -3057,80 +3069,74 @@ impl AstNode for FieldList {
3057 } 3069 }
3058 } 3070 }
3059} 3071}
3060impl From<TupleExpr> for Expr {
3061 fn from(node: TupleExpr) -> Expr { Expr::TupleExpr(node) }
3062}
3063impl From<ArrayExpr> for Expr { 3072impl From<ArrayExpr> for Expr {
3064 fn from(node: ArrayExpr) -> Expr { Expr::ArrayExpr(node) } 3073 fn from(node: ArrayExpr) -> Expr { Expr::ArrayExpr(node) }
3065} 3074}
3066impl From<ParenExpr> for Expr { 3075impl From<AwaitExpr> for Expr {
3067 fn from(node: ParenExpr) -> Expr { Expr::ParenExpr(node) } 3076 fn from(node: AwaitExpr) -> Expr { Expr::AwaitExpr(node) }
3068} 3077}
3069impl From<PathExpr> for Expr { 3078impl From<BinExpr> for Expr {
3070 fn from(node: PathExpr) -> Expr { Expr::PathExpr(node) } 3079 fn from(node: BinExpr) -> Expr { Expr::BinExpr(node) }
3071} 3080}
3072impl From<LambdaExpr> for Expr { 3081impl From<BlockExpr> for Expr {
3073 fn from(node: LambdaExpr) -> Expr { Expr::LambdaExpr(node) } 3082 fn from(node: BlockExpr) -> Expr { Expr::BlockExpr(node) }
3074} 3083}
3075impl From<IfExpr> for Expr { 3084impl From<BoxExpr> for Expr {
3076 fn from(node: IfExpr) -> Expr { Expr::IfExpr(node) } 3085 fn from(node: BoxExpr) -> Expr { Expr::BoxExpr(node) }
3077} 3086}
3078impl From<LoopExpr> for Expr { 3087impl From<BreakExpr> for Expr {
3079 fn from(node: LoopExpr) -> Expr { Expr::LoopExpr(node) } 3088 fn from(node: BreakExpr) -> Expr { Expr::BreakExpr(node) }
3080} 3089}
3081impl From<ForExpr> for Expr { 3090impl From<CallExpr> for Expr {
3082 fn from(node: ForExpr) -> Expr { Expr::ForExpr(node) } 3091 fn from(node: CallExpr) -> Expr { Expr::CallExpr(node) }
3083} 3092}
3084impl From<WhileExpr> for Expr { 3093impl From<CastExpr> for Expr {
3085 fn from(node: WhileExpr) -> Expr { Expr::WhileExpr(node) } 3094 fn from(node: CastExpr) -> Expr { Expr::CastExpr(node) }
3086} 3095}
3087impl From<ContinueExpr> for Expr { 3096impl From<ContinueExpr> for Expr {
3088 fn from(node: ContinueExpr) -> Expr { Expr::ContinueExpr(node) } 3097 fn from(node: ContinueExpr) -> Expr { Expr::ContinueExpr(node) }
3089} 3098}
3090impl From<BreakExpr> for Expr { 3099impl From<EffectExpr> for Expr {
3091 fn from(node: BreakExpr) -> Expr { Expr::BreakExpr(node) } 3100 fn from(node: EffectExpr) -> Expr { Expr::EffectExpr(node) }
3092}
3093impl From<Label> for Expr {
3094 fn from(node: Label) -> Expr { Expr::Label(node) }
3095}
3096impl From<BlockExpr> for Expr {
3097 fn from(node: BlockExpr) -> Expr { Expr::BlockExpr(node) }
3098}
3099impl From<ReturnExpr> for Expr {
3100 fn from(node: ReturnExpr) -> Expr { Expr::ReturnExpr(node) }
3101} 3101}
3102impl From<MatchExpr> for Expr { 3102impl From<FieldExpr> for Expr {
3103 fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) } 3103 fn from(node: FieldExpr) -> Expr { Expr::FieldExpr(node) }
3104} 3104}
3105impl From<RecordExpr> for Expr { 3105impl From<ForExpr> for Expr {
3106 fn from(node: RecordExpr) -> Expr { Expr::RecordExpr(node) } 3106 fn from(node: ForExpr) -> Expr { Expr::ForExpr(node) }
3107} 3107}
3108impl From<CallExpr> for Expr { 3108impl From<IfExpr> for Expr {
3109 fn from(node: CallExpr) -> Expr { Expr::CallExpr(node) } 3109 fn from(node: IfExpr) -> Expr { Expr::IfExpr(node) }
3110} 3110}
3111impl From<IndexExpr> for Expr { 3111impl From<IndexExpr> for Expr {
3112 fn from(node: IndexExpr) -> Expr { Expr::IndexExpr(node) } 3112 fn from(node: IndexExpr) -> Expr { Expr::IndexExpr(node) }
3113} 3113}
3114impl From<MethodCallExpr> for Expr { 3114impl From<Label> for Expr {
3115 fn from(node: MethodCallExpr) -> Expr { Expr::MethodCallExpr(node) } 3115 fn from(node: Label) -> Expr { Expr::Label(node) }
3116} 3116}
3117impl From<FieldExpr> for Expr { 3117impl From<LambdaExpr> for Expr {
3118 fn from(node: FieldExpr) -> Expr { Expr::FieldExpr(node) } 3118 fn from(node: LambdaExpr) -> Expr { Expr::LambdaExpr(node) }
3119} 3119}
3120impl From<AwaitExpr> for Expr { 3120impl From<Literal> for Expr {
3121 fn from(node: AwaitExpr) -> Expr { Expr::AwaitExpr(node) } 3121 fn from(node: Literal) -> Expr { Expr::Literal(node) }
3122} 3122}
3123impl From<TryExpr> for Expr { 3123impl From<LoopExpr> for Expr {
3124 fn from(node: TryExpr) -> Expr { Expr::TryExpr(node) } 3124 fn from(node: LoopExpr) -> Expr { Expr::LoopExpr(node) }
3125} 3125}
3126impl From<EffectExpr> for Expr { 3126impl From<MacroCall> for Expr {
3127 fn from(node: EffectExpr) -> Expr { Expr::EffectExpr(node) } 3127 fn from(node: MacroCall) -> Expr { Expr::MacroCall(node) }
3128} 3128}
3129impl From<CastExpr> for Expr { 3129impl From<MatchExpr> for Expr {
3130 fn from(node: CastExpr) -> Expr { Expr::CastExpr(node) } 3130 fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) }
3131} 3131}
3132impl From<RefExpr> for Expr { 3132impl From<MethodCallExpr> for Expr {
3133 fn from(node: RefExpr) -> Expr { Expr::RefExpr(node) } 3133 fn from(node: MethodCallExpr) -> Expr { Expr::MethodCallExpr(node) }
3134}
3135impl From<ParenExpr> for Expr {
3136 fn from(node: ParenExpr) -> Expr { Expr::ParenExpr(node) }
3137}
3138impl From<PathExpr> for Expr {
3139 fn from(node: PathExpr) -> Expr { Expr::PathExpr(node) }
3134} 3140}
3135impl From<PrefixExpr> for Expr { 3141impl From<PrefixExpr> for Expr {
3136 fn from(node: PrefixExpr) -> Expr { Expr::PrefixExpr(node) } 3142 fn from(node: PrefixExpr) -> Expr { Expr::PrefixExpr(node) }
@@ -3138,124 +3144,128 @@ impl From<PrefixExpr> for Expr {
3138impl From<RangeExpr> for Expr { 3144impl From<RangeExpr> for Expr {
3139 fn from(node: RangeExpr) -> Expr { Expr::RangeExpr(node) } 3145 fn from(node: RangeExpr) -> Expr { Expr::RangeExpr(node) }
3140} 3146}
3141impl From<BinExpr> for Expr { 3147impl From<RecordExpr> for Expr {
3142 fn from(node: BinExpr) -> Expr { Expr::BinExpr(node) } 3148 fn from(node: RecordExpr) -> Expr { Expr::RecordExpr(node) }
3143} 3149}
3144impl From<Literal> for Expr { 3150impl From<RefExpr> for Expr {
3145 fn from(node: Literal) -> Expr { Expr::Literal(node) } 3151 fn from(node: RefExpr) -> Expr { Expr::RefExpr(node) }
3146} 3152}
3147impl From<MacroCall> for Expr { 3153impl From<ReturnExpr> for Expr {
3148 fn from(node: MacroCall) -> Expr { Expr::MacroCall(node) } 3154 fn from(node: ReturnExpr) -> Expr { Expr::ReturnExpr(node) }
3149} 3155}
3150impl From<BoxExpr> for Expr { 3156impl From<TryExpr> for Expr {
3151 fn from(node: BoxExpr) -> Expr { Expr::BoxExpr(node) } 3157 fn from(node: TryExpr) -> Expr { Expr::TryExpr(node) }
3158}
3159impl From<TupleExpr> for Expr {
3160 fn from(node: TupleExpr) -> Expr { Expr::TupleExpr(node) }
3161}
3162impl From<WhileExpr> for Expr {
3163 fn from(node: WhileExpr) -> Expr { Expr::WhileExpr(node) }
3152} 3164}
3153impl AstNode for Expr { 3165impl AstNode for Expr {
3154 fn can_cast(kind: SyntaxKind) -> bool { 3166 fn can_cast(kind: SyntaxKind) -> bool {
3155 match kind { 3167 match kind {
3156 TUPLE_EXPR | ARRAY_EXPR | PAREN_EXPR | PATH_EXPR | LAMBDA_EXPR | IF_EXPR 3168 ARRAY_EXPR | AWAIT_EXPR | BIN_EXPR | BLOCK_EXPR | BOX_EXPR | BREAK_EXPR | CALL_EXPR
3157 | LOOP_EXPR | FOR_EXPR | WHILE_EXPR | CONTINUE_EXPR | BREAK_EXPR | LABEL 3169 | CAST_EXPR | CONTINUE_EXPR | EFFECT_EXPR | FIELD_EXPR | FOR_EXPR | IF_EXPR
3158 | BLOCK_EXPR | RETURN_EXPR | MATCH_EXPR | RECORD_EXPR | CALL_EXPR | INDEX_EXPR 3170 | INDEX_EXPR | LABEL | LAMBDA_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MATCH_EXPR
3159 | METHOD_CALL_EXPR | FIELD_EXPR | AWAIT_EXPR | TRY_EXPR | EFFECT_EXPR | CAST_EXPR 3171 | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR
3160 | REF_EXPR | PREFIX_EXPR | RANGE_EXPR | BIN_EXPR | LITERAL | MACRO_CALL | BOX_EXPR => { 3172 | RECORD_EXPR | REF_EXPR | RETURN_EXPR | TRY_EXPR | TUPLE_EXPR | WHILE_EXPR => true,
3161 true
3162 }
3163 _ => false, 3173 _ => false,
3164 } 3174 }
3165 } 3175 }
3166 fn cast(syntax: SyntaxNode) -> Option<Self> { 3176 fn cast(syntax: SyntaxNode) -> Option<Self> {
3167 let res = match syntax.kind() { 3177 let res = match syntax.kind() {
3168 TUPLE_EXPR => Expr::TupleExpr(TupleExpr { syntax }),
3169 ARRAY_EXPR => Expr::ArrayExpr(ArrayExpr { syntax }), 3178 ARRAY_EXPR => Expr::ArrayExpr(ArrayExpr { syntax }),
3170 PAREN_EXPR => Expr::ParenExpr(ParenExpr { syntax }), 3179 AWAIT_EXPR => Expr::AwaitExpr(AwaitExpr { syntax }),
3171 PATH_EXPR => Expr::PathExpr(PathExpr { syntax }), 3180 BIN_EXPR => Expr::BinExpr(BinExpr { syntax }),
3172 LAMBDA_EXPR => Expr::LambdaExpr(LambdaExpr { syntax }),
3173 IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
3174 LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }),
3175 FOR_EXPR => Expr::ForExpr(ForExpr { syntax }),
3176 WHILE_EXPR => Expr::WhileExpr(WhileExpr { syntax }),
3177 CONTINUE_EXPR => Expr::ContinueExpr(ContinueExpr { syntax }),
3178 BREAK_EXPR => Expr::BreakExpr(BreakExpr { syntax }),
3179 LABEL => Expr::Label(Label { syntax }),
3180 BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }), 3181 BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }),
3181 RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }), 3182 BOX_EXPR => Expr::BoxExpr(BoxExpr { syntax }),
3182 MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }), 3183 BREAK_EXPR => Expr::BreakExpr(BreakExpr { syntax }),
3183 RECORD_EXPR => Expr::RecordExpr(RecordExpr { syntax }),
3184 CALL_EXPR => Expr::CallExpr(CallExpr { syntax }), 3184 CALL_EXPR => Expr::CallExpr(CallExpr { syntax }),
3185 CAST_EXPR => Expr::CastExpr(CastExpr { syntax }),
3186 CONTINUE_EXPR => Expr::ContinueExpr(ContinueExpr { syntax }),
3187 EFFECT_EXPR => Expr::EffectExpr(EffectExpr { syntax }),
3188 FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }),
3189 FOR_EXPR => Expr::ForExpr(ForExpr { syntax }),
3190 IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
3185 INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }), 3191 INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }),
3192 LABEL => Expr::Label(Label { syntax }),
3193 LAMBDA_EXPR => Expr::LambdaExpr(LambdaExpr { syntax }),
3194 LITERAL => Expr::Literal(Literal { syntax }),
3195 LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }),
3196 MACRO_CALL => Expr::MacroCall(MacroCall { syntax }),
3197 MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }),
3186 METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }), 3198 METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }),
3187 FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }), 3199 PAREN_EXPR => Expr::ParenExpr(ParenExpr { syntax }),
3188 AWAIT_EXPR => Expr::AwaitExpr(AwaitExpr { syntax }), 3200 PATH_EXPR => Expr::PathExpr(PathExpr { syntax }),
3189 TRY_EXPR => Expr::TryExpr(TryExpr { syntax }),
3190 EFFECT_EXPR => Expr::EffectExpr(EffectExpr { syntax }),
3191 CAST_EXPR => Expr::CastExpr(CastExpr { syntax }),
3192 REF_EXPR => Expr::RefExpr(RefExpr { syntax }),
3193 PREFIX_EXPR => Expr::PrefixExpr(PrefixExpr { syntax }), 3201 PREFIX_EXPR => Expr::PrefixExpr(PrefixExpr { syntax }),
3194 RANGE_EXPR => Expr::RangeExpr(RangeExpr { syntax }), 3202 RANGE_EXPR => Expr::RangeExpr(RangeExpr { syntax }),
3195 BIN_EXPR => Expr::BinExpr(BinExpr { syntax }), 3203 RECORD_EXPR => Expr::RecordExpr(RecordExpr { syntax }),
3196 LITERAL => Expr::Literal(Literal { syntax }), 3204 REF_EXPR => Expr::RefExpr(RefExpr { syntax }),
3197 MACRO_CALL => Expr::MacroCall(MacroCall { syntax }), 3205 RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }),
3198 BOX_EXPR => Expr::BoxExpr(BoxExpr { syntax }), 3206 TRY_EXPR => Expr::TryExpr(TryExpr { syntax }),
3207 TUPLE_EXPR => Expr::TupleExpr(TupleExpr { syntax }),
3208 WHILE_EXPR => Expr::WhileExpr(WhileExpr { syntax }),
3199 _ => return None, 3209 _ => return None,
3200 }; 3210 };
3201 Some(res) 3211 Some(res)
3202 } 3212 }
3203 fn syntax(&self) -> &SyntaxNode { 3213 fn syntax(&self) -> &SyntaxNode {
3204 match self { 3214 match self {
3205 Expr::TupleExpr(it) => &it.syntax,
3206 Expr::ArrayExpr(it) => &it.syntax, 3215 Expr::ArrayExpr(it) => &it.syntax,
3207 Expr::ParenExpr(it) => &it.syntax, 3216 Expr::AwaitExpr(it) => &it.syntax,
3208 Expr::PathExpr(it) => &it.syntax, 3217 Expr::BinExpr(it) => &it.syntax,
3209 Expr::LambdaExpr(it) => &it.syntax,
3210 Expr::IfExpr(it) => &it.syntax,
3211 Expr::LoopExpr(it) => &it.syntax,
3212 Expr::ForExpr(it) => &it.syntax,
3213 Expr::WhileExpr(it) => &it.syntax,
3214 Expr::ContinueExpr(it) => &it.syntax,
3215 Expr::BreakExpr(it) => &it.syntax,
3216 Expr::Label(it) => &it.syntax,
3217 Expr::BlockExpr(it) => &it.syntax, 3218 Expr::BlockExpr(it) => &it.syntax,
3218 Expr::ReturnExpr(it) => &it.syntax, 3219 Expr::BoxExpr(it) => &it.syntax,
3219 Expr::MatchExpr(it) => &it.syntax, 3220 Expr::BreakExpr(it) => &it.syntax,
3220 Expr::RecordExpr(it) => &it.syntax,
3221 Expr::CallExpr(it) => &it.syntax, 3221 Expr::CallExpr(it) => &it.syntax,
3222 Expr::CastExpr(it) => &it.syntax,
3223 Expr::ContinueExpr(it) => &it.syntax,
3224 Expr::EffectExpr(it) => &it.syntax,
3225 Expr::FieldExpr(it) => &it.syntax,
3226 Expr::ForExpr(it) => &it.syntax,
3227 Expr::IfExpr(it) => &it.syntax,
3222 Expr::IndexExpr(it) => &it.syntax, 3228 Expr::IndexExpr(it) => &it.syntax,
3229 Expr::Label(it) => &it.syntax,
3230 Expr::LambdaExpr(it) => &it.syntax,
3231 Expr::Literal(it) => &it.syntax,
3232 Expr::LoopExpr(it) => &it.syntax,
3233 Expr::MacroCall(it) => &it.syntax,
3234 Expr::MatchExpr(it) => &it.syntax,
3223 Expr::MethodCallExpr(it) => &it.syntax, 3235 Expr::MethodCallExpr(it) => &it.syntax,
3224 Expr::FieldExpr(it) => &it.syntax, 3236 Expr::ParenExpr(it) => &it.syntax,
3225 Expr::AwaitExpr(it) => &it.syntax, 3237 Expr::PathExpr(it) => &it.syntax,
3226 Expr::TryExpr(it) => &it.syntax,
3227 Expr::EffectExpr(it) => &it.syntax,
3228 Expr::CastExpr(it) => &it.syntax,
3229 Expr::RefExpr(it) => &it.syntax,
3230 Expr::PrefixExpr(it) => &it.syntax, 3238 Expr::PrefixExpr(it) => &it.syntax,
3231 Expr::RangeExpr(it) => &it.syntax, 3239 Expr::RangeExpr(it) => &it.syntax,
3232 Expr::BinExpr(it) => &it.syntax, 3240 Expr::RecordExpr(it) => &it.syntax,
3233 Expr::Literal(it) => &it.syntax, 3241 Expr::RefExpr(it) => &it.syntax,
3234 Expr::MacroCall(it) => &it.syntax, 3242 Expr::ReturnExpr(it) => &it.syntax,
3235 Expr::BoxExpr(it) => &it.syntax, 3243 Expr::TryExpr(it) => &it.syntax,
3244 Expr::TupleExpr(it) => &it.syntax,
3245 Expr::WhileExpr(it) => &it.syntax,
3236 } 3246 }
3237 } 3247 }
3238} 3248}
3239impl From<Struct> for AdtDef {
3240 fn from(node: Struct) -> AdtDef { AdtDef::Struct(node) }
3241}
3242impl From<Enum> for AdtDef { 3249impl From<Enum> for AdtDef {
3243 fn from(node: Enum) -> AdtDef { AdtDef::Enum(node) } 3250 fn from(node: Enum) -> AdtDef { AdtDef::Enum(node) }
3244} 3251}
3252impl From<Struct> for AdtDef {
3253 fn from(node: Struct) -> AdtDef { AdtDef::Struct(node) }
3254}
3245impl From<Union> for AdtDef { 3255impl From<Union> for AdtDef {
3246 fn from(node: Union) -> AdtDef { AdtDef::Union(node) } 3256 fn from(node: Union) -> AdtDef { AdtDef::Union(node) }
3247} 3257}
3248impl AstNode for AdtDef { 3258impl AstNode for AdtDef {
3249 fn can_cast(kind: SyntaxKind) -> bool { 3259 fn can_cast(kind: SyntaxKind) -> bool {
3250 match kind { 3260 match kind {
3251 STRUCT | ENUM | UNION => true, 3261 ENUM | STRUCT | UNION => true,
3252 _ => false, 3262 _ => false,
3253 } 3263 }
3254 } 3264 }
3255 fn cast(syntax: SyntaxNode) -> Option<Self> { 3265 fn cast(syntax: SyntaxNode) -> Option<Self> {
3256 let res = match syntax.kind() { 3266 let res = match syntax.kind() {
3257 STRUCT => AdtDef::Struct(Struct { syntax }),
3258 ENUM => AdtDef::Enum(Enum { syntax }), 3267 ENUM => AdtDef::Enum(Enum { syntax }),
3268 STRUCT => AdtDef::Struct(Struct { syntax }),
3259 UNION => AdtDef::Union(Union { syntax }), 3269 UNION => AdtDef::Union(Union { syntax }),
3260 _ => return None, 3270 _ => return None,
3261 }; 3271 };
@@ -3263,47 +3273,47 @@ impl AstNode for AdtDef {
3263 } 3273 }
3264 fn syntax(&self) -> &SyntaxNode { 3274 fn syntax(&self) -> &SyntaxNode {
3265 match self { 3275 match self {
3266 AdtDef::Struct(it) => &it.syntax,
3267 AdtDef::Enum(it) => &it.syntax, 3276 AdtDef::Enum(it) => &it.syntax,
3277 AdtDef::Struct(it) => &it.syntax,
3268 AdtDef::Union(it) => &it.syntax, 3278 AdtDef::Union(it) => &it.syntax,
3269 } 3279 }
3270 } 3280 }
3271} 3281}
3272impl From<Fn> for AssocItem {
3273 fn from(node: Fn) -> AssocItem { AssocItem::Fn(node) }
3274}
3275impl From<TypeAlias> for AssocItem {
3276 fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) }
3277}
3278impl From<Const> for AssocItem { 3282impl From<Const> for AssocItem {
3279 fn from(node: Const) -> AssocItem { AssocItem::Const(node) } 3283 fn from(node: Const) -> AssocItem { AssocItem::Const(node) }
3280} 3284}
3285impl From<Fn> for AssocItem {
3286 fn from(node: Fn) -> AssocItem { AssocItem::Fn(node) }
3287}
3281impl From<MacroCall> for AssocItem { 3288impl From<MacroCall> for AssocItem {
3282 fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) } 3289 fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) }
3283} 3290}
3291impl From<TypeAlias> for AssocItem {
3292 fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) }
3293}
3284impl AstNode for AssocItem { 3294impl AstNode for AssocItem {
3285 fn can_cast(kind: SyntaxKind) -> bool { 3295 fn can_cast(kind: SyntaxKind) -> bool {
3286 match kind { 3296 match kind {
3287 FN | TYPE_ALIAS | CONST | MACRO_CALL => true, 3297 CONST | FN | MACRO_CALL | TYPE_ALIAS => true,
3288 _ => false, 3298 _ => false,
3289 } 3299 }
3290 } 3300 }
3291 fn cast(syntax: SyntaxNode) -> Option<Self> { 3301 fn cast(syntax: SyntaxNode) -> Option<Self> {
3292 let res = match syntax.kind() { 3302 let res = match syntax.kind() {
3293 FN => AssocItem::Fn(Fn { syntax }),
3294 TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }),
3295 CONST => AssocItem::Const(Const { syntax }), 3303 CONST => AssocItem::Const(Const { syntax }),
3304 FN => AssocItem::Fn(Fn { syntax }),
3296 MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), 3305 MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }),
3306 TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }),
3297 _ => return None, 3307 _ => return None,
3298 }; 3308 };
3299 Some(res) 3309 Some(res)
3300 } 3310 }
3301 fn syntax(&self) -> &SyntaxNode { 3311 fn syntax(&self) -> &SyntaxNode {
3302 match self { 3312 match self {
3303 AssocItem::Fn(it) => &it.syntax,
3304 AssocItem::TypeAlias(it) => &it.syntax,
3305 AssocItem::Const(it) => &it.syntax, 3313 AssocItem::Const(it) => &it.syntax,
3314 AssocItem::Fn(it) => &it.syntax,
3306 AssocItem::MacroCall(it) => &it.syntax, 3315 AssocItem::MacroCall(it) => &it.syntax,
3316 AssocItem::TypeAlias(it) => &it.syntax,
3307 } 3317 }
3308 } 3318 }
3309} 3319}
@@ -3340,48 +3350,48 @@ impl AstNode for ExternItem {
3340 } 3350 }
3341 } 3351 }
3342} 3352}
3353impl From<ConstParam> for GenericParam {
3354 fn from(node: ConstParam) -> GenericParam { GenericParam::ConstParam(node) }
3355}
3343impl From<LifetimeParam> for GenericParam { 3356impl From<LifetimeParam> for GenericParam {
3344 fn from(node: LifetimeParam) -> GenericParam { GenericParam::LifetimeParam(node) } 3357 fn from(node: LifetimeParam) -> GenericParam { GenericParam::LifetimeParam(node) }
3345} 3358}
3346impl From<TypeParam> for GenericParam { 3359impl From<TypeParam> for GenericParam {
3347 fn from(node: TypeParam) -> GenericParam { GenericParam::TypeParam(node) } 3360 fn from(node: TypeParam) -> GenericParam { GenericParam::TypeParam(node) }
3348} 3361}
3349impl From<ConstParam> for GenericParam {
3350 fn from(node: ConstParam) -> GenericParam { GenericParam::ConstParam(node) }
3351}
3352impl AstNode for GenericParam { 3362impl AstNode for GenericParam {
3353 fn can_cast(kind: SyntaxKind) -> bool { 3363 fn can_cast(kind: SyntaxKind) -> bool {
3354 match kind { 3364 match kind {
3355 LIFETIME_PARAM | TYPE_PARAM | CONST_PARAM => true, 3365 CONST_PARAM | LIFETIME_PARAM | TYPE_PARAM => true,
3356 _ => false, 3366 _ => false,
3357 } 3367 }
3358 } 3368 }
3359 fn cast(syntax: SyntaxNode) -> Option<Self> { 3369 fn cast(syntax: SyntaxNode) -> Option<Self> {
3360 let res = match syntax.kind() { 3370 let res = match syntax.kind() {
3371 CONST_PARAM => GenericParam::ConstParam(ConstParam { syntax }),
3361 LIFETIME_PARAM => GenericParam::LifetimeParam(LifetimeParam { syntax }), 3372 LIFETIME_PARAM => GenericParam::LifetimeParam(LifetimeParam { syntax }),
3362 TYPE_PARAM => GenericParam::TypeParam(TypeParam { syntax }), 3373 TYPE_PARAM => GenericParam::TypeParam(TypeParam { syntax }),
3363 CONST_PARAM => GenericParam::ConstParam(ConstParam { syntax }),
3364 _ => return None, 3374 _ => return None,
3365 }; 3375 };
3366 Some(res) 3376 Some(res)
3367 } 3377 }
3368 fn syntax(&self) -> &SyntaxNode { 3378 fn syntax(&self) -> &SyntaxNode {
3369 match self { 3379 match self {
3380 GenericParam::ConstParam(it) => &it.syntax,
3370 GenericParam::LifetimeParam(it) => &it.syntax, 3381 GenericParam::LifetimeParam(it) => &it.syntax,
3371 GenericParam::TypeParam(it) => &it.syntax, 3382 GenericParam::TypeParam(it) => &it.syntax,
3372 GenericParam::ConstParam(it) => &it.syntax,
3373 } 3383 }
3374 } 3384 }
3375} 3385}
3376impl From<LetStmt> for Stmt {
3377 fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) }
3378}
3379impl From<ExprStmt> for Stmt { 3386impl From<ExprStmt> for Stmt {
3380 fn from(node: ExprStmt) -> Stmt { Stmt::ExprStmt(node) } 3387 fn from(node: ExprStmt) -> Stmt { Stmt::ExprStmt(node) }
3381} 3388}
3382impl From<Item> for Stmt { 3389impl From<Item> for Stmt {
3383 fn from(node: Item) -> Stmt { Stmt::Item(node) } 3390 fn from(node: Item) -> Stmt { Stmt::Item(node) }
3384} 3391}
3392impl From<LetStmt> for Stmt {
3393 fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) }
3394}
3385impl std::fmt::Display for Item { 3395impl std::fmt::Display for Item {
3386 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3396 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3387 std::fmt::Display::fmt(self.syntax(), f) 3397 std::fmt::Display::fmt(self.syntax(), f)
@@ -3637,17 +3647,17 @@ impl std::fmt::Display for ExternItemList {
3637 std::fmt::Display::fmt(self.syntax(), f) 3647 std::fmt::Display::fmt(self.syntax(), f)
3638 } 3648 }
3639} 3649}
3640impl std::fmt::Display for LifetimeParam { 3650impl std::fmt::Display for ConstParam {
3641 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3651 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3642 std::fmt::Display::fmt(self.syntax(), f) 3652 std::fmt::Display::fmt(self.syntax(), f)
3643 } 3653 }
3644} 3654}
3645impl std::fmt::Display for TypeParam { 3655impl std::fmt::Display for LifetimeParam {
3646 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3656 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3647 std::fmt::Display::fmt(self.syntax(), f) 3657 std::fmt::Display::fmt(self.syntax(), f)
3648 } 3658 }
3649} 3659}
3650impl std::fmt::Display for ConstParam { 3660impl std::fmt::Display for TypeParam {
3651 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3661 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3652 std::fmt::Display::fmt(self.syntax(), f) 3662 std::fmt::Display::fmt(self.syntax(), f)
3653 } 3663 }
@@ -3667,162 +3677,162 @@ impl std::fmt::Display for TokenTree {
3667 std::fmt::Display::fmt(self.syntax(), f) 3677 std::fmt::Display::fmt(self.syntax(), f)
3668 } 3678 }
3669} 3679}
3670impl std::fmt::Display for LetStmt { 3680impl std::fmt::Display for ExprStmt {
3671 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3681 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3672 std::fmt::Display::fmt(self.syntax(), f) 3682 std::fmt::Display::fmt(self.syntax(), f)
3673 } 3683 }
3674} 3684}
3675impl std::fmt::Display for ExprStmt { 3685impl std::fmt::Display for LetStmt {
3676 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3686 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3677 std::fmt::Display::fmt(self.syntax(), f) 3687 std::fmt::Display::fmt(self.syntax(), f)
3678 } 3688 }
3679} 3689}
3680impl std::fmt::Display for ParenType { 3690impl std::fmt::Display for ArrayExpr {
3681 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3691 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3682 std::fmt::Display::fmt(self.syntax(), f) 3692 std::fmt::Display::fmt(self.syntax(), f)
3683 } 3693 }
3684} 3694}
3685impl std::fmt::Display for TupleType { 3695impl std::fmt::Display for AwaitExpr {
3686 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3696 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3687 std::fmt::Display::fmt(self.syntax(), f) 3697 std::fmt::Display::fmt(self.syntax(), f)
3688 } 3698 }
3689} 3699}
3690impl std::fmt::Display for NeverType { 3700impl std::fmt::Display for BinExpr {
3691 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3701 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3692 std::fmt::Display::fmt(self.syntax(), f) 3702 std::fmt::Display::fmt(self.syntax(), f)
3693 } 3703 }
3694} 3704}
3695impl std::fmt::Display for PathType { 3705impl std::fmt::Display for BoxExpr {
3696 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3706 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3697 std::fmt::Display::fmt(self.syntax(), f) 3707 std::fmt::Display::fmt(self.syntax(), f)
3698 } 3708 }
3699} 3709}
3700impl std::fmt::Display for PointerType { 3710impl std::fmt::Display for BreakExpr {
3701 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3711 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3702 std::fmt::Display::fmt(self.syntax(), f) 3712 std::fmt::Display::fmt(self.syntax(), f)
3703 } 3713 }
3704} 3714}
3705impl std::fmt::Display for ArrayType { 3715impl std::fmt::Display for CallExpr {
3706 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3716 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3707 std::fmt::Display::fmt(self.syntax(), f) 3717 std::fmt::Display::fmt(self.syntax(), f)
3708 } 3718 }
3709} 3719}
3710impl std::fmt::Display for SliceType { 3720impl std::fmt::Display for CastExpr {
3711 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3721 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3712 std::fmt::Display::fmt(self.syntax(), f) 3722 std::fmt::Display::fmt(self.syntax(), f)
3713 } 3723 }
3714} 3724}
3715impl std::fmt::Display for ReferenceType { 3725impl std::fmt::Display for ContinueExpr {
3716 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3726 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3717 std::fmt::Display::fmt(self.syntax(), f) 3727 std::fmt::Display::fmt(self.syntax(), f)
3718 } 3728 }
3719} 3729}
3720impl std::fmt::Display for InferType { 3730impl std::fmt::Display for EffectExpr {
3721 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3731 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3722 std::fmt::Display::fmt(self.syntax(), f) 3732 std::fmt::Display::fmt(self.syntax(), f)
3723 } 3733 }
3724} 3734}
3725impl std::fmt::Display for FnPointerType { 3735impl std::fmt::Display for FieldExpr {
3726 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3736 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3727 std::fmt::Display::fmt(self.syntax(), f) 3737 std::fmt::Display::fmt(self.syntax(), f)
3728 } 3738 }
3729} 3739}
3730impl std::fmt::Display for ForType { 3740impl std::fmt::Display for ForExpr {
3731 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3741 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3732 std::fmt::Display::fmt(self.syntax(), f) 3742 std::fmt::Display::fmt(self.syntax(), f)
3733 } 3743 }
3734} 3744}
3735impl std::fmt::Display for ImplTraitType { 3745impl std::fmt::Display for IfExpr {
3736 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3746 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3737 std::fmt::Display::fmt(self.syntax(), f) 3747 std::fmt::Display::fmt(self.syntax(), f)
3738 } 3748 }
3739} 3749}
3740impl std::fmt::Display for DynTraitType { 3750impl std::fmt::Display for IndexExpr {
3741 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3751 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3742 std::fmt::Display::fmt(self.syntax(), f) 3752 std::fmt::Display::fmt(self.syntax(), f)
3743 } 3753 }
3744} 3754}
3745impl std::fmt::Display for TypeBound { 3755impl std::fmt::Display for Label {
3746 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3756 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3747 std::fmt::Display::fmt(self.syntax(), f) 3757 std::fmt::Display::fmt(self.syntax(), f)
3748 } 3758 }
3749} 3759}
3750impl std::fmt::Display for TupleExpr { 3760impl std::fmt::Display for LambdaExpr {
3751 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3761 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3752 std::fmt::Display::fmt(self.syntax(), f) 3762 std::fmt::Display::fmt(self.syntax(), f)
3753 } 3763 }
3754} 3764}
3755impl std::fmt::Display for ArrayExpr { 3765impl std::fmt::Display for LoopExpr {
3756 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3766 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3757 std::fmt::Display::fmt(self.syntax(), f) 3767 std::fmt::Display::fmt(self.syntax(), f)
3758 } 3768 }
3759} 3769}
3760impl std::fmt::Display for ParenExpr { 3770impl std::fmt::Display for MatchExpr {
3761 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3771 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3762 std::fmt::Display::fmt(self.syntax(), f) 3772 std::fmt::Display::fmt(self.syntax(), f)
3763 } 3773 }
3764} 3774}
3765impl std::fmt::Display for PathExpr { 3775impl std::fmt::Display for MethodCallExpr {
3766 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3776 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3767 std::fmt::Display::fmt(self.syntax(), f) 3777 std::fmt::Display::fmt(self.syntax(), f)
3768 } 3778 }
3769} 3779}
3770impl std::fmt::Display for LambdaExpr { 3780impl std::fmt::Display for ParenExpr {
3771 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3781 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3772 std::fmt::Display::fmt(self.syntax(), f) 3782 std::fmt::Display::fmt(self.syntax(), f)
3773 } 3783 }
3774} 3784}
3775impl std::fmt::Display for IfExpr { 3785impl std::fmt::Display for PathExpr {
3776 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3786 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3777 std::fmt::Display::fmt(self.syntax(), f) 3787 std::fmt::Display::fmt(self.syntax(), f)
3778 } 3788 }
3779} 3789}
3780impl std::fmt::Display for Condition { 3790impl std::fmt::Display for PrefixExpr {
3781 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3791 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3782 std::fmt::Display::fmt(self.syntax(), f) 3792 std::fmt::Display::fmt(self.syntax(), f)
3783 } 3793 }
3784} 3794}
3785impl std::fmt::Display for EffectExpr { 3795impl std::fmt::Display for RangeExpr {
3786 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3796 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3787 std::fmt::Display::fmt(self.syntax(), f) 3797 std::fmt::Display::fmt(self.syntax(), f)
3788 } 3798 }
3789} 3799}
3790impl std::fmt::Display for Label { 3800impl std::fmt::Display for RecordExpr {
3791 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3801 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3792 std::fmt::Display::fmt(self.syntax(), f) 3802 std::fmt::Display::fmt(self.syntax(), f)
3793 } 3803 }
3794} 3804}
3795impl std::fmt::Display for LoopExpr { 3805impl std::fmt::Display for RefExpr {
3796 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3806 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3797 std::fmt::Display::fmt(self.syntax(), f) 3807 std::fmt::Display::fmt(self.syntax(), f)
3798 } 3808 }
3799} 3809}
3800impl std::fmt::Display for ForExpr { 3810impl std::fmt::Display for ReturnExpr {
3801 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3811 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3802 std::fmt::Display::fmt(self.syntax(), f) 3812 std::fmt::Display::fmt(self.syntax(), f)
3803 } 3813 }
3804} 3814}
3805impl std::fmt::Display for WhileExpr { 3815impl std::fmt::Display for TryExpr {
3806 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3816 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3807 std::fmt::Display::fmt(self.syntax(), f) 3817 std::fmt::Display::fmt(self.syntax(), f)
3808 } 3818 }
3809} 3819}
3810impl std::fmt::Display for ContinueExpr { 3820impl std::fmt::Display for TupleExpr {
3811 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3821 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3812 std::fmt::Display::fmt(self.syntax(), f) 3822 std::fmt::Display::fmt(self.syntax(), f)
3813 } 3823 }
3814} 3824}
3815impl std::fmt::Display for BreakExpr { 3825impl std::fmt::Display for WhileExpr {
3816 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3826 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3817 std::fmt::Display::fmt(self.syntax(), f) 3827 std::fmt::Display::fmt(self.syntax(), f)
3818 } 3828 }
3819} 3829}
3820impl std::fmt::Display for ReturnExpr { 3830impl std::fmt::Display for RecordExprFieldList {
3821 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3831 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3822 std::fmt::Display::fmt(self.syntax(), f) 3832 std::fmt::Display::fmt(self.syntax(), f)
3823 } 3833 }
3824} 3834}
3825impl std::fmt::Display for CallExpr { 3835impl std::fmt::Display for RecordExprField {
3826 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3836 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3827 std::fmt::Display::fmt(self.syntax(), f) 3837 std::fmt::Display::fmt(self.syntax(), f)
3828 } 3838 }
@@ -3832,97 +3842,97 @@ impl std::fmt::Display for ArgList {
3832 std::fmt::Display::fmt(self.syntax(), f) 3842 std::fmt::Display::fmt(self.syntax(), f)
3833 } 3843 }
3834} 3844}
3835impl std::fmt::Display for MethodCallExpr { 3845impl std::fmt::Display for TypeArgList {
3836 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3846 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3837 std::fmt::Display::fmt(self.syntax(), f) 3847 std::fmt::Display::fmt(self.syntax(), f)
3838 } 3848 }
3839} 3849}
3840impl std::fmt::Display for TypeArgList { 3850impl std::fmt::Display for Condition {
3841 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3851 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3842 std::fmt::Display::fmt(self.syntax(), f) 3852 std::fmt::Display::fmt(self.syntax(), f)
3843 } 3853 }
3844} 3854}
3845impl std::fmt::Display for FieldExpr { 3855impl std::fmt::Display for MatchArmList {
3846 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3856 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3847 std::fmt::Display::fmt(self.syntax(), f) 3857 std::fmt::Display::fmt(self.syntax(), f)
3848 } 3858 }
3849} 3859}
3850impl std::fmt::Display for IndexExpr { 3860impl std::fmt::Display for MatchArm {
3851 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3861 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3852 std::fmt::Display::fmt(self.syntax(), f) 3862 std::fmt::Display::fmt(self.syntax(), f)
3853 } 3863 }
3854} 3864}
3855impl std::fmt::Display for AwaitExpr { 3865impl std::fmt::Display for MatchGuard {
3856 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3866 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3857 std::fmt::Display::fmt(self.syntax(), f) 3867 std::fmt::Display::fmt(self.syntax(), f)
3858 } 3868 }
3859} 3869}
3860impl std::fmt::Display for TryExpr { 3870impl std::fmt::Display for ArrayType {
3861 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3871 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3862 std::fmt::Display::fmt(self.syntax(), f) 3872 std::fmt::Display::fmt(self.syntax(), f)
3863 } 3873 }
3864} 3874}
3865impl std::fmt::Display for CastExpr { 3875impl std::fmt::Display for DynTraitType {
3866 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3876 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3867 std::fmt::Display::fmt(self.syntax(), f) 3877 std::fmt::Display::fmt(self.syntax(), f)
3868 } 3878 }
3869} 3879}
3870impl std::fmt::Display for RefExpr { 3880impl std::fmt::Display for FnPointerType {
3871 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3881 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3872 std::fmt::Display::fmt(self.syntax(), f) 3882 std::fmt::Display::fmt(self.syntax(), f)
3873 } 3883 }
3874} 3884}
3875impl std::fmt::Display for PrefixExpr { 3885impl std::fmt::Display for ForType {
3876 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3886 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3877 std::fmt::Display::fmt(self.syntax(), f) 3887 std::fmt::Display::fmt(self.syntax(), f)
3878 } 3888 }
3879} 3889}
3880impl std::fmt::Display for BoxExpr { 3890impl std::fmt::Display for ImplTraitType {
3881 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3891 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3882 std::fmt::Display::fmt(self.syntax(), f) 3892 std::fmt::Display::fmt(self.syntax(), f)
3883 } 3893 }
3884} 3894}
3885impl std::fmt::Display for RangeExpr { 3895impl std::fmt::Display for InferType {
3886 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3896 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3887 std::fmt::Display::fmt(self.syntax(), f) 3897 std::fmt::Display::fmt(self.syntax(), f)
3888 } 3898 }
3889} 3899}
3890impl std::fmt::Display for BinExpr { 3900impl std::fmt::Display for NeverType {
3891 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3901 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3892 std::fmt::Display::fmt(self.syntax(), f) 3902 std::fmt::Display::fmt(self.syntax(), f)
3893 } 3903 }
3894} 3904}
3895impl std::fmt::Display for MatchExpr { 3905impl std::fmt::Display for ParenType {
3896 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3906 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3897 std::fmt::Display::fmt(self.syntax(), f) 3907 std::fmt::Display::fmt(self.syntax(), f)
3898 } 3908 }
3899} 3909}
3900impl std::fmt::Display for MatchArmList { 3910impl std::fmt::Display for PathType {
3901 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3911 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3902 std::fmt::Display::fmt(self.syntax(), f) 3912 std::fmt::Display::fmt(self.syntax(), f)
3903 } 3913 }
3904} 3914}
3905impl std::fmt::Display for MatchArm { 3915impl std::fmt::Display for PointerType {
3906 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3916 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3907 std::fmt::Display::fmt(self.syntax(), f) 3917 std::fmt::Display::fmt(self.syntax(), f)
3908 } 3918 }
3909} 3919}
3910impl std::fmt::Display for MatchGuard { 3920impl std::fmt::Display for ReferenceType {
3911 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3921 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3912 std::fmt::Display::fmt(self.syntax(), f) 3922 std::fmt::Display::fmt(self.syntax(), f)
3913 } 3923 }
3914} 3924}
3915impl std::fmt::Display for RecordExpr { 3925impl std::fmt::Display for SliceType {
3916 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3926 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3917 std::fmt::Display::fmt(self.syntax(), f) 3927 std::fmt::Display::fmt(self.syntax(), f)
3918 } 3928 }
3919} 3929}
3920impl std::fmt::Display for RecordExprFieldList { 3930impl std::fmt::Display for TupleType {
3921 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3931 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3922 std::fmt::Display::fmt(self.syntax(), f) 3932 std::fmt::Display::fmt(self.syntax(), f)
3923 } 3933 }
3924} 3934}
3925impl std::fmt::Display for RecordExprField { 3935impl std::fmt::Display for TypeBound {
3926 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3936 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3927 std::fmt::Display::fmt(self.syntax(), f) 3937 std::fmt::Display::fmt(self.syntax(), f)
3928 } 3938 }