Skip to content

Commit c519673

Browse files
authoredJan 27, 2025
Rollup merge of #126604 - kadiwa4:uplift_double_negation, r=nnethercote
Uplift `clippy::double_neg` lint as `double_negations` Warns about cases like this: ```rust fn main() { let x = 1; let _b = --x; //~ WARN use of a double negation } ``` The intent is to keep people from thinking that `--x` is a prefix decrement operator. `++x`, `x++` and `x--` are invalid expressions and already have a helpful diagnostic. I didn't add a machine-applicable suggestion to the lint because it's not entirely clear what the programmer was trying to achieve with the `--x` operation. The code that triggers the lint should always be reviewed manually. Closes #82987
2 parents 5006145 + 25a77cf commit c519673

File tree

12 files changed

+93
-146
lines changed

12 files changed

+93
-146
lines changed
 

‎.github/driver.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ unset CARGO_MANIFEST_DIR
4747

4848
# Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
4949
# FIXME: How to match the clippy invocation in compile-test.rs?
50-
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/double_neg.rs 2>double_neg.stderr && exit 1
51-
sed -e "/= help: for/d" double_neg.stderr > normalized.stderr
52-
diff -u normalized.stderr tests/ui/double_neg.stderr
50+
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/box_default.rs 2>box_default.stderr && exit 1
51+
sed -e "/= help: for/d" box_default.stderr > normalized.stderr
52+
diff -u normalized.stderr tests/ui/box_default.stderr
5353

5454
# make sure "clippy-driver --rustc --arg" and "rustc --arg" behave the same
5555
SYSROOT=$(rustc --print sysroot)

‎book/src/usage.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ You can configure lint levels on the command line by adding
3333
`-A/W/D clippy::lint_name` like this:
3434

3535
```bash
36-
cargo clippy -- -Aclippy::style -Wclippy::double_neg -Dclippy::perf
36+
cargo clippy -- -Aclippy::style -Wclippy::box_default -Dclippy::perf
3737
```
3838

3939
For [CI] all warnings can be elevated to errors which will in turn fail
@@ -101,11 +101,10 @@ You can configure lint levels in source code the same way you can configure
101101
```rust,ignore
102102
#![allow(clippy::style)]
103103
104-
#[warn(clippy::double_neg)]
104+
#[warn(clippy::box_default)]
105105
fn main() {
106-
let x = 1;
107-
let y = --x;
108-
// ^^ warning: double negation
106+
let _ = Box::<String>::new(Default::default());
107+
// ^ warning: `Box::new(_)` of default value
109108
}
110109
```
111110

‎clippy_dev/src/new_lint.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str>
455455
});
456456

457457
// Find both the last lint declaration (declare_clippy_lint!) and the lint pass impl
458-
while let Some(LintDeclSearchResult { content, .. }) = iter.find(|result| result.token == TokenKind::Ident) {
458+
while let Some(LintDeclSearchResult { content, .. }) = iter.find(|result| result.token_kind == TokenKind::Ident) {
459459
let mut iter = iter
460460
.by_ref()
461461
.filter(|t| !matches!(t.token_kind, TokenKind::Whitespace | TokenKind::LineComment { .. }));
@@ -465,7 +465,7 @@ fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str>
465465
// matches `!{`
466466
match_tokens!(iter, Bang OpenBrace);
467467
if let Some(LintDeclSearchResult { range, .. }) =
468-
iter.find(|result| result.token == TokenKind::CloseBrace)
468+
iter.find(|result| result.token_kind == TokenKind::CloseBrace)
469469
{
470470
last_decl_curly_offset = Some(range.end);
471471
}

‎clippy_lints/src/declared_lints.rs

-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ pub static LINTS: &[&crate::LintInfo] = &[
507507
crate::misc::USED_UNDERSCORE_BINDING_INFO,
508508
crate::misc::USED_UNDERSCORE_ITEMS_INFO,
509509
crate::misc_early::BUILTIN_TYPE_SHADOW_INFO,
510-
crate::misc_early::DOUBLE_NEG_INFO,
511510
crate::misc_early::DUPLICATE_UNDERSCORE_ARGUMENT_INFO,
512511
crate::misc_early::MIXED_CASE_HEX_LITERALS_INFO,
513512
crate::misc_early::REDUNDANT_AT_REST_PATTERN_INFO,

‎clippy_lints/src/deprecated_lints.rs

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ declare_with_version! { RENAMED(RENAMED_VERSION): &[(&str, &str)] = &[
129129
("clippy::clone_double_ref", "suspicious_double_ref_op"),
130130
#[clippy::version = ""]
131131
("clippy::cmp_nan", "invalid_nan_comparisons"),
132+
#[clippy::version = "1.86.0"]
133+
("clippy::double_neg", "double_negations"),
132134
#[clippy::version = ""]
133135
("clippy::drop_bounds", "drop_bounds"),
134136
#[clippy::version = ""]

‎clippy_lints/src/misc_early/double_neg.rs

-18
This file was deleted.

‎clippy_lints/src/misc_early/mod.rs

-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
mod builtin_type_shadow;
2-
mod double_neg;
32
mod literal_suffix;
43
mod mixed_case_hex_literals;
54
mod redundant_at_rest_pattern;
@@ -85,25 +84,6 @@ declare_clippy_lint! {
8584
"function arguments having names which only differ by an underscore"
8685
}
8786

88-
declare_clippy_lint! {
89-
/// ### What it does
90-
/// Detects expressions of the form `--x`.
91-
///
92-
/// ### Why is this bad?
93-
/// It can mislead C/C++ programmers to think `x` was
94-
/// decremented.
95-
///
96-
/// ### Example
97-
/// ```no_run
98-
/// let mut x = 3;
99-
/// --x;
100-
/// ```
101-
#[clippy::version = "pre 1.29.0"]
102-
pub DOUBLE_NEG,
103-
style,
104-
"`--x`, which is a double negation of `x` and not a pre-decrement as in C/C++"
105-
}
106-
10787
declare_clippy_lint! {
10888
/// ### What it does
10989
/// Warns on hexadecimal literals with mixed-case letter
@@ -352,7 +332,6 @@ declare_clippy_lint! {
352332
declare_lint_pass!(MiscEarlyLints => [
353333
UNNEEDED_FIELD_PATTERN,
354334
DUPLICATE_UNDERSCORE_ARGUMENT,
355-
DOUBLE_NEG,
356335
MIXED_CASE_HEX_LITERALS,
357336
UNSEPARATED_LITERAL_SUFFIX,
358337
SEPARATED_LITERAL_SUFFIX,
@@ -415,7 +394,6 @@ impl EarlyLintPass for MiscEarlyLints {
415394
if let ExprKind::Lit(lit) = expr.kind {
416395
MiscEarlyLints::check_lit(cx, lit, expr.span);
417396
}
418-
double_neg::check(cx, expr);
419397
}
420398
}
421399

‎tests/ui/double_neg.rs

-10
This file was deleted.

‎tests/ui/double_neg.stderr

-11
This file was deleted.

‎tests/ui/rename.fixed

+8-7
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
#![allow(clippy::disallowed_methods)]
1414
#![allow(clippy::disallowed_types)]
1515
#![allow(clippy::mixed_read_write_in_expression)]
16-
#![allow(clippy::manual_find_map)]
1716
#![allow(clippy::manual_filter_map)]
18-
#![allow(unpredictable_function_pointer_comparisons)]
17+
#![allow(clippy::manual_find_map)]
1918
#![allow(clippy::useless_conversion)]
2019
#![allow(clippy::redundant_pattern_matching)]
2120
#![allow(clippy::match_result_ok)]
@@ -30,6 +29,7 @@
3029
#![allow(clippy::unwrap_used)]
3130
#![allow(clippy::panicking_overflow_checks)]
3231
#![allow(clippy::needless_borrow)]
32+
#![allow(clippy::reversed_empty_ranges)]
3333
#![allow(clippy::single_char_add_str)]
3434
#![allow(clippy::module_name_repetitions)]
3535
#![allow(clippy::missing_const_for_thread_local)]
@@ -39,9 +39,11 @@
3939
#![allow(invalid_reference_casting)]
4040
#![allow(suspicious_double_ref_op)]
4141
#![allow(invalid_nan_comparisons)]
42+
#![allow(double_negations)]
4243
#![allow(drop_bounds)]
4344
#![allow(dropping_copy_types)]
4445
#![allow(dropping_references)]
46+
#![allow(unpredictable_function_pointer_comparisons)]
4547
#![allow(useless_ptr_null_checks)]
4648
#![allow(for_loops_over_fallibles)]
4749
#![allow(forgetting_copy_types)]
@@ -60,8 +62,6 @@
6062
#![allow(unknown_lints)]
6163
#![allow(unused_labels)]
6264
#![allow(ambiguous_wide_pointer_comparisons)]
63-
#![allow(unpredictable_function_pointer_comparisons)]
64-
#![allow(clippy::reversed_empty_ranges)]
6565
#![warn(clippy::almost_complete_range)] //~ ERROR: lint `clippy::almost_complete_letter_range`
6666
#![warn(clippy::disallowed_names)] //~ ERROR: lint `clippy::blacklisted_name`
6767
#![warn(clippy::blocks_in_conditions)] //~ ERROR: lint `clippy::block_in_if_condition_expr`
@@ -74,9 +74,8 @@
7474
#![warn(clippy::disallowed_methods)] //~ ERROR: lint `clippy::disallowed_method`
7575
#![warn(clippy::disallowed_types)] //~ ERROR: lint `clippy::disallowed_type`
7676
#![warn(clippy::mixed_read_write_in_expression)] //~ ERROR: lint `clippy::eval_order_dependence`
77-
#![warn(clippy::manual_find_map)] //~ ERROR: lint `clippy::find_map`
7877
#![warn(clippy::manual_filter_map)] //~ ERROR: lint `clippy::filter_map`
79-
#![warn(unpredictable_function_pointer_comparisons)] //~ ERROR: lint `clippy::fn_address_comparisons`
78+
#![warn(clippy::manual_find_map)] //~ ERROR: lint `clippy::find_map`
8079
#![warn(clippy::useless_conversion)] //~ ERROR: lint `clippy::identity_conversion`
8180
#![warn(clippy::redundant_pattern_matching)] //~ ERROR: lint `clippy::if_let_redundant_pattern_matching`
8281
#![warn(clippy::match_result_ok)] //~ ERROR: lint `clippy::if_let_some_result`
@@ -95,6 +94,7 @@
9594
#![warn(clippy::expect_used)] //~ ERROR: lint `clippy::result_expect_used`
9695
#![warn(clippy::map_unwrap_or)] //~ ERROR: lint `clippy::result_map_unwrap_or_else`
9796
#![warn(clippy::unwrap_used)] //~ ERROR: lint `clippy::result_unwrap_used`
97+
#![warn(clippy::reversed_empty_ranges)] //~ ERROR: lint `clippy::reverse_range_loop`
9898
#![warn(clippy::single_char_add_str)] //~ ERROR: lint `clippy::single_char_push_str`
9999
#![warn(clippy::module_name_repetitions)] //~ ERROR: lint `clippy::stutter`
100100
#![warn(clippy::missing_const_for_thread_local)] //~ ERROR: lint `clippy::thread_local_initializer_can_be_made_const`
@@ -104,9 +104,11 @@
104104
#![warn(invalid_reference_casting)] //~ ERROR: lint `clippy::cast_ref_to_mut`
105105
#![warn(suspicious_double_ref_op)] //~ ERROR: lint `clippy::clone_double_ref`
106106
#![warn(invalid_nan_comparisons)] //~ ERROR: lint `clippy::cmp_nan`
107+
#![warn(double_negations)] //~ ERROR: lint `clippy::double_neg`
107108
#![warn(drop_bounds)] //~ ERROR: lint `clippy::drop_bounds`
108109
#![warn(dropping_copy_types)] //~ ERROR: lint `clippy::drop_copy`
109110
#![warn(dropping_references)] //~ ERROR: lint `clippy::drop_ref`
111+
#![warn(unpredictable_function_pointer_comparisons)] //~ ERROR: lint `clippy::fn_address_comparisons`
110112
#![warn(useless_ptr_null_checks)] //~ ERROR: lint `clippy::fn_null_check`
111113
#![warn(for_loops_over_fallibles)] //~ ERROR: lint `clippy::for_loop_over_option`
112114
#![warn(for_loops_over_fallibles)] //~ ERROR: lint `clippy::for_loop_over_result`
@@ -128,6 +130,5 @@
128130
#![warn(unknown_lints)] //~ ERROR: lint `clippy::unknown_clippy_lints`
129131
#![warn(unused_labels)] //~ ERROR: lint `clippy::unused_label`
130132
#![warn(ambiguous_wide_pointer_comparisons)] //~ ERROR: lint `clippy::vtable_address_comparisons`
131-
#![warn(clippy::reversed_empty_ranges)] //~ ERROR: lint `clippy::reverse_range_loop`
132133

133134
fn main() {}

‎tests/ui/rename.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
#![allow(clippy::disallowed_methods)]
1414
#![allow(clippy::disallowed_types)]
1515
#![allow(clippy::mixed_read_write_in_expression)]
16-
#![allow(clippy::manual_find_map)]
1716
#![allow(clippy::manual_filter_map)]
18-
#![allow(unpredictable_function_pointer_comparisons)]
17+
#![allow(clippy::manual_find_map)]
1918
#![allow(clippy::useless_conversion)]
2019
#![allow(clippy::redundant_pattern_matching)]
2120
#![allow(clippy::match_result_ok)]
@@ -30,6 +29,7 @@
3029
#![allow(clippy::unwrap_used)]
3130
#![allow(clippy::panicking_overflow_checks)]
3231
#![allow(clippy::needless_borrow)]
32+
#![allow(clippy::reversed_empty_ranges)]
3333
#![allow(clippy::single_char_add_str)]
3434
#![allow(clippy::module_name_repetitions)]
3535
#![allow(clippy::missing_const_for_thread_local)]
@@ -39,9 +39,11 @@
3939
#![allow(invalid_reference_casting)]
4040
#![allow(suspicious_double_ref_op)]
4141
#![allow(invalid_nan_comparisons)]
42+
#![allow(double_negations)]
4243
#![allow(drop_bounds)]
4344
#![allow(dropping_copy_types)]
4445
#![allow(dropping_references)]
46+
#![allow(unpredictable_function_pointer_comparisons)]
4547
#![allow(useless_ptr_null_checks)]
4648
#![allow(for_loops_over_fallibles)]
4749
#![allow(forgetting_copy_types)]
@@ -60,8 +62,6 @@
6062
#![allow(unknown_lints)]
6163
#![allow(unused_labels)]
6264
#![allow(ambiguous_wide_pointer_comparisons)]
63-
#![allow(unpredictable_function_pointer_comparisons)]
64-
#![allow(clippy::reversed_empty_ranges)]
6565
#![warn(clippy::almost_complete_letter_range)] //~ ERROR: lint `clippy::almost_complete_letter_range`
6666
#![warn(clippy::blacklisted_name)] //~ ERROR: lint `clippy::blacklisted_name`
6767
#![warn(clippy::block_in_if_condition_expr)] //~ ERROR: lint `clippy::block_in_if_condition_expr`
@@ -74,9 +74,8 @@
7474
#![warn(clippy::disallowed_method)] //~ ERROR: lint `clippy::disallowed_method`
7575
#![warn(clippy::disallowed_type)] //~ ERROR: lint `clippy::disallowed_type`
7676
#![warn(clippy::eval_order_dependence)] //~ ERROR: lint `clippy::eval_order_dependence`
77-
#![warn(clippy::find_map)] //~ ERROR: lint `clippy::find_map`
7877
#![warn(clippy::filter_map)] //~ ERROR: lint `clippy::filter_map`
79-
#![warn(clippy::fn_address_comparisons)] //~ ERROR: lint `clippy::fn_address_comparisons`
78+
#![warn(clippy::find_map)] //~ ERROR: lint `clippy::find_map`
8079
#![warn(clippy::identity_conversion)] //~ ERROR: lint `clippy::identity_conversion`
8180
#![warn(clippy::if_let_redundant_pattern_matching)] //~ ERROR: lint `clippy::if_let_redundant_pattern_matching`
8281
#![warn(clippy::if_let_some_result)] //~ ERROR: lint `clippy::if_let_some_result`
@@ -95,6 +94,7 @@
9594
#![warn(clippy::result_expect_used)] //~ ERROR: lint `clippy::result_expect_used`
9695
#![warn(clippy::result_map_unwrap_or_else)] //~ ERROR: lint `clippy::result_map_unwrap_or_else`
9796
#![warn(clippy::result_unwrap_used)] //~ ERROR: lint `clippy::result_unwrap_used`
97+
#![warn(clippy::reverse_range_loop)] //~ ERROR: lint `clippy::reverse_range_loop`
9898
#![warn(clippy::single_char_push_str)] //~ ERROR: lint `clippy::single_char_push_str`
9999
#![warn(clippy::stutter)] //~ ERROR: lint `clippy::stutter`
100100
#![warn(clippy::thread_local_initializer_can_be_made_const)] //~ ERROR: lint `clippy::thread_local_initializer_can_be_made_const`
@@ -104,9 +104,11 @@
104104
#![warn(clippy::cast_ref_to_mut)] //~ ERROR: lint `clippy::cast_ref_to_mut`
105105
#![warn(clippy::clone_double_ref)] //~ ERROR: lint `clippy::clone_double_ref`
106106
#![warn(clippy::cmp_nan)] //~ ERROR: lint `clippy::cmp_nan`
107+
#![warn(clippy::double_neg)] //~ ERROR: lint `clippy::double_neg`
107108
#![warn(clippy::drop_bounds)] //~ ERROR: lint `clippy::drop_bounds`
108109
#![warn(clippy::drop_copy)] //~ ERROR: lint `clippy::drop_copy`
109110
#![warn(clippy::drop_ref)] //~ ERROR: lint `clippy::drop_ref`
111+
#![warn(clippy::fn_address_comparisons)] //~ ERROR: lint `clippy::fn_address_comparisons`
110112
#![warn(clippy::fn_null_check)] //~ ERROR: lint `clippy::fn_null_check`
111113
#![warn(clippy::for_loop_over_option)] //~ ERROR: lint `clippy::for_loop_over_option`
112114
#![warn(clippy::for_loop_over_result)] //~ ERROR: lint `clippy::for_loop_over_result`
@@ -128,6 +130,5 @@
128130
#![warn(clippy::unknown_clippy_lints)] //~ ERROR: lint `clippy::unknown_clippy_lints`
129131
#![warn(clippy::unused_label)] //~ ERROR: lint `clippy::unused_label`
130132
#![warn(clippy::vtable_address_comparisons)] //~ ERROR: lint `clippy::vtable_address_comparisons`
131-
#![warn(clippy::reverse_range_loop)] //~ ERROR: lint `clippy::reverse_range_loop`
132133

133134
fn main() {}

‎tests/ui/rename.stderr

+66-60
Original file line numberDiff line numberDiff line change
@@ -73,132 +73,132 @@ error: lint `clippy::eval_order_dependence` has been renamed to `clippy::mixed_r
7373
LL | #![warn(clippy::eval_order_dependence)]
7474
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::mixed_read_write_in_expression`
7575

76-
error: lint `clippy::find_map` has been renamed to `clippy::manual_find_map`
77-
--> tests/ui/rename.rs:77:9
78-
|
79-
LL | #![warn(clippy::find_map)]
80-
| ^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_find_map`
81-
8276
error: lint `clippy::filter_map` has been renamed to `clippy::manual_filter_map`
83-
--> tests/ui/rename.rs:78:9
77+
--> tests/ui/rename.rs:77:9
8478
|
8579
LL | #![warn(clippy::filter_map)]
8680
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_filter_map`
8781

88-
error: lint `clippy::fn_address_comparisons` has been renamed to `unpredictable_function_pointer_comparisons`
89-
--> tests/ui/rename.rs:79:9
82+
error: lint `clippy::find_map` has been renamed to `clippy::manual_find_map`
83+
--> tests/ui/rename.rs:78:9
9084
|
91-
LL | #![warn(clippy::fn_address_comparisons)]
92-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unpredictable_function_pointer_comparisons`
85+
LL | #![warn(clippy::find_map)]
86+
| ^^^^^^^^^^^^^^^^ help: use the new name: `clippy::manual_find_map`
9387

9488
error: lint `clippy::identity_conversion` has been renamed to `clippy::useless_conversion`
95-
--> tests/ui/rename.rs:80:9
89+
--> tests/ui/rename.rs:79:9
9690
|
9791
LL | #![warn(clippy::identity_conversion)]
9892
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::useless_conversion`
9993

10094
error: lint `clippy::if_let_redundant_pattern_matching` has been renamed to `clippy::redundant_pattern_matching`
101-
--> tests/ui/rename.rs:81:9
95+
--> tests/ui/rename.rs:80:9
10296
|
10397
LL | #![warn(clippy::if_let_redundant_pattern_matching)]
10498
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_pattern_matching`
10599

106100
error: lint `clippy::if_let_some_result` has been renamed to `clippy::match_result_ok`
107-
--> tests/ui/rename.rs:82:9
101+
--> tests/ui/rename.rs:81:9
108102
|
109103
LL | #![warn(clippy::if_let_some_result)]
110104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::match_result_ok`
111105

112106
error: lint `clippy::incorrect_clone_impl_on_copy_type` has been renamed to `clippy::non_canonical_clone_impl`
113-
--> tests/ui/rename.rs:83:9
107+
--> tests/ui/rename.rs:82:9
114108
|
115109
LL | #![warn(clippy::incorrect_clone_impl_on_copy_type)]
116110
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::non_canonical_clone_impl`
117111

118112
error: lint `clippy::incorrect_partial_ord_impl_on_ord_type` has been renamed to `clippy::non_canonical_partial_ord_impl`
119-
--> tests/ui/rename.rs:84:9
113+
--> tests/ui/rename.rs:83:9
120114
|
121115
LL | #![warn(clippy::incorrect_partial_ord_impl_on_ord_type)]
122116
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::non_canonical_partial_ord_impl`
123117

124118
error: lint `clippy::integer_arithmetic` has been renamed to `clippy::arithmetic_side_effects`
125-
--> tests/ui/rename.rs:85:9
119+
--> tests/ui/rename.rs:84:9
126120
|
127121
LL | #![warn(clippy::integer_arithmetic)]
128122
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::arithmetic_side_effects`
129123

130124
error: lint `clippy::logic_bug` has been renamed to `clippy::overly_complex_bool_expr`
131-
--> tests/ui/rename.rs:86:9
125+
--> tests/ui/rename.rs:85:9
132126
|
133127
LL | #![warn(clippy::logic_bug)]
134128
| ^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::overly_complex_bool_expr`
135129

136130
error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
137-
--> tests/ui/rename.rs:87:9
131+
--> tests/ui/rename.rs:86:9
138132
|
139133
LL | #![warn(clippy::new_without_default_derive)]
140134
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
141135

142136
error: lint `clippy::option_and_then_some` has been renamed to `clippy::bind_instead_of_map`
143-
--> tests/ui/rename.rs:88:9
137+
--> tests/ui/rename.rs:87:9
144138
|
145139
LL | #![warn(clippy::option_and_then_some)]
146140
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::bind_instead_of_map`
147141

148142
error: lint `clippy::option_expect_used` has been renamed to `clippy::expect_used`
149-
--> tests/ui/rename.rs:89:9
143+
--> tests/ui/rename.rs:88:9
150144
|
151145
LL | #![warn(clippy::option_expect_used)]
152146
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
153147

154148
error: lint `clippy::option_map_unwrap_or` has been renamed to `clippy::map_unwrap_or`
155-
--> tests/ui/rename.rs:90:9
149+
--> tests/ui/rename.rs:89:9
156150
|
157151
LL | #![warn(clippy::option_map_unwrap_or)]
158152
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
159153

160154
error: lint `clippy::option_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
161-
--> tests/ui/rename.rs:91:9
155+
--> tests/ui/rename.rs:90:9
162156
|
163157
LL | #![warn(clippy::option_map_unwrap_or_else)]
164158
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
165159

166160
error: lint `clippy::option_unwrap_used` has been renamed to `clippy::unwrap_used`
167-
--> tests/ui/rename.rs:92:9
161+
--> tests/ui/rename.rs:91:9
168162
|
169163
LL | #![warn(clippy::option_unwrap_used)]
170164
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
171165

172166
error: lint `clippy::overflow_check_conditional` has been renamed to `clippy::panicking_overflow_checks`
173-
--> tests/ui/rename.rs:93:9
167+
--> tests/ui/rename.rs:92:9
174168
|
175169
LL | #![warn(clippy::overflow_check_conditional)]
176170
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::panicking_overflow_checks`
177171

178172
error: lint `clippy::ref_in_deref` has been renamed to `clippy::needless_borrow`
179-
--> tests/ui/rename.rs:94:9
173+
--> tests/ui/rename.rs:93:9
180174
|
181175
LL | #![warn(clippy::ref_in_deref)]
182176
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::needless_borrow`
183177

184178
error: lint `clippy::result_expect_used` has been renamed to `clippy::expect_used`
185-
--> tests/ui/rename.rs:95:9
179+
--> tests/ui/rename.rs:94:9
186180
|
187181
LL | #![warn(clippy::result_expect_used)]
188182
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
189183

190184
error: lint `clippy::result_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
191-
--> tests/ui/rename.rs:96:9
185+
--> tests/ui/rename.rs:95:9
192186
|
193187
LL | #![warn(clippy::result_map_unwrap_or_else)]
194188
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
195189

196190
error: lint `clippy::result_unwrap_used` has been renamed to `clippy::unwrap_used`
197-
--> tests/ui/rename.rs:97:9
191+
--> tests/ui/rename.rs:96:9
198192
|
199193
LL | #![warn(clippy::result_unwrap_used)]
200194
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
201195

196+
error: lint `clippy::reverse_range_loop` has been renamed to `clippy::reversed_empty_ranges`
197+
--> tests/ui/rename.rs:97:9
198+
|
199+
LL | #![warn(clippy::reverse_range_loop)]
200+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::reversed_empty_ranges`
201+
202202
error: lint `clippy::single_char_push_str` has been renamed to `clippy::single_char_add_str`
203203
--> tests/ui/rename.rs:98:9
204204
|
@@ -253,155 +253,161 @@ error: lint `clippy::cmp_nan` has been renamed to `invalid_nan_comparisons`
253253
LL | #![warn(clippy::cmp_nan)]
254254
| ^^^^^^^^^^^^^^^ help: use the new name: `invalid_nan_comparisons`
255255

256-
error: lint `clippy::drop_bounds` has been renamed to `drop_bounds`
256+
error: lint `clippy::double_neg` has been renamed to `double_negations`
257257
--> tests/ui/rename.rs:107:9
258258
|
259+
LL | #![warn(clippy::double_neg)]
260+
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `double_negations`
261+
262+
error: lint `clippy::drop_bounds` has been renamed to `drop_bounds`
263+
--> tests/ui/rename.rs:108:9
264+
|
259265
LL | #![warn(clippy::drop_bounds)]
260266
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds`
261267

262268
error: lint `clippy::drop_copy` has been renamed to `dropping_copy_types`
263-
--> tests/ui/rename.rs:108:9
269+
--> tests/ui/rename.rs:109:9
264270
|
265271
LL | #![warn(clippy::drop_copy)]
266272
| ^^^^^^^^^^^^^^^^^ help: use the new name: `dropping_copy_types`
267273

268274
error: lint `clippy::drop_ref` has been renamed to `dropping_references`
269-
--> tests/ui/rename.rs:109:9
275+
--> tests/ui/rename.rs:110:9
270276
|
271277
LL | #![warn(clippy::drop_ref)]
272278
| ^^^^^^^^^^^^^^^^ help: use the new name: `dropping_references`
273279

280+
error: lint `clippy::fn_address_comparisons` has been renamed to `unpredictable_function_pointer_comparisons`
281+
--> tests/ui/rename.rs:111:9
282+
|
283+
LL | #![warn(clippy::fn_address_comparisons)]
284+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unpredictable_function_pointer_comparisons`
285+
274286
error: lint `clippy::fn_null_check` has been renamed to `useless_ptr_null_checks`
275-
--> tests/ui/rename.rs:110:9
287+
--> tests/ui/rename.rs:112:9
276288
|
277289
LL | #![warn(clippy::fn_null_check)]
278290
| ^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `useless_ptr_null_checks`
279291

280292
error: lint `clippy::for_loop_over_option` has been renamed to `for_loops_over_fallibles`
281-
--> tests/ui/rename.rs:111:9
293+
--> tests/ui/rename.rs:113:9
282294
|
283295
LL | #![warn(clippy::for_loop_over_option)]
284296
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
285297

286298
error: lint `clippy::for_loop_over_result` has been renamed to `for_loops_over_fallibles`
287-
--> tests/ui/rename.rs:112:9
299+
--> tests/ui/rename.rs:114:9
288300
|
289301
LL | #![warn(clippy::for_loop_over_result)]
290302
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
291303

292304
error: lint `clippy::for_loops_over_fallibles` has been renamed to `for_loops_over_fallibles`
293-
--> tests/ui/rename.rs:113:9
305+
--> tests/ui/rename.rs:115:9
294306
|
295307
LL | #![warn(clippy::for_loops_over_fallibles)]
296308
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
297309

298310
error: lint `clippy::forget_copy` has been renamed to `forgetting_copy_types`
299-
--> tests/ui/rename.rs:114:9
311+
--> tests/ui/rename.rs:116:9
300312
|
301313
LL | #![warn(clippy::forget_copy)]
302314
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_copy_types`
303315

304316
error: lint `clippy::forget_ref` has been renamed to `forgetting_references`
305-
--> tests/ui/rename.rs:115:9
317+
--> tests/ui/rename.rs:117:9
306318
|
307319
LL | #![warn(clippy::forget_ref)]
308320
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_references`
309321

310322
error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter`
311-
--> tests/ui/rename.rs:116:9
323+
--> tests/ui/rename.rs:118:9
312324
|
313325
LL | #![warn(clippy::into_iter_on_array)]
314326
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `array_into_iter`
315327

316328
error: lint `clippy::invalid_atomic_ordering` has been renamed to `invalid_atomic_ordering`
317-
--> tests/ui/rename.rs:117:9
329+
--> tests/ui/rename.rs:119:9
318330
|
319331
LL | #![warn(clippy::invalid_atomic_ordering)]
320332
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_atomic_ordering`
321333

322334
error: lint `clippy::invalid_ref` has been renamed to `invalid_value`
323-
--> tests/ui/rename.rs:118:9
335+
--> tests/ui/rename.rs:120:9
324336
|
325337
LL | #![warn(clippy::invalid_ref)]
326338
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_value`
327339

328340
error: lint `clippy::invalid_utf8_in_unchecked` has been renamed to `invalid_from_utf8_unchecked`
329-
--> tests/ui/rename.rs:119:9
341+
--> tests/ui/rename.rs:121:9
330342
|
331343
LL | #![warn(clippy::invalid_utf8_in_unchecked)]
332344
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_from_utf8_unchecked`
333345

334346
error: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
335-
--> tests/ui/rename.rs:120:9
347+
--> tests/ui/rename.rs:122:9
336348
|
337349
LL | #![warn(clippy::let_underscore_drop)]
338350
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
339351

340352
error: lint `clippy::maybe_misused_cfg` has been renamed to `unexpected_cfgs`
341-
--> tests/ui/rename.rs:121:9
353+
--> tests/ui/rename.rs:123:9
342354
|
343355
LL | #![warn(clippy::maybe_misused_cfg)]
344356
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unexpected_cfgs`
345357

346358
error: lint `clippy::mem_discriminant_non_enum` has been renamed to `enum_intrinsics_non_enums`
347-
--> tests/ui/rename.rs:122:9
359+
--> tests/ui/rename.rs:124:9
348360
|
349361
LL | #![warn(clippy::mem_discriminant_non_enum)]
350362
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `enum_intrinsics_non_enums`
351363

352364
error: lint `clippy::mismatched_target_os` has been renamed to `unexpected_cfgs`
353-
--> tests/ui/rename.rs:123:9
365+
--> tests/ui/rename.rs:125:9
354366
|
355367
LL | #![warn(clippy::mismatched_target_os)]
356368
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unexpected_cfgs`
357369

358370
error: lint `clippy::panic_params` has been renamed to `non_fmt_panics`
359-
--> tests/ui/rename.rs:124:9
371+
--> tests/ui/rename.rs:126:9
360372
|
361373
LL | #![warn(clippy::panic_params)]
362374
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `non_fmt_panics`
363375

364376
error: lint `clippy::positional_named_format_parameters` has been renamed to `named_arguments_used_positionally`
365-
--> tests/ui/rename.rs:125:9
377+
--> tests/ui/rename.rs:127:9
366378
|
367379
LL | #![warn(clippy::positional_named_format_parameters)]
368380
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `named_arguments_used_positionally`
369381

370382
error: lint `clippy::temporary_cstring_as_ptr` has been renamed to `dangling_pointers_from_temporaries`
371-
--> tests/ui/rename.rs:126:9
383+
--> tests/ui/rename.rs:128:9
372384
|
373385
LL | #![warn(clippy::temporary_cstring_as_ptr)]
374386
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `dangling_pointers_from_temporaries`
375387

376388
error: lint `clippy::undropped_manually_drops` has been renamed to `undropped_manually_drops`
377-
--> tests/ui/rename.rs:127:9
389+
--> tests/ui/rename.rs:129:9
378390
|
379391
LL | #![warn(clippy::undropped_manually_drops)]
380392
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `undropped_manually_drops`
381393

382394
error: lint `clippy::unknown_clippy_lints` has been renamed to `unknown_lints`
383-
--> tests/ui/rename.rs:128:9
395+
--> tests/ui/rename.rs:130:9
384396
|
385397
LL | #![warn(clippy::unknown_clippy_lints)]
386398
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unknown_lints`
387399

388400
error: lint `clippy::unused_label` has been renamed to `unused_labels`
389-
--> tests/ui/rename.rs:129:9
401+
--> tests/ui/rename.rs:131:9
390402
|
391403
LL | #![warn(clippy::unused_label)]
392404
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unused_labels`
393405

394406
error: lint `clippy::vtable_address_comparisons` has been renamed to `ambiguous_wide_pointer_comparisons`
395-
--> tests/ui/rename.rs:130:9
407+
--> tests/ui/rename.rs:132:9
396408
|
397409
LL | #![warn(clippy::vtable_address_comparisons)]
398410
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `ambiguous_wide_pointer_comparisons`
399411

400-
error: lint `clippy::reverse_range_loop` has been renamed to `clippy::reversed_empty_ranges`
401-
--> tests/ui/rename.rs:131:9
402-
|
403-
LL | #![warn(clippy::reverse_range_loop)]
404-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::reversed_empty_ranges`
405-
406-
error: aborting due to 67 previous errors
412+
error: aborting due to 68 previous errors
407413

0 commit comments

Comments
 (0)
Please sign in to comment.