]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | error: you should consider adding a `Default` implementation for `Foo` |
2 | --> $DIR/new_without_default.rs:8:5 | |
3 | | | |
4 | LL | / pub fn new() -> Foo { | |
5 | LL | | Foo | |
6 | LL | | } | |
7 | | |_____^ | |
8 | | | |
9 | = note: `-D clippy::new-without-default` implied by `-D warnings` | |
10 | help: try this | |
11 | | | |
12 | LL | impl Default for Foo { | |
13 | LL | fn default() -> Self { | |
14 | LL | Self::new() | |
15 | LL | } | |
16 | LL | } | |
17 | | | |
18 | ||
19 | error: you should consider adding a `Default` implementation for `Bar` | |
20 | --> $DIR/new_without_default.rs:16:5 | |
21 | | | |
22 | LL | / pub fn new() -> Self { | |
23 | LL | | Bar | |
24 | LL | | } | |
25 | | |_____^ | |
26 | | | |
27 | help: try this | |
28 | | | |
29 | LL | impl Default for Bar { | |
30 | LL | fn default() -> Self { | |
31 | LL | Self::new() | |
32 | LL | } | |
33 | LL | } | |
34 | | | |
35 | ||
36 | error: you should consider adding a `Default` implementation for `LtKo<'c>` | |
37 | --> $DIR/new_without_default.rs:80:5 | |
38 | | | |
39 | LL | / pub fn new() -> LtKo<'c> { | |
40 | LL | | unimplemented!() | |
41 | LL | | } | |
42 | | |_____^ | |
43 | | | |
44 | help: try this | |
45 | | | |
46 | LL | impl Default for LtKo<'c> { | |
47 | LL | fn default() -> Self { | |
48 | LL | Self::new() | |
49 | LL | } | |
50 | LL | } | |
51 | | | |
52 | ||
53 | error: you should consider adding a `Default` implementation for `NewNotEqualToDerive` | |
54 | --> $DIR/new_without_default.rs:157:5 | |
55 | | | |
56 | LL | / pub fn new() -> Self { | |
57 | LL | | NewNotEqualToDerive { foo: 1 } | |
58 | LL | | } | |
59 | | |_____^ | |
60 | | | |
61 | help: try this | |
62 | | | |
63 | LL | impl Default for NewNotEqualToDerive { | |
64 | LL | fn default() -> Self { | |
65 | LL | Self::new() | |
66 | LL | } | |
67 | LL | } | |
68 | | | |
69 | ||
70 | error: aborting due to 4 previous errors | |
71 |