Skip to content

Commit 2d76a9d

Browse files
committed
Auto merge of #105827 - flip1995:clippyup, r=matthiaskrgr
Update Clippy r? `@Manishearth`
2 parents 65c53c3 + 10f2a6d commit 2d76a9d

File tree

128 files changed

+2719
-608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+2719
-608
lines changed

Cargo.lock

+12-6
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ dependencies = [
394394
"directories",
395395
"rustc-build-sysroot",
396396
"rustc-workspace-hack",
397-
"rustc_tools_util",
397+
"rustc_tools_util 0.2.1",
398398
"rustc_version",
399399
"serde",
400400
"serde_json",
@@ -658,7 +658,7 @@ dependencies = [
658658

659659
[[package]]
660660
name = "clippy"
661-
version = "0.1.67"
661+
version = "0.1.68"
662662
dependencies = [
663663
"clippy_lints",
664664
"clippy_utils",
@@ -673,7 +673,7 @@ dependencies = [
673673
"regex",
674674
"rustc-semver",
675675
"rustc-workspace-hack",
676-
"rustc_tools_util",
676+
"rustc_tools_util 0.3.0",
677677
"semver",
678678
"serde",
679679
"syn",
@@ -700,7 +700,7 @@ dependencies = [
700700

701701
[[package]]
702702
name = "clippy_lints"
703-
version = "0.1.67"
703+
version = "0.1.68"
704704
dependencies = [
705705
"cargo_metadata 0.14.0",
706706
"clippy_utils",
@@ -723,7 +723,7 @@ dependencies = [
723723

724724
[[package]]
725725
name = "clippy_utils"
726-
version = "0.1.67"
726+
version = "0.1.68"
727727
dependencies = [
728728
"arrayvec",
729729
"if_chain",
@@ -1068,7 +1068,7 @@ checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69"
10681068

10691069
[[package]]
10701070
name = "declare_clippy_lint"
1071-
version = "0.1.67"
1071+
version = "0.1.68"
10721072
dependencies = [
10731073
"itertools",
10741074
"quote",
@@ -4429,6 +4429,12 @@ version = "0.2.1"
44294429
source = "registry+https://github.com/rust-lang/crates.io-index"
44304430
checksum = "598f48ce2a421542b3e64828aa742b687cc1b91d2f96591cfdb7ac5988cd6366"
44314431

4432+
[[package]]
4433+
name = "rustc_tools_util"
4434+
version = "0.3.0"
4435+
source = "registry+https://github.com/rust-lang/crates.io-index"
4436+
checksum = "8ba09476327c4b70ccefb6180f046ef588c26a24cf5d269a9feba316eb4f029f"
4437+
44324438
[[package]]
44334439
name = "rustc_trait_selection"
44344440
version = "0.0.0"

src/tools/clippy/.github/workflows/clippy_bors.yml

-7
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ jobs:
8282
with:
8383
github_token: "${{ secrets.github_token }}"
8484

85-
- name: Install dependencies (Linux-i686)
86-
run: |
87-
sudo dpkg --add-architecture i386
88-
sudo apt-get update
89-
sudo apt-get install gcc-multilib libssl-dev:i386 libgit2-dev:i386
90-
if: matrix.host == 'i686-unknown-linux-gnu'
91-
9285
- name: Checkout
9386
uses: actions/checkout@v3.0.2
9487

src/tools/clippy/CHANGELOG.md

+175-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,181 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[b52fb523...master](https://github.com/rust-lang/rust-clippy/compare/b52fb523...master)
9+
[4f142aa1...master](https://github.com/rust-lang/rust-clippy/compare/4f142aa1...master)
10+
11+
## Rust 1.66
12+
13+
Current stable, released 2022-12-15
14+
15+
[b52fb523...4f142aa1](https://github.com/rust-lang/rust-clippy/compare/b52fb523...4f142aa1)
16+
17+
### New Lints
18+
19+
* [`manual_clamp`]
20+
[#9484](https://github.com/rust-lang/rust-clippy/pull/9484)
21+
* [`missing_trait_methods`]
22+
[#9670](https://github.com/rust-lang/rust-clippy/pull/9670)
23+
* [`unused_format_specs`]
24+
[#9637](https://github.com/rust-lang/rust-clippy/pull/9637)
25+
* [`iter_kv_map`]
26+
[#9409](https://github.com/rust-lang/rust-clippy/pull/9409)
27+
* [`manual_filter`]
28+
[#9451](https://github.com/rust-lang/rust-clippy/pull/9451)
29+
* [`box_default`]
30+
[#9511](https://github.com/rust-lang/rust-clippy/pull/9511)
31+
* [`implicit_saturating_add`]
32+
[#9549](https://github.com/rust-lang/rust-clippy/pull/9549)
33+
* [`as_ptr_cast_mut`]
34+
[#9572](https://github.com/rust-lang/rust-clippy/pull/9572)
35+
* [`disallowed_macros`]
36+
[#9495](https://github.com/rust-lang/rust-clippy/pull/9495)
37+
* [`partial_pub_fields`]
38+
[#9658](https://github.com/rust-lang/rust-clippy/pull/9658)
39+
* [`uninlined_format_args`]
40+
[#9233](https://github.com/rust-lang/rust-clippy/pull/9233)
41+
* [`cast_nan_to_int`]
42+
[#9617](https://github.com/rust-lang/rust-clippy/pull/9617)
43+
44+
### Moves and Deprecations
45+
46+
* `positional_named_format_parameters` was uplifted to rustc under the new name
47+
`named_arguments_used_positionally`
48+
[#8518](https://github.com/rust-lang/rust-clippy/pull/8518)
49+
* Moved [`implicit_saturating_sub`] to `style` (Now warn-by-default)
50+
[#9584](https://github.com/rust-lang/rust-clippy/pull/9584)
51+
* Moved `derive_partial_eq_without_eq` to `nursery` (now allow-by-default)
52+
[#9536](https://github.com/rust-lang/rust-clippy/pull/9536)
53+
54+
### Enhancements
55+
56+
* [`nonstandard_macro_braces`]: Now includes `matches!()` in the default lint config
57+
[#9471](https://github.com/rust-lang/rust-clippy/pull/9471)
58+
* [`suboptimal_flops`]: Now supports multiplication and subtraction operations
59+
[#9581](https://github.com/rust-lang/rust-clippy/pull/9581)
60+
* [`arithmetic_side_effects`]: Now detects cases with literals behind references
61+
[#9587](https://github.com/rust-lang/rust-clippy/pull/9587)
62+
* [`upper_case_acronyms`]: Now also checks enum names
63+
[#9580](https://github.com/rust-lang/rust-clippy/pull/9580)
64+
* [`needless_borrowed_reference`]: Now lints nested patterns
65+
[#9573](https://github.com/rust-lang/rust-clippy/pull/9573)
66+
* [`unnecessary_cast`]: Now works for non-trivial non-literal expressions
67+
[#9576](https://github.com/rust-lang/rust-clippy/pull/9576)
68+
* [`arithmetic_side_effects`]: Now detects operations with custom types
69+
[#9559](https://github.com/rust-lang/rust-clippy/pull/9559)
70+
* [`disallowed_methods`], [`disallowed_types`]: Not correctly lints types, functions and macros
71+
with the same path
72+
[#9495](https://github.com/rust-lang/rust-clippy/pull/9495)
73+
* [`self_named_module_files`], [`mod_module_files`]: Now take remapped path prefixes into account
74+
[#9475](https://github.com/rust-lang/rust-clippy/pull/9475)
75+
* [`bool_to_int_with_if`]: Now detects the inverse if case
76+
[#9476](https://github.com/rust-lang/rust-clippy/pull/9476)
77+
78+
### False Positive Fixes
79+
80+
* [`arithmetic_side_effects`]: Now allows operations that can't overflow
81+
[#9474](https://github.com/rust-lang/rust-clippy/pull/9474)
82+
* [`unnecessary_lazy_evaluations`]: No longer lints in external macros
83+
[#9486](https://github.com/rust-lang/rust-clippy/pull/9486)
84+
* [`needless_borrow`], [`explicit_auto_deref`]: No longer lint on unions that require the reference
85+
[#9490](https://github.com/rust-lang/rust-clippy/pull/9490)
86+
* [`almost_complete_letter_range`]: No longer lints in external macros
87+
[#9467](https://github.com/rust-lang/rust-clippy/pull/9467)
88+
* [`drop_copy`]: No longer lints on idiomatic cases in match arms
89+
[#9491](https://github.com/rust-lang/rust-clippy/pull/9491)
90+
* [`question_mark`]: No longer lints in const context
91+
[#9487](https://github.com/rust-lang/rust-clippy/pull/9487)
92+
* [`collapsible_if`]: Suggestion now work in macros
93+
[#9410](https://github.com/rust-lang/rust-clippy/pull/9410)
94+
* [`std_instead_of_core`]: No longer triggers on unstable modules
95+
[#9545](https://github.com/rust-lang/rust-clippy/pull/9545)
96+
* [`unused_peekable`]: No longer lints, if the peak is done in a closure or function
97+
[#9465](https://github.com/rust-lang/rust-clippy/pull/9465)
98+
* [`useless_attribute`]: No longer lints on `#[allow]` attributes for [`unsafe_removed_from_name`]
99+
[#9593](https://github.com/rust-lang/rust-clippy/pull/9593)
100+
* [`unnecessary_lazy_evaluations`]: No longer suggest switching to early evaluation when type has
101+
custom `Drop` implementation
102+
[#9551](https://github.com/rust-lang/rust-clippy/pull/9551)
103+
* [`unnecessary_cast`]: No longer lints on negative hexadecimal literals when cast as floats
104+
[#9609](https://github.com/rust-lang/rust-clippy/pull/9609)
105+
* [`use_self`]: No longer lints in proc macros
106+
[#9454](https://github.com/rust-lang/rust-clippy/pull/9454)
107+
* [`never_loop`]: Now takes `let ... else` statements into consideration.
108+
[#9496](https://github.com/rust-lang/rust-clippy/pull/9496)
109+
* [`default_numeric_fallback`]: Now ignores constants
110+
[#9636](https://github.com/rust-lang/rust-clippy/pull/9636)
111+
* [`uninit_vec`]: No longer lints `Vec::set_len(0)`
112+
[#9519](https://github.com/rust-lang/rust-clippy/pull/9519)
113+
* [`arithmetic_side_effects`]: Now ignores references to integer types
114+
[#9507](https://github.com/rust-lang/rust-clippy/pull/9507)
115+
* [`large_stack_arrays`]: No longer lints inside static items
116+
[#9466](https://github.com/rust-lang/rust-clippy/pull/9466)
117+
* [`ref_option_ref`]: No longer lints if the inner reference is mutable
118+
[#9684](https://github.com/rust-lang/rust-clippy/pull/9684)
119+
* [`ptr_arg`]: No longer lints if the argument is used as an incomplete trait object
120+
[#9645](https://github.com/rust-lang/rust-clippy/pull/9645)
121+
* [`should_implement_trait`]: Now also works for `default` methods
122+
[#9546](https://github.com/rust-lang/rust-clippy/pull/9546)
123+
124+
### Suggestion Fixes/Improvements
125+
126+
* [`derivable_impls`]: The suggestion is now machine applicable
127+
[#9429](https://github.com/rust-lang/rust-clippy/pull/9429)
128+
* [`match_single_binding`]: The suggestion now handles scrutinies with side effects better
129+
[#9601](https://github.com/rust-lang/rust-clippy/pull/9601)
130+
* [`zero_prefixed_literal`]: Only suggests using octal numbers, if this is possible
131+
[#9652](https://github.com/rust-lang/rust-clippy/pull/9652)
132+
* [`rc_buffer`]: The suggestion is no longer machine applicable to avoid semantic changes
133+
[#9633](https://github.com/rust-lang/rust-clippy/pull/9633)
134+
* [`print_literal`], [`write_literal`], [`uninlined_format_args`]: The suggestion now ignores
135+
comments after the macro call.
136+
[#9586](https://github.com/rust-lang/rust-clippy/pull/9586)
137+
* [`expect_fun_call`]:Improved the suggestion for `format!` calls with captured variables
138+
[#9586](https://github.com/rust-lang/rust-clippy/pull/9586)
139+
* [`nonstandard_macro_braces`]: The suggestion is now machine applicable and will no longer
140+
replace brackets inside the macro argument.
141+
[#9499](https://github.com/rust-lang/rust-clippy/pull/9499)
142+
* [`from_over_into`]: The suggestion is now a machine applicable and contains explanations
143+
[#9649](https://github.com/rust-lang/rust-clippy/pull/9649)
144+
* [`needless_return`]: The automatic suggestion now removes all required semicolons
145+
[#9497](https://github.com/rust-lang/rust-clippy/pull/9497)
146+
* [`to_string_in_format_args`]: The suggestion now keeps parenthesis around values
147+
[#9590](https://github.com/rust-lang/rust-clippy/pull/9590)
148+
* [`manual_assert`]: The suggestion now preserves comments
149+
[#9479](https://github.com/rust-lang/rust-clippy/pull/9479)
150+
* [`redundant_allocation`]: The suggestion applicability is now marked `MaybeIncorrect` to
151+
avoid semantic changes
152+
[#9634](https://github.com/rust-lang/rust-clippy/pull/9634)
153+
* [`assertions_on_result_states`]: The suggestion has been corrected, for cases where the
154+
`assert!` is not in a statement.
155+
[#9453](https://github.com/rust-lang/rust-clippy/pull/9453)
156+
* [`nonminimal_bool`]: The suggestion no longer expands macros
157+
[#9457](https://github.com/rust-lang/rust-clippy/pull/9457)
158+
* [`collapsible_match`]: Now specifies field names, when a struct is destructed
159+
[#9685](https://github.com/rust-lang/rust-clippy/pull/9685)
160+
* [`unnecessary_cast`]: The suggestion now adds parenthesis for negative numbers
161+
[#9577](https://github.com/rust-lang/rust-clippy/pull/9577)
162+
* [`redundant_closure`]: The suggestion now works for `impl FnMut` arguments
163+
[#9556](https://github.com/rust-lang/rust-clippy/pull/9556)
164+
165+
### ICE Fixes
166+
167+
* [`unnecessary_to_owned`]: Avoid ICEs in favor of false negatives if information is missing
168+
[#9505](https://github.com/rust-lang/rust-clippy/pull/9505)
169+
* [`manual_range_contains`]: No longer ICEs on values behind references
170+
[#9627](https://github.com/rust-lang/rust-clippy/pull/9627)
171+
* [`needless_pass_by_value`]: No longer ICEs on unsized `dyn Fn` arguments
172+
[#9531](https://github.com/rust-lang/rust-clippy/pull/9531)
173+
* `*_interior_mutable_const` lints: no longer ICE on const unions containing `!Freeze` types
174+
[#9539](https://github.com/rust-lang/rust-clippy/pull/9539)
175+
176+
### Others
177+
178+
* Released `rustc_tools_util` for version information on `Crates.io`. (Further adjustments will
179+
not be published as part of this changelog)
10180

11181
## Rust 1.65
12182

13-
Current stable, released 2022-11-03
183+
Released 2022-11-03
14184

15185
[3c7e7dbc...b52fb523](https://github.com/rust-lang/rust-clippy/compare/3c7e7dbc...b52fb523)
16186

@@ -3875,6 +4045,7 @@ Released 2018-09-13
38754045
[`alloc_instead_of_core`]: https://rust-lang.github.io/rust-clippy/master/index.html#alloc_instead_of_core
38764046
[`allow_attributes_without_reason`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason
38774047
[`almost_complete_letter_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_letter_range
4048+
[`almost_complete_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_range
38784049
[`almost_swapped`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_swapped
38794050
[`approx_constant`]: https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant
38804051
[`arithmetic_side_effects`]: https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
@@ -4353,6 +4524,8 @@ Released 2018-09-13
43534524
[`self_named_constructors`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors
43544525
[`self_named_module_files`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_module_files
43554526
[`semicolon_if_nothing_returned`]: https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
4527+
[`semicolon_inside_block`]: https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_inside_block
4528+
[`semicolon_outside_block`]: https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_outside_block
43564529
[`separated_literal_suffix`]: https://rust-lang.github.io/rust-clippy/master/index.html#separated_literal_suffix
43574530
[`serde_api_misuse`]: https://rust-lang.github.io/rust-clippy/master/index.html#serde_api_misuse
43584531
[`shadow_reuse`]: https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse

src/tools/clippy/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.67"
3+
version = "0.1.68"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"
@@ -23,7 +23,7 @@ path = "src/driver.rs"
2323
[dependencies]
2424
clippy_lints = { path = "clippy_lints" }
2525
semver = "1.0"
26-
rustc_tools_util = "0.2.1"
26+
rustc_tools_util = "0.3.0"
2727
tempfile = { version = "3.2", optional = true }
2828
termize = "0.1"
2929

@@ -55,7 +55,7 @@ tokio = { version = "1", features = ["io-util"] }
5555
rustc-semver = "1.1"
5656

5757
[build-dependencies]
58-
rustc_tools_util = "0.2.1"
58+
rustc_tools_util = "0.3.0"
5959

6060
[features]
6161
deny-warnings = ["clippy_lints/deny-warnings"]

src/tools/clippy/book/src/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Clippy
22

3-
[![Clippy Test](https://github.com/rust-lang/rust-clippy/workflows/Clippy%20Test/badge.svg?branch=auto&event=push)](https://github.com/rust-lang/rust-clippy/actions?query=workflow%3A%22Clippy+Test%22+event%3Apush+branch%3Aauto)
3+
[![Clippy Test](https://github.com/rust-lang/rust-clippy/workflows/Clippy%20Test%20(bors)/badge.svg?branch=auto&event=push)](https://github.com/rust-lang/rust-clippy/actions?query=workflow%3A%22Clippy+Test+(bors)%22+event%3Apush+branch%3Aauto)
44
[![License: MIT OR Apache-2.0](https://img.shields.io/crates/l/clippy.svg)](https://github.com/rust-lang/rust-clippy#license)
55

66
A collection of lints to catch common mistakes and improve your

src/tools/clippy/build.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,5 @@ fn main() {
33
println!("cargo:rustc-env=PROFILE={}", std::env::var("PROFILE").unwrap());
44
// Don't rebuild even if nothing changed
55
println!("cargo:rerun-if-changed=build.rs");
6-
// forward git repo hashes we build at
7-
println!(
8-
"cargo:rustc-env=GIT_HASH={}",
9-
rustc_tools_util::get_commit_hash().unwrap_or_default()
10-
);
11-
println!(
12-
"cargo:rustc-env=COMMIT_DATE={}",
13-
rustc_tools_util::get_commit_date().unwrap_or_default()
14-
);
15-
println!(
16-
"cargo:rustc-env=RUSTC_RELEASE_CHANNEL={}",
17-
rustc_tools_util::get_channel()
18-
);
6+
rustc_tools_util::setup_version_info!();
197
}

src/tools/clippy/clippy_lints/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_lints"
3-
version = "0.1.67"
3+
version = "0.1.68"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"

0 commit comments

Comments
 (0)