@@ -70,7 +70,7 @@ impl fmt::Display for Lifetime {
70
70
/// along with a bunch of supporting information.
71
71
///
72
72
/// E.g., `std::cmp::PartialEq`.
73
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
73
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
74
74
pub struct Path {
75
75
pub span : Span ,
76
76
/// The segments in the path: the things separated by `::`.
@@ -86,12 +86,6 @@ impl PartialEq<Symbol> for Path {
86
86
}
87
87
}
88
88
89
- impl fmt:: Debug for Path {
90
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
91
- write ! ( f, "path({})" , pprust:: path_to_string( self ) )
92
- }
93
- }
94
-
95
89
impl fmt:: Display for Path {
96
90
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
97
91
write ! ( f, "{}" , pprust:: path_to_string( self ) )
@@ -507,19 +501,13 @@ pub struct Block {
507
501
pub span : Span ,
508
502
}
509
503
510
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
504
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
511
505
pub struct Pat {
512
506
pub id : NodeId ,
513
507
pub kind : PatKind ,
514
508
pub span : Span ,
515
509
}
516
510
517
- impl fmt:: Debug for Pat {
518
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
519
- write ! ( f, "pat({}: {})" , self . id, pprust:: pat_to_string( self ) )
520
- }
521
- }
522
-
523
511
impl Pat {
524
512
/// Attempt reparsing the pattern as a type.
525
513
/// This is intended for use by diagnostics.
@@ -831,7 +819,7 @@ impl UnOp {
831
819
}
832
820
833
821
/// A statement
834
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
822
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
835
823
pub struct Stmt {
836
824
pub id : NodeId ,
837
825
pub kind : StmtKind ,
@@ -865,18 +853,7 @@ impl Stmt {
865
853
}
866
854
}
867
855
868
- impl fmt:: Debug for Stmt {
869
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
870
- write ! (
871
- f,
872
- "stmt({}: {})" ,
873
- self . id. to_string( ) ,
874
- pprust:: stmt_to_string( self )
875
- )
876
- }
877
- }
878
-
879
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
856
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
880
857
pub enum StmtKind {
881
858
/// A local (let) binding.
882
859
Local ( P < Local > ) ,
@@ -973,7 +950,7 @@ pub struct AnonConst {
973
950
}
974
951
975
952
/// An expression.
976
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
953
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
977
954
pub struct Expr {
978
955
pub id : NodeId ,
979
956
pub kind : ExprKind ,
@@ -1100,12 +1077,6 @@ impl Expr {
1100
1077
}
1101
1078
}
1102
1079
1103
- impl fmt:: Debug for Expr {
1104
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1105
- write ! ( f, "expr({}: {})" , self . id, pprust:: expr_to_string( self ) )
1106
- }
1107
- }
1108
-
1109
1080
/// Limit types of a range (inclusive or exclusive)
1110
1081
#[ derive( Copy , Clone , PartialEq , RustcEncodable , RustcDecodable , Debug ) ]
1111
1082
pub enum RangeLimits {
@@ -1660,19 +1631,13 @@ pub enum AssocTyConstraintKind {
1660
1631
} ,
1661
1632
}
1662
1633
1663
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
1634
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
1664
1635
pub struct Ty {
1665
1636
pub id : NodeId ,
1666
1637
pub kind : TyKind ,
1667
1638
pub span : Span ,
1668
1639
}
1669
1640
1670
- impl fmt:: Debug for Ty {
1671
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1672
- write ! ( f, "type({})" , pprust:: ty_to_string( self ) )
1673
- }
1674
- }
1675
-
1676
1641
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
1677
1642
pub struct BareFnTy {
1678
1643
pub unsafety : Unsafety ,
0 commit comments