Skip to content

Commit 9206332

Browse files
committed
fix
1 parent 8ca900b commit 9206332

4 files changed

+57
-47
lines changed

tests/ui/derived_hash_with_manual_eq.rs

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ impl PartialEq<Baz> for Baz {
2727
}
2828
}
2929

30+
// Implementing `Hash` with a derived `PartialEq` is fine. See #2627
31+
3032
#[derive(PartialEq)]
3133
struct Bah;
3234

tests/ui/derived_hash_with_manual_eq.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
error: you are deriving `Hash` but have implemented `PartialEq` explicitly
2-
--> $DIR/derive_hash_xor_eq.rs:12:10
2+
--> $DIR/derived_hash_with_manual_eq.rs:12:10
33
|
44
LL | #[derive(Hash)]
55
| ^^^^
66
|
77
note: `PartialEq` implemented here
8-
--> $DIR/derive_hash_xor_eq.rs:15:1
8+
--> $DIR/derived_hash_with_manual_eq.rs:15:1
99
|
1010
LL | impl PartialEq for Bar {
1111
| ^^^^^^^^^^^^^^^^^^^^^^
12-
= note: `#[deny(clippy::derive_hash_xor_eq)]` on by default
12+
= note: `#[deny(clippy::derived_hash_with_manual_eq)]` on by default
1313
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1414

1515
error: you are deriving `Hash` but have implemented `PartialEq` explicitly
16-
--> $DIR/derive_hash_xor_eq.rs:21:10
16+
--> $DIR/derived_hash_with_manual_eq.rs:21:10
1717
|
1818
LL | #[derive(Hash)]
1919
| ^^^^
2020
|
2121
note: `PartialEq` implemented here
22-
--> $DIR/derive_hash_xor_eq.rs:24:1
22+
--> $DIR/derived_hash_with_manual_eq.rs:24:1
2323
|
2424
LL | impl PartialEq<Baz> for Baz {
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/rename.fixed

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#![allow(clippy::box_collection)]
1111
#![allow(clippy::redundant_static_lifetimes)]
1212
#![allow(clippy::cognitive_complexity)]
13+
#![allow(clippy::derived_hash_with_manual_eq)]
1314
#![allow(clippy::disallowed_methods)]
1415
#![allow(clippy::disallowed_types)]
1516
#![allow(clippy::mixed_read_write_in_expression)]
@@ -45,6 +46,7 @@
4546
#![warn(clippy::box_collection)]
4647
#![warn(clippy::redundant_static_lifetimes)]
4748
#![warn(clippy::cognitive_complexity)]
49+
#![warn(clippy::derived_hash_with_manual_eq)]
4850
#![warn(clippy::disallowed_methods)]
4951
#![warn(clippy::disallowed_types)]
5052
#![warn(clippy::mixed_read_write_in_expression)]

tests/ui/rename.stderr

+48-42
Original file line numberDiff line numberDiff line change
@@ -1,250 +1,256 @@
11
error: lint `clippy::almost_complete_letter_range` has been renamed to `clippy::almost_complete_range`
2-
--> $DIR/rename.rs:41:9
2+
--> $DIR/rename.rs:42:9
33
|
44
LL | #![warn(clippy::almost_complete_letter_range)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::almost_complete_range`
66
|
77
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
88

99
error: lint `clippy::blacklisted_name` has been renamed to `clippy::disallowed_names`
10-
--> $DIR/rename.rs:42:9
10+
--> $DIR/rename.rs:43:9
1111
|
1212
LL | #![warn(clippy::blacklisted_name)]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_names`
1414

1515
error: lint `clippy::block_in_if_condition_expr` has been renamed to `clippy::blocks_in_if_conditions`
16-
--> $DIR/rename.rs:43:9
16+
--> $DIR/rename.rs:44:9
1717
|
1818
LL | #![warn(clippy::block_in_if_condition_expr)]
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_if_conditions`
2020

2121
error: lint `clippy::block_in_if_condition_stmt` has been renamed to `clippy::blocks_in_if_conditions`
22-
--> $DIR/rename.rs:44:9
22+
--> $DIR/rename.rs:45:9
2323
|
2424
LL | #![warn(clippy::block_in_if_condition_stmt)]
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_if_conditions`
2626

2727
error: lint `clippy::box_vec` has been renamed to `clippy::box_collection`
28-
--> $DIR/rename.rs:45:9
28+
--> $DIR/rename.rs:46:9
2929
|
3030
LL | #![warn(clippy::box_vec)]
3131
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::box_collection`
3232

3333
error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
34-
--> $DIR/rename.rs:46:9
34+
--> $DIR/rename.rs:47:9
3535
|
3636
LL | #![warn(clippy::const_static_lifetime)]
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
3838

3939
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
40-
--> $DIR/rename.rs:47:9
40+
--> $DIR/rename.rs:48:9
4141
|
4242
LL | #![warn(clippy::cyclomatic_complexity)]
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
4444

45+
error: lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`
46+
--> $DIR/rename.rs:49:9
47+
|
48+
LL | #![warn(clippy::derive_hash_xor_eq)]
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::derived_hash_with_manual_eq`
50+
4551
error: lint `clippy::disallowed_method` has been renamed to `clippy::disallowed_methods`
46-
--> $DIR/rename.rs:48:9
52+
--> $DIR/rename.rs:50:9
4753
|
4854
LL | #![warn(clippy::disallowed_method)]
4955
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_methods`
5056

5157
error: lint `clippy::disallowed_type` has been renamed to `clippy::disallowed_types`
52-
--> $DIR/rename.rs:49:9
58+
--> $DIR/rename.rs:51:9
5359
|
5460
LL | #![warn(clippy::disallowed_type)]
5561
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::disallowed_types`
5662

5763
error: lint `clippy::eval_order_dependence` has been renamed to `clippy::mixed_read_write_in_expression`
58-
--> $DIR/rename.rs:50:9
64+
--> $DIR/rename.rs:52:9
5965
|
6066
LL | #![warn(clippy::eval_order_dependence)]
6167
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::mixed_read_write_in_expression`
6268

6369
error: lint `clippy::identity_conversion` has been renamed to `clippy::useless_conversion`
64-
--> $DIR/rename.rs:51:9
70+
--> $DIR/rename.rs:53:9
6571
|
6672
LL | #![warn(clippy::identity_conversion)]
6773
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::useless_conversion`
6874

6975
error: lint `clippy::if_let_some_result` has been renamed to `clippy::match_result_ok`
70-
--> $DIR/rename.rs:52:9
76+
--> $DIR/rename.rs:54:9
7177
|
7278
LL | #![warn(clippy::if_let_some_result)]
7379
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::match_result_ok`
7480

7581
error: lint `clippy::logic_bug` has been renamed to `clippy::overly_complex_bool_expr`
76-
--> $DIR/rename.rs:53:9
82+
--> $DIR/rename.rs:55:9
7783
|
7884
LL | #![warn(clippy::logic_bug)]
7985
| ^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::overly_complex_bool_expr`
8086

8187
error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
82-
--> $DIR/rename.rs:54:9
88+
--> $DIR/rename.rs:56:9
8389
|
8490
LL | #![warn(clippy::new_without_default_derive)]
8591
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
8692

8793
error: lint `clippy::option_and_then_some` has been renamed to `clippy::bind_instead_of_map`
88-
--> $DIR/rename.rs:55:9
94+
--> $DIR/rename.rs:57:9
8995
|
9096
LL | #![warn(clippy::option_and_then_some)]
9197
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::bind_instead_of_map`
9298

9399
error: lint `clippy::option_expect_used` has been renamed to `clippy::expect_used`
94-
--> $DIR/rename.rs:56:9
100+
--> $DIR/rename.rs:58:9
95101
|
96102
LL | #![warn(clippy::option_expect_used)]
97103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
98104

99105
error: lint `clippy::option_map_unwrap_or` has been renamed to `clippy::map_unwrap_or`
100-
--> $DIR/rename.rs:57:9
106+
--> $DIR/rename.rs:59:9
101107
|
102108
LL | #![warn(clippy::option_map_unwrap_or)]
103109
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
104110

105111
error: lint `clippy::option_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
106-
--> $DIR/rename.rs:58:9
112+
--> $DIR/rename.rs:60:9
107113
|
108114
LL | #![warn(clippy::option_map_unwrap_or_else)]
109115
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
110116

111117
error: lint `clippy::option_unwrap_used` has been renamed to `clippy::unwrap_used`
112-
--> $DIR/rename.rs:59:9
118+
--> $DIR/rename.rs:61:9
113119
|
114120
LL | #![warn(clippy::option_unwrap_used)]
115121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
116122

117123
error: lint `clippy::ref_in_deref` has been renamed to `clippy::needless_borrow`
118-
--> $DIR/rename.rs:60:9
124+
--> $DIR/rename.rs:62:9
119125
|
120126
LL | #![warn(clippy::ref_in_deref)]
121127
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::needless_borrow`
122128

123129
error: lint `clippy::result_expect_used` has been renamed to `clippy::expect_used`
124-
--> $DIR/rename.rs:61:9
130+
--> $DIR/rename.rs:63:9
125131
|
126132
LL | #![warn(clippy::result_expect_used)]
127133
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
128134

129135
error: lint `clippy::result_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
130-
--> $DIR/rename.rs:62:9
136+
--> $DIR/rename.rs:64:9
131137
|
132138
LL | #![warn(clippy::result_map_unwrap_or_else)]
133139
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
134140

135141
error: lint `clippy::result_unwrap_used` has been renamed to `clippy::unwrap_used`
136-
--> $DIR/rename.rs:63:9
142+
--> $DIR/rename.rs:65:9
137143
|
138144
LL | #![warn(clippy::result_unwrap_used)]
139145
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
140146

141147
error: lint `clippy::single_char_push_str` has been renamed to `clippy::single_char_add_str`
142-
--> $DIR/rename.rs:64:9
148+
--> $DIR/rename.rs:66:9
143149
|
144150
LL | #![warn(clippy::single_char_push_str)]
145151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::single_char_add_str`
146152

147153
error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
148-
--> $DIR/rename.rs:65:9
154+
--> $DIR/rename.rs:67:9
149155
|
150156
LL | #![warn(clippy::stutter)]
151157
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
152158

153159
error: lint `clippy::to_string_in_display` has been renamed to `clippy::recursive_format_impl`
154-
--> $DIR/rename.rs:66:9
160+
--> $DIR/rename.rs:68:9
155161
|
156162
LL | #![warn(clippy::to_string_in_display)]
157163
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::recursive_format_impl`
158164

159165
error: lint `clippy::zero_width_space` has been renamed to `clippy::invisible_characters`
160-
--> $DIR/rename.rs:67:9
166+
--> $DIR/rename.rs:69:9
161167
|
162168
LL | #![warn(clippy::zero_width_space)]
163169
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::invisible_characters`
164170

165171
error: lint `clippy::drop_bounds` has been renamed to `drop_bounds`
166-
--> $DIR/rename.rs:68:9
172+
--> $DIR/rename.rs:70:9
167173
|
168174
LL | #![warn(clippy::drop_bounds)]
169175
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds`
170176

171177
error: lint `clippy::for_loop_over_option` has been renamed to `for_loops_over_fallibles`
172-
--> $DIR/rename.rs:69:9
178+
--> $DIR/rename.rs:71:9
173179
|
174180
LL | #![warn(clippy::for_loop_over_option)]
175181
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
176182

177183
error: lint `clippy::for_loop_over_result` has been renamed to `for_loops_over_fallibles`
178-
--> $DIR/rename.rs:70:9
184+
--> $DIR/rename.rs:72:9
179185
|
180186
LL | #![warn(clippy::for_loop_over_result)]
181187
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
182188

183189
error: lint `clippy::for_loops_over_fallibles` has been renamed to `for_loops_over_fallibles`
184-
--> $DIR/rename.rs:71:9
190+
--> $DIR/rename.rs:73:9
185191
|
186192
LL | #![warn(clippy::for_loops_over_fallibles)]
187193
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
188194

189195
error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter`
190-
--> $DIR/rename.rs:72:9
196+
--> $DIR/rename.rs:74:9
191197
|
192198
LL | #![warn(clippy::into_iter_on_array)]
193199
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `array_into_iter`
194200

195201
error: lint `clippy::invalid_atomic_ordering` has been renamed to `invalid_atomic_ordering`
196-
--> $DIR/rename.rs:73:9
202+
--> $DIR/rename.rs:75:9
197203
|
198204
LL | #![warn(clippy::invalid_atomic_ordering)]
199205
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_atomic_ordering`
200206

201207
error: lint `clippy::invalid_ref` has been renamed to `invalid_value`
202-
--> $DIR/rename.rs:74:9
208+
--> $DIR/rename.rs:76:9
203209
|
204210
LL | #![warn(clippy::invalid_ref)]
205211
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_value`
206212

207213
error: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
208-
--> $DIR/rename.rs:75:9
214+
--> $DIR/rename.rs:77:9
209215
|
210216
LL | #![warn(clippy::let_underscore_drop)]
211217
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
212218

213219
error: lint `clippy::mem_discriminant_non_enum` has been renamed to `enum_intrinsics_non_enums`
214-
--> $DIR/rename.rs:76:9
220+
--> $DIR/rename.rs:78:9
215221
|
216222
LL | #![warn(clippy::mem_discriminant_non_enum)]
217223
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `enum_intrinsics_non_enums`
218224

219225
error: lint `clippy::panic_params` has been renamed to `non_fmt_panics`
220-
--> $DIR/rename.rs:77:9
226+
--> $DIR/rename.rs:79:9
221227
|
222228
LL | #![warn(clippy::panic_params)]
223229
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `non_fmt_panics`
224230

225231
error: lint `clippy::positional_named_format_parameters` has been renamed to `named_arguments_used_positionally`
226-
--> $DIR/rename.rs:78:9
232+
--> $DIR/rename.rs:80:9
227233
|
228234
LL | #![warn(clippy::positional_named_format_parameters)]
229235
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `named_arguments_used_positionally`
230236

231237
error: lint `clippy::temporary_cstring_as_ptr` has been renamed to `temporary_cstring_as_ptr`
232-
--> $DIR/rename.rs:79:9
238+
--> $DIR/rename.rs:81:9
233239
|
234240
LL | #![warn(clippy::temporary_cstring_as_ptr)]
235241
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `temporary_cstring_as_ptr`
236242

237243
error: lint `clippy::unknown_clippy_lints` has been renamed to `unknown_lints`
238-
--> $DIR/rename.rs:80:9
244+
--> $DIR/rename.rs:82:9
239245
|
240246
LL | #![warn(clippy::unknown_clippy_lints)]
241247
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unknown_lints`
242248

243249
error: lint `clippy::unused_label` has been renamed to `unused_labels`
244-
--> $DIR/rename.rs:81:9
250+
--> $DIR/rename.rs:83:9
245251
|
246252
LL | #![warn(clippy::unused_label)]
247253
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unused_labels`
248254

249-
error: aborting due to 41 previous errors
255+
error: aborting due to 42 previous errors
250256

0 commit comments

Comments
 (0)