@@ -7,7 +7,6 @@ pub use crate::util::parser::ExprPrecedence;
77
88use  crate :: ext:: hygiene:: ExpnId ; 
99use  crate :: parse:: token:: { self ,  DelimToken } ; 
10- use  crate :: print:: pprust; 
1110use  crate :: ptr:: P ; 
1211use  crate :: source_map:: { dummy_spanned,  respan,  Spanned } ; 
1312use  crate :: symbol:: { kw,  sym,  Symbol } ; 
@@ -70,7 +69,7 @@ impl fmt::Display for Lifetime {
7069/// along with a bunch of supporting information. 
7170/// 
7271/// E.g., `std::cmp::PartialEq`. 
73- #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ) ]  
72+ #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ,   Debug ) ]  
7473pub  struct  Path  { 
7574    pub  span :  Span , 
7675    /// The segments in the path: the things separated by `::`. 
@@ -86,18 +85,6 @@ impl PartialEq<Symbol> for Path {
8685    } 
8786} 
8887
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- 
10188impl  Path  { 
10289    // Convert a span and an identifier to the corresponding 
10390    // one-segment path. 
@@ -507,19 +494,13 @@ pub struct Block {
507494    pub  span :  Span , 
508495} 
509496
510- #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ) ]  
497+ #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ,   Debug ) ]  
511498pub  struct  Pat  { 
512499    pub  id :  NodeId , 
513500    pub  kind :  PatKind , 
514501    pub  span :  Span , 
515502} 
516503
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- 
523504impl  Pat  { 
524505    /// Attempt reparsing the pattern as a type. 
525506/// This is intended for use by diagnostics. 
@@ -831,7 +812,7 @@ impl UnOp {
831812} 
832813
833814/// A statement 
834- #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ) ]  
815+ #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ,   Debug ) ]  
835816pub  struct  Stmt  { 
836817    pub  id :  NodeId , 
837818    pub  kind :  StmtKind , 
@@ -865,18 +846,7 @@ impl Stmt {
865846    } 
866847} 
867848
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 ) ]  
880850pub  enum  StmtKind  { 
881851    /// A local (let) binding. 
882852Local ( P < Local > ) , 
@@ -973,7 +943,7 @@ pub struct AnonConst {
973943} 
974944
975945/// An expression. 
976- #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ) ]  
946+ #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ,   Debug ) ]  
977947pub  struct  Expr  { 
978948    pub  id :  NodeId , 
979949    pub  kind :  ExprKind , 
@@ -1100,12 +1070,6 @@ impl Expr {
11001070    } 
11011071} 
11021072
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- 
11091073/// Limit types of a range (inclusive or exclusive) 
11101074#[ derive( Copy ,  Clone ,  PartialEq ,  RustcEncodable ,  RustcDecodable ,  Debug ) ]  
11111075pub  enum  RangeLimits  { 
@@ -1660,19 +1624,13 @@ pub enum AssocTyConstraintKind {
16601624    } , 
16611625} 
16621626
1663- #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ) ]  
1627+ #[ derive( Clone ,  RustcEncodable ,  RustcDecodable ,   Debug ) ]  
16641628pub  struct  Ty  { 
16651629    pub  id :  NodeId , 
16661630    pub  kind :  TyKind , 
16671631    pub  span :  Span , 
16681632} 
16691633
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- 
16761634#[ derive( Clone ,  RustcEncodable ,  RustcDecodable ,  Debug ) ]  
16771635pub  struct  BareFnTy  { 
16781636    pub  unsafety :  Unsafety , 
0 commit comments