@@ -7,7 +7,6 @@ pub use crate::util::parser::ExprPrecedence;
7
7
8
8
use crate :: ext:: hygiene:: ExpnId ;
9
9
use crate :: parse:: token:: { self , DelimToken } ;
10
- use crate :: print:: pprust;
11
10
use crate :: ptr:: P ;
12
11
use crate :: source_map:: { dummy_spanned, respan, Spanned } ;
13
12
use crate :: symbol:: { kw, sym, Symbol } ;
@@ -70,7 +69,7 @@ impl fmt::Display for Lifetime {
70
69
/// along with a bunch of supporting information.
71
70
///
72
71
/// E.g., `std::cmp::PartialEq`.
73
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
72
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
74
73
pub struct Path {
75
74
pub span : Span ,
76
75
/// The segments in the path: the things separated by `::`.
@@ -86,18 +85,6 @@ impl PartialEq<Symbol> for Path {
86
85
}
87
86
}
88
87
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
- impl fmt:: Display for Path {
96
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
97
- write ! ( f, "{}" , pprust:: path_to_string( self ) )
98
- }
99
- }
100
-
101
88
impl Path {
102
89
// Convert a span and an identifier to the corresponding
103
90
// one-segment path.
@@ -507,19 +494,13 @@ pub struct Block {
507
494
pub span : Span ,
508
495
}
509
496
510
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
497
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
511
498
pub struct Pat {
512
499
pub id : NodeId ,
513
500
pub kind : PatKind ,
514
501
pub span : Span ,
515
502
}
516
503
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
504
impl Pat {
524
505
/// Attempt reparsing the pattern as a type.
525
506
/// This is intended for use by diagnostics.
@@ -831,7 +812,7 @@ impl UnOp {
831
812
}
832
813
833
814
/// A statement
834
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
815
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
835
816
pub struct Stmt {
836
817
pub id : NodeId ,
837
818
pub kind : StmtKind ,
@@ -865,18 +846,7 @@ impl Stmt {
865
846
}
866
847
}
867
848
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 ) ]
849
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
880
850
pub enum StmtKind {
881
851
/// A local (let) binding.
882
852
Local ( P < Local > ) ,
@@ -973,7 +943,7 @@ pub struct AnonConst {
973
943
}
974
944
975
945
/// An expression.
976
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
946
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
977
947
pub struct Expr {
978
948
pub id : NodeId ,
979
949
pub kind : ExprKind ,
@@ -1100,12 +1070,6 @@ impl Expr {
1100
1070
}
1101
1071
}
1102
1072
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
1073
/// Limit types of a range (inclusive or exclusive)
1110
1074
#[ derive( Copy , Clone , PartialEq , RustcEncodable , RustcDecodable , Debug ) ]
1111
1075
pub enum RangeLimits {
@@ -1660,19 +1624,13 @@ pub enum AssocTyConstraintKind {
1660
1624
} ,
1661
1625
}
1662
1626
1663
- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
1627
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
1664
1628
pub struct Ty {
1665
1629
pub id : NodeId ,
1666
1630
pub kind : TyKind ,
1667
1631
pub span : Span ,
1668
1632
}
1669
1633
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
1634
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
1677
1635
pub struct BareFnTy {
1678
1636
pub unsafety : Unsafety ,
0 commit comments