Rollup merge of #104391 - nnethercote:deriving-cleanups, r=jackh726

Deriving cleanups

Fixing some minor problems `@RalfJung` found in #99046.

r? `@RalfJung`
This commit is contained in:
Matthias Krüger 2022-11-15 01:40:44 +01:00 committed by GitHub
commit aea4c0c1b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 37 additions and 58 deletions

View file

@ -392,15 +392,7 @@ pub struct Generics {
impl Default for Generics {
/// Creates an instance of `Generics`.
fn default() -> Generics {
Generics {
params: Vec::new(),
where_clause: WhereClause {
has_where_token: false,
predicates: Vec::new(),
span: DUMMY_SP,
},
span: DUMMY_SP,
}
Generics { params: Vec::new(), where_clause: Default::default(), span: DUMMY_SP }
}
}
@ -415,6 +407,12 @@ pub struct WhereClause {
pub span: Span,
}
impl Default for WhereClause {
fn default() -> WhereClause {
WhereClause { has_where_token: false, predicates: Vec::new(), span: DUMMY_SP }
}
}
/// A single predicate in a where-clause.
#[derive(Clone, Encodable, Decodable, Debug)]
pub enum WherePredicate {