Checks for data structures that could derive additional traits.
Not deriving the additional traits could be a missed opportunity.
- This lint is noisy! The
at_least_one_field
andignore
options (see below) can be used to make the lint less noisy. - Currently does not support traits with type or constant parameters (e.g.,
PartialEq
), or traits with supertraits with type or constant parameters (e.g.,Eq
).
#[derive(Default)]
struct S;
struct T(S);
Use instead:
#[derive(Default)]
struct S;
#[derive(Default)]
struct T(S);
at_least_one_field: bool
(defaultfalse
): If set totrue
, the lint suggests to derive a trait only when there is at least one field that implements (or could derive) the trait.ignore: Vec<String>
(default[]
): A list of macro paths the lint should not suggest to derive.