@@ -32,7 +32,7 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic};
3232pub use rustc_span:: AttrId ;
3333use rustc_span:: source_map:: { Spanned , respan} ;
3434use rustc_span:: symbol:: { Ident , Symbol , kw, sym} ;
35- use rustc_span:: { DUMMY_SP , ErrorGuaranteed , Span } ;
35+ use rustc_span:: { ErrorGuaranteed , Span } ;
3636use thin_vec:: { ThinVec , thin_vec} ;
3737
3838pub use crate :: format:: * ;
@@ -388,22 +388,15 @@ impl GenericParam {
388388
389389/// Represents lifetime, type and const parameters attached to a declaration of
390390/// a function, enum, trait, etc.
391- #[ derive( Clone , Encodable , Decodable , Debug ) ]
391+ #[ derive( Clone , Encodable , Decodable , Debug , Default ) ]
392392pub struct Generics {
393393 pub params : ThinVec < GenericParam > ,
394394 pub where_clause : WhereClause ,
395395 pub span : Span ,
396396}
397397
398- impl Default for Generics {
399- /// Creates an instance of `Generics`.
400- fn default ( ) -> Generics {
401- Generics { params : ThinVec :: new ( ) , where_clause : Default :: default ( ) , span : DUMMY_SP }
402- }
403- }
404-
405398/// A where-clause in a definition.
406- #[ derive( Clone , Encodable , Decodable , Debug ) ]
399+ #[ derive( Clone , Encodable , Decodable , Debug , Default ) ]
407400pub struct WhereClause {
408401 /// `true` if we ate a `where` token.
409402 ///
@@ -420,12 +413,6 @@ impl WhereClause {
420413 }
421414}
422415
423- impl Default for WhereClause {
424- fn default ( ) -> WhereClause {
425- WhereClause { has_where_token : false , predicates : ThinVec :: new ( ) , span : DUMMY_SP }
426- }
427- }
428-
429416/// A single predicate in a where-clause.
430417#[ derive( Clone , Encodable , Decodable , Debug ) ]
431418pub struct WherePredicate {
0 commit comments