Description
In code that wants to suppress new_without_default, but which uses a mix of types only some of which could derive Default, it is annoying to have to suppress both of these lint names. I consider them effectively the same lint.
I would like to propose deprecating new_without_default_derive and having new_without_default lint all the cases that used to be linted by new_without_default_derive. The cases that can derive Default should retain the help message that mentions deriving Default.
The way to think about this is: if a codebase wants to have new
functions without necessarily having Default impls, then it won't matter to them whether or not Default can be derived. They would just suppress both lints. Every additional lint that they find needs to be suppressed detracts from their impression of Clippy.
#![allow(clippy::new_without_default, clippy::new_without_default_derive)]
pub struct S1;
pub struct S2(*const u8);
impl S1 {
pub fn new() -> Self {
S1
}
}
impl S2 {
pub fn new() -> Self {
S2(0 as _)
}
}
clippy 0.0.212 (29bf75c 2018-12-05)