fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.2 KiB153 linesraw
1error: you should consider adding a `Default` implementation for `Foo`
2  --> $DIR/new_without_default.rs:12:5
3   |
4LL | /     pub fn new() -> Foo {
5LL | |
6LL | |
7LL | |         Foo
8LL | |     }
9   | |_____^
10   |
11   = note: `-D clippy::new-without-default` implied by `-D warnings`
12   = help: to override `-D warnings` add `#[allow(clippy::new_without_default)]`
13help: try adding this
14   |
15LL + impl Default for Foo {
16LL +     fn default() -> Self {
17LL +         Self::new()
18LL +     }
19LL + }
20   |
21
22error: you should consider adding a `Default` implementation for `Bar`
23  --> $DIR/new_without_default.rs:22:5
24   |
25LL | /     pub fn new() -> Self {
26LL | |
27LL | |         Bar
28LL | |     }
29   | |_____^
30   |
31help: try adding this
32   |
33LL + impl Default for Bar {
34LL +     fn default() -> Self {
35LL +         Self::new()
36LL +     }
37LL + }
38   |
39
40error: you should consider adding a `Default` implementation for `LtKo<'c>`
41  --> $DIR/new_without_default.rs:87:5
42   |
43LL | /     pub fn new() -> LtKo<'c> {
44LL | |
45LL | |         unimplemented!()
46LL | |     }
47   | |_____^
48   |
49help: try adding this
50   |
51LL + impl<'c> Default for LtKo<'c> {
52LL +     fn default() -> Self {
53LL +         Self::new()
54LL +     }
55LL + }
56   |
57
58error: you should consider adding a `Default` implementation for `NewNotEqualToDerive`
59  --> $DIR/new_without_default.rs:180:5
60   |
61LL | /     pub fn new() -> Self {
62LL | |
63LL | |         NewNotEqualToDerive { foo: 1 }
64LL | |     }
65   | |_____^
66   |
67help: try adding this
68   |
69LL + impl Default for NewNotEqualToDerive {
70LL +     fn default() -> Self {
71LL +         Self::new()
72LL +     }
73LL + }
74   |
75
76error: you should consider adding a `Default` implementation for `FooGenerics<T>`
77  --> $DIR/new_without_default.rs:189:5
78   |
79LL | /     pub fn new() -> Self {
80LL | |
81LL | |         Self(Default::default())
82LL | |     }
83   | |_____^
84   |
85help: try adding this
86   |
87LL + impl<T> Default for FooGenerics<T> {
88LL +     fn default() -> Self {
89LL +         Self::new()
90LL +     }
91LL + }
92   |
93
94error: you should consider adding a `Default` implementation for `BarGenerics<T>`
95  --> $DIR/new_without_default.rs:197:5
96   |
97LL | /     pub fn new() -> Self {
98LL | |
99LL | |         Self(Default::default())
100LL | |     }
101   | |_____^
102   |
103help: try adding this
104   |
105LL + impl<T: Copy> Default for BarGenerics<T> {
106LL +     fn default() -> Self {
107LL +         Self::new()
108LL +     }
109LL + }
110   |
111
112error: you should consider adding a `Default` implementation for `Foo<T>`
113  --> $DIR/new_without_default.rs:209:9
114   |
115LL | /         pub fn new() -> Self {
116LL | |
117LL | |             todo!()
118LL | |         }
119   | |_________^
120   |
121help: try adding this
122   |
123LL ~     impl<T> Default for Foo<T> {
124LL +         fn default() -> Self {
125LL +             Self::new()
126LL +         }
127LL +     }
128LL + 
129LL ~     impl<T> Foo<T> {
130   |
131
132error: you should consider adding a `Default` implementation for `MyStruct<K, V>`
133  --> $DIR/new_without_default.rs:255:5
134   |
135LL | /     pub fn new() -> Self {
136LL | |         Self { _kv: None }
137LL | |     }
138   | |_____^
139   |
140help: try adding this
141   |
142LL + impl<K, V> Default for MyStruct<K, V>
143LL + where
144LL +     K: std::hash::Hash + Eq + PartialEq,
145LL +  {
146LL +     fn default() -> Self {
147LL +         Self::new()
148LL +     }
149LL + }
150   |
151
152error: aborting due to 8 previous errors
153