@@ -31,7 +31,7 @@ use rustc_data_structures::sync::Lrc;
3131use rustc_macros:: { Decodable , Encodable , HashStable_Generic } ;
3232pub use rustc_span:: AttrId ;
3333use rustc_span:: source_map:: { Spanned , respan} ;
34- use rustc_span:: { DUMMY_SP , ErrorGuaranteed , Ident , Span , Symbol , kw, sym} ;
34+ use rustc_span:: { ErrorGuaranteed , Ident , Span , Symbol , kw, sym} ;
3535use thin_vec:: { ThinVec , thin_vec} ;
3636
3737pub use crate :: format:: * ;
@@ -387,22 +387,15 @@ impl GenericParam {
387387
388388/// Represents lifetime, type and const parameters attached to a declaration of
389389/// a function, enum, trait, etc.
390- #[ derive( Clone , Encodable , Decodable , Debug ) ]
390+ #[ derive( Clone , Encodable , Decodable , Debug , Default ) ]
391391pub struct Generics {
392392 pub params : ThinVec < GenericParam > ,
393393 pub where_clause : WhereClause ,
394394 pub span : Span ,
395395}
396396
397- impl Default for Generics {
398- /// Creates an instance of `Generics`.
399- fn default ( ) -> Generics {
400- Generics { params : ThinVec :: new ( ) , where_clause : Default :: default ( ) , span : DUMMY_SP }
401- }
402- }
403-
404397/// A where-clause in a definition.
405- #[ derive( Clone , Encodable , Decodable , Debug ) ]
398+ #[ derive( Clone , Encodable , Decodable , Debug , Default ) ]
406399pub struct WhereClause {
407400 /// `true` if we ate a `where` token.
408401 ///
@@ -419,12 +412,6 @@ impl WhereClause {
419412 }
420413}
421414
422- impl Default for WhereClause {
423- fn default ( ) -> WhereClause {
424- WhereClause { has_where_token : false , predicates : ThinVec :: new ( ) , span : DUMMY_SP }
425- }
426- }
427-
428415/// A single predicate in a where-clause.
429416#[ derive( Clone , Encodable , Decodable , Debug ) ]
430417pub struct WherePredicate {
0 commit comments