]> git.lizzy.rs Git - rust.git/commitdiff
implementing Display for enums too.
authorFireassember <ariel.f2002@gmail.com>
Wed, 11 Mar 2020 20:54:24 +0000 (22:54 +0200)
committerFireassember <ariel.f2002@gmail.com>
Wed, 11 Mar 2020 20:54:24 +0000 (22:54 +0200)
crates/ra_syntax/src/ast/generated.rs
xtask/src/codegen/gen_syntax.rs

index 150893e393e1c99e20a349dc80300ad6cd301d90..002f453cd26c0c08ad032d6c58da19fad6b9e578 100644 (file)
@@ -9,6 +9,11 @@
 pub struct SourceFile {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for SourceFile {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for SourceFile {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -38,6 +43,11 @@ pub fn modules(&self) -> AstChildren<Module> {
 pub struct FnDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for FnDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for FnDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -76,6 +86,11 @@ pub fn body(&self) -> Option<BlockExpr> {
 pub struct RetType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RetType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RetType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -103,6 +118,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct StructDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for StructDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for StructDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -131,6 +151,11 @@ impl StructDef {}
 pub struct UnionDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for UnionDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for UnionDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -163,6 +188,11 @@ pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> {
 pub struct RecordFieldDefList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RecordFieldDefList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RecordFieldDefList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -190,6 +220,11 @@ pub fn fields(&self) -> AstChildren<RecordFieldDef> {
 pub struct RecordFieldDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RecordFieldDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RecordFieldDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -218,6 +253,11 @@ impl RecordFieldDef {}
 pub struct TupleFieldDefList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TupleFieldDefList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TupleFieldDefList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -245,6 +285,11 @@ pub fn fields(&self) -> AstChildren<TupleFieldDef> {
 pub struct TupleFieldDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TupleFieldDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TupleFieldDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -274,6 +319,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct EnumDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for EnumDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for EnumDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -306,6 +356,11 @@ pub fn variant_list(&self) -> Option<EnumVariantList> {
 pub struct EnumVariantList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for EnumVariantList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for EnumVariantList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -333,6 +388,11 @@ pub fn variants(&self) -> AstChildren<EnumVariant> {
 pub struct EnumVariant {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for EnumVariant {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for EnumVariant {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -363,6 +423,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct TraitDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TraitDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TraitDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -396,6 +461,11 @@ pub fn item_list(&self) -> Option<ItemList> {
 pub struct Module {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Module {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Module {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -427,6 +497,11 @@ pub fn item_list(&self) -> Option<ItemList> {
 pub struct ItemList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ItemList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ItemList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -456,6 +531,11 @@ pub fn impl_items(&self) -> AstChildren<ImplItem> {
 pub struct ConstDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ConstDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ConstDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -489,6 +569,11 @@ pub fn body(&self) -> Option<Expr> {
 pub struct StaticDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for StaticDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for StaticDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -522,6 +607,11 @@ pub fn body(&self) -> Option<Expr> {
 pub struct TypeAliasDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TypeAliasDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TypeAliasDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -555,6 +645,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct ImplDef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ImplDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ImplDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -584,6 +679,11 @@ pub fn item_list(&self) -> Option<ItemList> {
 pub struct ParenType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ParenType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ParenType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -611,6 +711,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct TupleType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TupleType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TupleType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -638,6 +743,11 @@ pub fn fields(&self) -> AstChildren<TypeRef> {
 pub struct NeverType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for NeverType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for NeverType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -661,6 +771,11 @@ impl NeverType {}
 pub struct PathType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for PathType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for PathType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -688,6 +803,11 @@ pub fn path(&self) -> Option<Path> {
 pub struct PointerType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for PointerType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for PointerType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -715,6 +835,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct ArrayType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ArrayType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ArrayType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -745,6 +870,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct SliceType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for SliceType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for SliceType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -772,6 +902,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct ReferenceType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ReferenceType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ReferenceType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -799,6 +934,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct PlaceholderType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for PlaceholderType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for PlaceholderType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -822,6 +962,11 @@ impl PlaceholderType {}
 pub struct FnPointerType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for FnPointerType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for FnPointerType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -852,6 +997,11 @@ pub fn ret_type(&self) -> Option<RetType> {
 pub struct ForType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ForType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ForType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -879,6 +1029,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct ImplTraitType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ImplTraitType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ImplTraitType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -903,6 +1058,11 @@ impl ImplTraitType {}
 pub struct DynTraitType {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for DynTraitType {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for DynTraitType {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -927,6 +1087,11 @@ impl DynTraitType {}
 pub struct TupleExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TupleExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TupleExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -954,6 +1119,11 @@ pub fn exprs(&self) -> AstChildren<Expr> {
 pub struct ArrayExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ArrayExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ArrayExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -981,6 +1151,11 @@ pub fn exprs(&self) -> AstChildren<Expr> {
 pub struct ParenExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ParenExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ParenExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1008,6 +1183,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct PathExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for PathExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for PathExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1035,6 +1215,11 @@ pub fn path(&self) -> Option<Path> {
 pub struct LambdaExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for LambdaExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for LambdaExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1068,6 +1253,11 @@ pub fn body(&self) -> Option<Expr> {
 pub struct IfExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for IfExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for IfExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1095,6 +1285,11 @@ pub fn condition(&self) -> Option<Condition> {
 pub struct LoopExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for LoopExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for LoopExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1119,6 +1314,11 @@ impl LoopExpr {}
 pub struct TryBlockExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TryBlockExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TryBlockExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1146,6 +1346,11 @@ pub fn body(&self) -> Option<BlockExpr> {
 pub struct ForExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ForExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ForExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1177,6 +1382,11 @@ pub fn iterable(&self) -> Option<Expr> {
 pub struct WhileExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for WhileExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for WhileExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1205,6 +1415,11 @@ pub fn condition(&self) -> Option<Condition> {
 pub struct ContinueExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ContinueExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ContinueExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1228,6 +1443,11 @@ impl ContinueExpr {}
 pub struct BreakExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for BreakExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for BreakExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1255,6 +1475,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct Label {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Label {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Label {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1278,6 +1503,11 @@ impl Label {}
 pub struct BlockExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for BlockExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for BlockExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1305,6 +1535,11 @@ pub fn block(&self) -> Option<Block> {
 pub struct ReturnExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ReturnExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ReturnExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1332,6 +1567,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct CallExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for CallExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for CallExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1360,6 +1600,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct MethodCallExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for MethodCallExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for MethodCallExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1394,6 +1639,11 @@ pub fn type_arg_list(&self) -> Option<TypeArgList> {
 pub struct IndexExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for IndexExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for IndexExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1417,6 +1667,11 @@ impl IndexExpr {}
 pub struct FieldExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for FieldExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for FieldExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1447,6 +1702,11 @@ pub fn name_ref(&self) -> Option<NameRef> {
 pub struct AwaitExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for AwaitExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for AwaitExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1474,6 +1734,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct TryExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TryExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TryExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1501,6 +1766,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct CastExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for CastExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for CastExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1531,6 +1801,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct RefExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RefExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RefExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1558,6 +1833,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct PrefixExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for PrefixExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for PrefixExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1585,6 +1865,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct BoxExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for BoxExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for BoxExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1612,6 +1897,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct RangeExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RangeExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RangeExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1635,6 +1925,11 @@ impl RangeExpr {}
 pub struct BinExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for BinExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for BinExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1658,6 +1953,11 @@ impl BinExpr {}
 pub struct Literal {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Literal {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Literal {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1681,6 +1981,11 @@ impl Literal {}
 pub struct MatchExpr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for MatchExpr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for MatchExpr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1711,6 +2016,11 @@ pub fn match_arm_list(&self) -> Option<MatchArmList> {
 pub struct MatchArmList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for MatchArmList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for MatchArmList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1739,6 +2049,11 @@ pub fn arms(&self) -> AstChildren<MatchArm> {
 pub struct MatchArm {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for MatchArm {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for MatchArm {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1773,6 +2088,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct MatchGuard {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for MatchGuard {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for MatchGuard {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1800,6 +2120,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct RecordLit {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RecordLit {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RecordLit {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1830,6 +2155,11 @@ pub fn record_field_list(&self) -> Option<RecordFieldList> {
 pub struct RecordFieldList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RecordFieldList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RecordFieldList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1860,6 +2190,11 @@ pub fn spread(&self) -> Option<Expr> {
 pub struct RecordField {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RecordField {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RecordField {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1890,6 +2225,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct OrPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for OrPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for OrPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1917,6 +2257,11 @@ pub fn pats(&self) -> AstChildren<Pat> {
 pub struct ParenPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ParenPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ParenPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1944,6 +2289,11 @@ pub fn pat(&self) -> Option<Pat> {
 pub struct RefPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RefPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RefPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1971,6 +2321,11 @@ pub fn pat(&self) -> Option<Pat> {
 pub struct BoxPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for BoxPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for BoxPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -1998,6 +2353,11 @@ pub fn pat(&self) -> Option<Pat> {
 pub struct BindPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for BindPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for BindPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2026,6 +2386,11 @@ pub fn pat(&self) -> Option<Pat> {
 pub struct PlaceholderPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for PlaceholderPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for PlaceholderPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2049,6 +2414,11 @@ impl PlaceholderPat {}
 pub struct DotDotPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for DotDotPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for DotDotPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2072,6 +2442,11 @@ impl DotDotPat {}
 pub struct PathPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for PathPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for PathPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2099,6 +2474,11 @@ pub fn path(&self) -> Option<Path> {
 pub struct SlicePat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for SlicePat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for SlicePat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2126,6 +2506,11 @@ pub fn args(&self) -> AstChildren<Pat> {
 pub struct RangePat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RangePat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RangePat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2149,6 +2534,11 @@ impl RangePat {}
 pub struct LiteralPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for LiteralPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for LiteralPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2176,6 +2566,11 @@ pub fn literal(&self) -> Option<Literal> {
 pub struct RecordPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RecordPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RecordPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2206,6 +2601,11 @@ pub fn path(&self) -> Option<Path> {
 pub struct RecordFieldPatList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RecordFieldPatList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RecordFieldPatList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2236,6 +2636,11 @@ pub fn bind_pats(&self) -> AstChildren<BindPat> {
 pub struct RecordFieldPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for RecordFieldPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for RecordFieldPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2264,6 +2669,11 @@ pub fn pat(&self) -> Option<Pat> {
 pub struct TupleStructPat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TupleStructPat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TupleStructPat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2294,6 +2704,11 @@ pub fn args(&self) -> AstChildren<Pat> {
 pub struct TuplePat {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TuplePat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TuplePat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2321,6 +2736,11 @@ pub fn args(&self) -> AstChildren<Pat> {
 pub struct Visibility {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Visibility {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Visibility {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2344,6 +2764,11 @@ impl Visibility {}
 pub struct Name {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Name {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Name {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2367,6 +2792,11 @@ impl Name {}
 pub struct NameRef {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for NameRef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for NameRef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2390,6 +2820,11 @@ impl NameRef {}
 pub struct MacroCall {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for MacroCall {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for MacroCall {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2423,6 +2858,11 @@ pub fn path(&self) -> Option<Path> {
 pub struct Attr {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Attr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Attr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2453,6 +2893,11 @@ pub fn input(&self) -> Option<AttrInput> {
 pub struct TokenTree {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TokenTree {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TokenTree {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2476,6 +2921,11 @@ impl TokenTree {}
 pub struct TypeParamList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TypeParamList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TypeParamList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2506,6 +2956,11 @@ pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> {
 pub struct TypeParam {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TypeParam {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TypeParam {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2536,6 +2991,11 @@ pub fn default_type(&self) -> Option<TypeRef> {
 pub struct ConstParam {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ConstParam {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ConstParam {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2566,6 +3026,11 @@ pub fn default_val(&self) -> Option<Expr> {
 pub struct LifetimeParam {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for LifetimeParam {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for LifetimeParam {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2590,6 +3055,11 @@ impl LifetimeParam {}
 pub struct TypeBound {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TypeBound {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TypeBound {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2617,6 +3087,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct TypeBoundList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TypeBoundList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TypeBoundList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2644,6 +3119,11 @@ pub fn bounds(&self) -> AstChildren<TypeBound> {
 pub struct WherePred {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for WherePred {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for WherePred {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2672,6 +3152,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct WhereClause {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for WhereClause {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for WhereClause {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2699,6 +3184,11 @@ pub fn predicates(&self) -> AstChildren<WherePred> {
 pub struct ExprStmt {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ExprStmt {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ExprStmt {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2726,6 +3216,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct LetStmt {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for LetStmt {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for LetStmt {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2757,6 +3252,11 @@ pub fn initializer(&self) -> Option<Expr> {
 pub struct Condition {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Condition {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Condition {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2787,6 +3287,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct Block {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Block {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Block {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2819,6 +3324,11 @@ pub fn expr(&self) -> Option<Expr> {
 pub struct ParamList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ParamList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ParamList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2849,6 +3359,11 @@ pub fn params(&self) -> AstChildren<Param> {
 pub struct SelfParam {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for SelfParam {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for SelfParam {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2874,6 +3389,11 @@ impl SelfParam {}
 pub struct Param {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Param {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Param {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2903,6 +3423,11 @@ pub fn pat(&self) -> Option<Pat> {
 pub struct UseItem {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for UseItem {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for UseItem {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2932,6 +3457,11 @@ pub fn use_tree(&self) -> Option<UseTree> {
 pub struct UseTree {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for UseTree {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for UseTree {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2965,6 +3495,11 @@ pub fn alias(&self) -> Option<Alias> {
 pub struct Alias {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Alias {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Alias {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -2989,6 +3524,11 @@ impl Alias {}
 pub struct UseTreeList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for UseTreeList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for UseTreeList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3016,6 +3556,11 @@ pub fn use_trees(&self) -> AstChildren<UseTree> {
 pub struct ExternCrateItem {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ExternCrateItem {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ExternCrateItem {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3048,6 +3593,11 @@ pub fn alias(&self) -> Option<Alias> {
 pub struct ArgList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ArgList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ArgList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3075,6 +3625,11 @@ pub fn args(&self) -> AstChildren<Expr> {
 pub struct Path {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for Path {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Path {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3105,6 +3660,11 @@ pub fn qualifier(&self) -> Option<Path> {
 pub struct PathSegment {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for PathSegment {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for PathSegment {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3144,6 +3704,11 @@ pub fn path_type(&self) -> Option<PathType> {
 pub struct TypeArgList {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TypeArgList {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TypeArgList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3180,6 +3745,11 @@ pub fn const_arg(&self) -> AstChildren<ConstArg> {
 pub struct TypeArg {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for TypeArg {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TypeArg {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3207,6 +3777,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct AssocTypeArg {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for AssocTypeArg {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for AssocTypeArg {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3237,6 +3812,11 @@ pub fn type_ref(&self) -> Option<TypeRef> {
 pub struct LifetimeArg {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for LifetimeArg {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for LifetimeArg {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3260,6 +3840,11 @@ impl LifetimeArg {}
 pub struct ConstArg {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for ConstArg {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ConstArg {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3290,6 +3875,11 @@ pub fn block_expr(&self) -> Option<BlockExpr> {
 pub struct MacroItems {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for MacroItems {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for MacroItems {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3315,6 +3905,11 @@ impl MacroItems {}
 pub struct MacroStmts {
     pub(crate) syntax: SyntaxNode,
 }
+impl std::fmt::Display for MacroStmts {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for MacroStmts {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3362,6 +3957,11 @@ fn from(node: UnionDef) -> NominalDef {
         NominalDef::UnionDef(node)
     }
 }
+impl std::fmt::Display for NominalDef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for NominalDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3470,6 +4070,11 @@ fn from(node: DynTraitType) -> TypeRef {
         TypeRef::DynTraitType(node)
     }
 }
+impl std::fmt::Display for TypeRef {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for TypeRef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3591,6 +4196,11 @@ fn from(node: Module) -> ModuleItem {
         ModuleItem::Module(node)
     }
 }
+impl std::fmt::Display for ModuleItem {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ModuleItem {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3657,6 +4267,11 @@ fn from(node: ConstDef) -> ImplItem {
         ImplItem::ConstDef(node)
     }
 }
+impl std::fmt::Display for ImplItem {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for ImplItem {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -3871,6 +4486,11 @@ fn from(node: BoxExpr) -> Expr {
         Expr::BoxExpr(node)
     }
 }
+impl std::fmt::Display for Expr {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Expr {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -4043,6 +4663,11 @@ fn from(node: LiteralPat) -> Pat {
         Pat::LiteralPat(node)
     }
 }
+impl std::fmt::Display for Pat {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Pat {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -4106,6 +4731,11 @@ fn from(node: TokenTree) -> AttrInput {
         AttrInput::TokenTree(node)
     }
 }
+impl std::fmt::Display for AttrInput {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for AttrInput {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
@@ -4143,6 +4773,11 @@ fn from(node: LetStmt) -> Stmt {
         Stmt::LetStmt(node)
     }
 }
+impl std::fmt::Display for Stmt {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl AstNode for Stmt {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
index 879f0243ed2e64a219d9668c2e327f98c6d3f201..32afd47bc3245a24a957be89cc702557d682eb74 100644 (file)
@@ -69,8 +69,8 @@ pub struct #name {
             }
 
             impl std::fmt::Display for #name {
-                fn fmt(..) -> std::fmt::Result {
-                    std::fmt::Display::fmt(self.syntax())
+                fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+                    std::fmt::Display::fmt(self.syntax(), f)
                 }
             }
 
@@ -120,6 +120,12 @@ fn from(node: #variants) -> #name {
             }
             )*
 
+            impl std::fmt::Display for #name {
+                fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+                    std::fmt::Display::fmt(self.syntax(), f)
+                }
+            }
+
             impl AstNode for #name {
                 fn can_cast(kind: SyntaxKind) -> bool {
                     match kind {