Skip to content

Commit 2fd855f

Browse files
committed
Auto merge of #145056 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update r? `@Manishearth` Cargo.lock update due to clippy version bump
2 parents 321a89b + 770e6f1 commit 2fd855f

File tree

182 files changed

+2807
-1031
lines changed

Some content is hidden

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

182 files changed

+2807
-1031
lines changed

Cargo.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675"
568568

569569
[[package]]
570570
name = "clippy"
571-
version = "0.1.90"
571+
version = "0.1.91"
572572
dependencies = [
573573
"anstream",
574574
"askama",
@@ -595,7 +595,7 @@ dependencies = [
595595

596596
[[package]]
597597
name = "clippy_config"
598-
version = "0.1.90"
598+
version = "0.1.91"
599599
dependencies = [
600600
"clippy_utils",
601601
"itertools",
@@ -618,7 +618,7 @@ dependencies = [
618618

619619
[[package]]
620620
name = "clippy_lints"
621-
version = "0.1.90"
621+
version = "0.1.91"
622622
dependencies = [
623623
"arrayvec",
624624
"cargo_metadata 0.18.1",
@@ -649,7 +649,7 @@ dependencies = [
649649

650650
[[package]]
651651
name = "clippy_utils"
652-
version = "0.1.90"
652+
version = "0.1.91"
653653
dependencies = [
654654
"arrayvec",
655655
"itertools",
@@ -1051,7 +1051,7 @@ dependencies = [
10511051

10521052
[[package]]
10531053
name = "declare_clippy_lint"
1054-
version = "0.1.90"
1054+
version = "0.1.91"
10551055

10561056
[[package]]
10571057
name = "derive-where"

src/tools/clippy/.github/ISSUE_TEMPLATE/new_lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,24 @@ body:
4848
```
4949
validations:
5050
required: true
51+
- type: textarea
52+
id: comparison
53+
attributes:
54+
label: Comparison with existing lints
55+
description: |
56+
What makes this lint different from any existing lints that are similar, and how are those differences useful?
57+
58+
You can [use this playground template to see what existing lints are triggered by the bad code][playground]
59+
(make sure to use "Tools > Clippy" and not "Build").
60+
You can also look through the list of [rustc's allowed-by-default lints][allowed-by-default],
61+
as those won't show up in the playground above.
62+
63+
[allowed-by-default]: https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html
64+
65+
[playground]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&code=%23%21%5Bwarn%28clippy%3A%3Apedantic%29%5D%0A%23%21%5Bwarn%28clippy%3A%3Anursery%29%5D%0A%23%21%5Bwarn%28clippy%3A%3Arestriction%29%5D%0A%23%21%5Bwarn%28clippy%3A%3Aall%29%5D%0A%23%21%5Ballow%28clippy%3A%3Ablanket_clippy_restriction_lints%2C+reason+%3D+%22testing+to+see+if+any+restriction+lints+match+given+code%22%29%5D%0A%0A%2F%2F%21+Template+that+can+be+used+to+see+what+clippy+lints+a+given+piece+of+code+would+trigger
66+
placeholder: Unlike `clippy::...`, the proposed lint would...
67+
- type: textarea
68+
id: context
69+
attributes:
70+
label: Additional Context
71+
description: Any additional context that you believe may be relevant.

src/tools/clippy/.github/driver.sh

Lines changed: 3 additions & 3 deletions
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/string_to_string.rs 2>string_to_string.stderr && exit 1
51-
sed -e "/= help: for/d" string_to_string.stderr > normalized.stderr
52-
diff -u normalized.stderr tests/ui/string_to_string.stderr
50+
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/char_lit_as_u8.rs 2>char_lit_as_u8.stderr && exit 1
51+
sed -e "/= help: for/d" char_lit_as_u8.stderr > normalized.stderr
52+
diff -u normalized.stderr tests/ui/char_lit_as_u8.stderr
5353

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

src/tools/clippy/CHANGELOG.md

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,105 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[03a5b6b9...master](https://github.com/rust-lang/rust-clippy/compare/03a5b6b9...master)
9+
[4ef75291...master](https://github.com/rust-lang/rust-clippy/compare/4ef75291...master)
10+
11+
## Rust 1.89
12+
13+
Current stable, released 2025-08-07
14+
15+
[View all 137 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2025-05-01T16%3A52%3A57Z..2025-06-13T08%3A33%3A27Z+base%3Amaster)
16+
17+
### New Lints
18+
19+
* Added [`coerce_container_to_any`] to `nursery` [#14812](https://github.com/rust-lang/rust-clippy/pull/14812)
20+
* Added [`ip_constant`] to `pedantic` [#14878](https://github.com/rust-lang/rust-clippy/pull/14878)
21+
* Added [`infallible_try_from`] to `suspicious` [#14813](https://github.com/rust-lang/rust-clippy/pull/14813)
22+
* Added [`doc_suspicious_footnotes`] to `suspicious` [#14708](https://github.com/rust-lang/rust-clippy/pull/14708)
23+
* Added [`pointer_format`] to `restriction` [#14792](https://github.com/rust-lang/rust-clippy/pull/14792)
24+
* Added [`useless_concat`] to `complexity` [#13829](https://github.com/rust-lang/rust-clippy/pull/13829)
25+
* Added [`cloned_ref_to_slice_refs`] to `perf` [#14284](https://github.com/rust-lang/rust-clippy/pull/14284)
26+
* Added [`confusing_method_to_numeric_cast`] to `suspicious` [#13979](https://github.com/rust-lang/rust-clippy/pull/13979)
27+
28+
### Moves and Deprecations
29+
30+
* Removed superseded lints: `transmute_float_to_int`, `transmute_int_to_char`,
31+
`transmute_int_to_float`, `transmute_num_to_bytes` (now in rustc)
32+
[#14703](https://github.com/rust-lang/rust-clippy/pull/14703)
33+
34+
### Enhancements
35+
36+
* [`module_name_repetitions`] added `allow_exact_repetitions` configuration option
37+
[#14261](https://github.com/rust-lang/rust-clippy/pull/14261)
38+
* [`missing_docs_in_private_items`] added `allow_unused` config for underscored fields
39+
[#14453](https://github.com/rust-lang/rust-clippy/pull/14453)
40+
* [`unnecessary_unwrap`] fixed being emitted twice in closure
41+
[#14763](https://github.com/rust-lang/rust-clippy/pull/14763)
42+
* [`needless_return`] lint span no longer wraps to previous line
43+
[#14790](https://github.com/rust-lang/rust-clippy/pull/14790)
44+
* [`trivial-copy-size-limit`] now defaults to `target_pointer_width`
45+
[#13319](https://github.com/rust-lang/rust-clippy/pull/13319)
46+
* [`integer_division`] fixed false negative for NonZero denominators
47+
[#14664](https://github.com/rust-lang/rust-clippy/pull/14664)
48+
* [`arbitrary_source_item_ordering`] no longer lints inside items with `#[repr]` attribute
49+
[#14610](https://github.com/rust-lang/rust-clippy/pull/14610)
50+
* [`excessive_precision`] no longer triggers on exponent with leading zeros
51+
[#14824](https://github.com/rust-lang/rust-clippy/pull/14824)
52+
* [`to_digit_is_some`] no longer lints in const contexts when MSRV is below 1.87
53+
[#14771](https://github.com/rust-lang/rust-clippy/pull/14771)
54+
55+
### False Positive Fixes
56+
57+
* [`std_instead_of_core`] fixed FP when part of the `use` cannot be replaced
58+
[#15016](https://github.com/rust-lang/rust-clippy/pull/15016)
59+
* [`unused_unit`] fixed FP for `Fn` bounds
60+
[#14962](https://github.com/rust-lang/rust-clippy/pull/14962)
61+
* [`unnecessary_debug_formatting`] fixed FP inside `Debug` impl
62+
[#14955](https://github.com/rust-lang/rust-clippy/pull/14955)
63+
* [`assign_op_pattern`] fixed FP on unstable const trait
64+
[#14886](https://github.com/rust-lang/rust-clippy/pull/14886)
65+
* [`useless_conversion`] fixed FP when using `.into_iter().any()`
66+
[#14800](https://github.com/rust-lang/rust-clippy/pull/14800)
67+
* [`collapsible_if`] fixed FP on block stmt before expr
68+
[#14730](https://github.com/rust-lang/rust-clippy/pull/14730)
69+
* [`manual_unwrap_or_default`] fixed FP on ref binding
70+
[#14731](https://github.com/rust-lang/rust-clippy/pull/14731)
71+
* [`unused_async`] fixed FP on default impl
72+
[#14720](https://github.com/rust-lang/rust-clippy/pull/14720)
73+
* [`manual_slice_fill`] fixed FP on `IndexMut` overload
74+
[#14719](https://github.com/rust-lang/rust-clippy/pull/14719)
75+
* [`unnecessary_to_owned`] fixed FP when map key is a reference
76+
[#14834](https://github.com/rust-lang/rust-clippy/pull/14834)
77+
78+
### ICE Fixes
79+
80+
* [`mutable_key_type`] fixed ICE when infinitely associated generic types are used
81+
[#14965](https://github.com/rust-lang/rust-clippy/pull/14965)
82+
* [`zero_sized_map_values`] fixed ICE while computing type layout
83+
[#14837](https://github.com/rust-lang/rust-clippy/pull/14837)
84+
* [`useless_asref`] fixed ICE on trait method
85+
[#14830](https://github.com/rust-lang/rust-clippy/pull/14830)
86+
* [`manual_slice_size_calculation`] fixed ICE in suggestion and triggers in `const` context
87+
[#14804](https://github.com/rust-lang/rust-clippy/pull/14804)
88+
* [`missing_const_for_fn`]: fix ICE with some compilation options
89+
[#14776](https://github.com/rust-lang/rust-clippy/pull/14776)
90+
91+
### Documentation Improvements
92+
93+
* [`manual_contains`] improved documentation wording
94+
[#14917](https://github.com/rust-lang/rust-clippy/pull/14917)
95+
96+
### Performance improvements
97+
98+
* [`strlen_on_c_strings`] optimized by 99.75% (31M → 76k instructions)
99+
[#15043](https://github.com/rust-lang/rust-clippy/pull/15043)
100+
* Reduced documentation lints execution time by 85% (7.5% → 1% of total runtime)
101+
[#14870](https://github.com/rust-lang/rust-clippy/pull/14870)
102+
* [`unit_return_expecting_ord`] optimized to reduce binder instantiation from 95k to 10k calls
103+
[#14905](https://github.com/rust-lang/rust-clippy/pull/14905)
104+
* [`doc_markdown`] optimized by 50%
105+
[#14693](https://github.com/rust-lang/rust-clippy/pull/14693)
106+
* Refactor and speed up `cargo dev fmt`
107+
[#14638](https://github.com/rust-lang/rust-clippy/pull/14638)
10108

11109
## Rust 1.88
12110

@@ -6260,6 +6358,7 @@ Released 2018-09-13
62606358
[`pointers_in_nomem_asm_block`]: https://rust-lang.github.io/rust-clippy/master/index.html#pointers_in_nomem_asm_block
62616359
[`positional_named_format_parameters`]: https://rust-lang.github.io/rust-clippy/master/index.html#positional_named_format_parameters
62626360
[`possible_missing_comma`]: https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_comma
6361+
[`possible_missing_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_else
62636362
[`precedence`]: https://rust-lang.github.io/rust-clippy/master/index.html#precedence
62646363
[`precedence_bits`]: https://rust-lang.github.io/rust-clippy/master/index.html#precedence_bits
62656364
[`print_in_format_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#print_in_format_impl

src/tools/clippy/CONTRIBUTING.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -199,26 +199,34 @@ currently. Between writing new lints, fixing issues, reviewing pull requests and
199199
responding to issues there may not always be enough time to stay on top of it
200200
all.
201201

202-
Our highest priority is fixing [ICEs][I-ICE] and [bugs][C-bug], for example
203-
an ICE in a popular crate that many other crates depend on. We don't
204-
want Clippy to crash on your code and we want it to be as reliable as the
205-
suggestions from Rust compiler errors.
206-
207-
We have prioritization labels and a sync-blocker label, which are described below.
208-
- [P-low][p-low]: Requires attention (fix/response/evaluation) by a team member but isn't urgent.
209-
- [P-medium][p-medium]: Should be addressed by a team member until the next sync.
210-
- [P-high][p-high]: Should be immediately addressed and will require an out-of-cycle sync or a backport.
211-
- [L-sync-blocker][l-sync-blocker]: An issue that "blocks" a sync.
212-
Or rather: before the sync this should be addressed,
213-
e.g. by removing a lint again, so it doesn't hit beta/stable.
202+
To find things to fix, go to the [tracking issue][tracking_issue], find an issue that you like,
203+
and claim it with `@rustbot claim`.
204+
205+
As a general metric and always taking into account your skill and knowledge level, you can use this guide:
206+
207+
- 🟥 [ICEs][search_ice], these are compiler errors that causes Clippy to panic and crash. Usually involves high-level
208+
debugging, sometimes interacting directly with the upstream compiler. Difficult to fix but a great challenge that
209+
improves a lot developer workflows!
210+
211+
- 🟧 [Suggestion causes bug][sugg_causes_bug], Clippy suggested code that changed logic in some silent way.
212+
Unacceptable, as this may have disastrous consequences. Easier to fix than ICEs
213+
214+
- 🟨 [Suggestion causes error][sugg_causes_error], Clippy suggested code snippet that caused a compiler error
215+
when applied. We need to make sure that Clippy doesn't suggest using a variable twice at the same time or similar
216+
easy-to-happen occurrences.
217+
218+
- 🟩 [False positives][false_positive], a lint should not have fired, the easiest of them all, as this is "just"
219+
identifying the root of a false positive and making an exception for those cases.
220+
221+
Note that false negatives do not have priority unless the case is very clear, as they are a feature-request in a
222+
trench coat.
214223

215224
[triage]: https://forge.rust-lang.org/release/triage-procedure.html
216-
[I-ICE]: https://github.com/rust-lang/rust-clippy/labels/I-ICE
217-
[C-bug]: https://github.com/rust-lang/rust-clippy/labels/C-bug
218-
[p-low]: https://github.com/rust-lang/rust-clippy/labels/P-low
219-
[p-medium]: https://github.com/rust-lang/rust-clippy/labels/P-medium
220-
[p-high]: https://github.com/rust-lang/rust-clippy/labels/P-high
221-
[l-sync-blocker]: https://github.com/rust-lang/rust-clippy/labels/L-sync-blocker
225+
[search_ice]: https://github.com/rust-lang/rust-clippy/issues?q=sort%3Aupdated-desc+state%3Aopen+label%3A%22I-ICE%22
226+
[sugg_causes_bug]: https://github.com/rust-lang/rust-clippy/issues?q=sort%3Aupdated-desc%20state%3Aopen%20label%3AI-suggestion-causes-bug
227+
[sugg_causes_error]: https://github.com/rust-lang/rust-clippy/issues?q=sort%3Aupdated-desc%20state%3Aopen%20label%3AI-suggestion-causes-error%20
228+
[false_positive]: https://github.com/rust-lang/rust-clippy/issues?q=sort%3Aupdated-desc%20state%3Aopen%20label%3AI-false-positive
229+
[tracking_issue]: https://github.com/rust-lang/rust-clippy/issues/15086
222230

223231
## Contributions
224232

src/tools/clippy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.90"
3+
version = "0.1.91"
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"

src/tools/clippy/book/src/lint_configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ default configuration of Clippy. By default, any configuration will replace the
555555
* `doc-valid-idents = ["ClipPy"]` would replace the default list with `["ClipPy"]`.
556556
* `doc-valid-idents = ["ClipPy", ".."]` would append `ClipPy` to the default list.
557557

558-
**Default Value:** `["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "MHz", "GHz", "THz", "AccessKit", "CoAP", "CoreFoundation", "CoreGraphics", "CoreText", "DevOps", "Direct2D", "Direct3D", "DirectWrite", "DirectX", "ECMAScript", "GPLv2", "GPLv3", "GitHub", "GitLab", "IPv4", "IPv6", "ClojureScript", "CoffeeScript", "JavaScript", "PostScript", "PureScript", "TypeScript", "WebAssembly", "NaN", "NaNs", "OAuth", "GraphQL", "OCaml", "OpenAL", "OpenDNS", "OpenGL", "OpenMP", "OpenSSH", "OpenSSL", "OpenStreetMap", "OpenTelemetry", "OpenType", "WebGL", "WebGL2", "WebGPU", "WebRTC", "WebSocket", "WebTransport", "WebP", "OpenExr", "YCbCr", "sRGB", "TensorFlow", "TrueType", "iOS", "macOS", "FreeBSD", "NetBSD", "OpenBSD", "TeX", "LaTeX", "BibTeX", "BibLaTeX", "MinGW", "CamelCase"]`
558+
**Default Value:** `["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "MHz", "GHz", "THz", "AccessKit", "CoAP", "CoreFoundation", "CoreGraphics", "CoreText", "DevOps", "Direct2D", "Direct3D", "DirectWrite", "DirectX", "ECMAScript", "GPLv2", "GPLv3", "GitHub", "GitLab", "IPv4", "IPv6", "ClojureScript", "CoffeeScript", "JavaScript", "PostScript", "PureScript", "TypeScript", "WebAssembly", "NaN", "NaNs", "OAuth", "GraphQL", "OCaml", "OpenAL", "OpenDNS", "OpenGL", "OpenMP", "OpenSSH", "OpenSSL", "OpenStreetMap", "OpenTelemetry", "OpenType", "WebGL", "WebGL2", "WebGPU", "WebRTC", "WebSocket", "WebTransport", "WebP", "OpenExr", "YCbCr", "sRGB", "TensorFlow", "TrueType", "iOS", "macOS", "FreeBSD", "NetBSD", "OpenBSD", "NixOS", "TeX", "LaTeX", "BibTeX", "BibLaTeX", "MinGW", "CamelCase"]`
559559

560560
---
561561
**Affected lints:**

src/tools/clippy/clippy_config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_config"
3-
version = "0.1.90"
3+
version = "0.1.91"
44
edition = "2024"
55
publish = false
66

src/tools/clippy/clippy_config/src/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const DEFAULT_DOC_VALID_IDENTS: &[&str] = &[
4444
"WebP", "OpenExr", "YCbCr", "sRGB",
4545
"TensorFlow",
4646
"TrueType",
47-
"iOS", "macOS", "FreeBSD", "NetBSD", "OpenBSD",
47+
"iOS", "macOS", "FreeBSD", "NetBSD", "OpenBSD", "NixOS",
4848
"TeX", "LaTeX", "BibTeX", "BibLaTeX",
4949
"MinGW",
5050
"CamelCase",

src/tools/clippy/clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_lints"
3-
version = "0.1.90"
3+
version = "0.1.91"
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)