@@ -31,7 +31,7 @@ use rustc_data_structures::sync::Lrc;
31
31
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
32
32
pub use rustc_span::AttrId;
33
33
use 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};
35
35
use thin_vec::{ThinVec, thin_vec};
36
36
37
37
pub use crate::format::*;
@@ -387,22 +387,15 @@ impl GenericParam {
387
387
388
388
/// Represents lifetime, type and const parameters attached to a declaration of
389
389
/// a function, enum, trait, etc.
390
- #[derive(Clone, Encodable, Decodable, Debug)]
390
+ #[derive(Clone, Encodable, Decodable, Debug, Default )]
391
391
pub struct Generics {
392
392
pub params: ThinVec<GenericParam>,
393
393
pub where_clause: WhereClause,
394
394
pub span: Span,
395
395
}
396
396
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
-
404
397
/// A where-clause in a definition.
405
- #[derive(Clone, Encodable, Decodable, Debug)]
398
+ #[derive(Clone, Encodable, Decodable, Debug, Default )]
406
399
pub struct WhereClause {
407
400
/// `true` if we ate a `where` token.
408
401
///
@@ -419,12 +412,6 @@ impl WhereClause {
419
412
}
420
413
}
421
414
422
- impl Default for WhereClause {
423
- fn default() -> WhereClause {
424
- WhereClause { has_where_token: false, predicates: ThinVec::new(), span: DUMMY_SP }
425
- }
426
- }
427
-
428
415
/// A single predicate in a where-clause.
429
416
#[derive(Clone, Encodable, Decodable, Debug)]
430
417
pub struct WherePredicate {
0 commit comments