mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 08:57:30 +00:00
40 lines
1 KiB
Text
40 lines
1 KiB
Text
error: you should consider deriving a `Default` implementation for `Foo`
|
|
--> $DIR/new_without_default.rs:22:5
|
|
|
|
|
22 | pub fn new() -> Foo { Foo }
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::new-without-default-derive` implied by `-D warnings`
|
|
help: try this
|
|
|
|
|
19 | #[derive(Default)]
|
|
|
|
|
|
|
error: you should consider deriving a `Default` implementation for `Bar`
|
|
--> $DIR/new_without_default.rs:28:5
|
|
|
|
|
28 | pub fn new() -> Self { Bar }
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: try this
|
|
|
|
|
25 | #[derive(Default)]
|
|
|
|
|
|
|
error: you should consider adding a `Default` implementation for `LtKo<'c>`
|
|
--> $DIR/new_without_default.rs:76:5
|
|
|
|
|
76 | pub fn new() -> LtKo<'c> { unimplemented!() }
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::new-without-default` implied by `-D warnings`
|
|
help: try this
|
|
|
|
|
75 | impl Default for LtKo<'c> {
|
|
76 | fn default() -> Self {
|
|
77 | Self::new()
|
|
78 | }
|
|
79 | }
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|