Skip to content

Commit d222ddc

Browse files
committed
Auto merge of #151501 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update r? Manishearth `Cargo.lock` update due to Clippy version bump.
2 parents 5944b12 + 2a62479 commit d222ddc

File tree

150 files changed

+6332
-2108
lines changed

Some content is hidden

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

150 files changed

+6332
-2108
lines changed

Cargo.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
630630

631631
[[package]]
632632
name = "clippy"
633-
version = "0.1.94"
633+
version = "0.1.95"
634634
dependencies = [
635635
"anstream",
636636
"askama",
@@ -657,7 +657,7 @@ dependencies = [
657657

658658
[[package]]
659659
name = "clippy_config"
660-
version = "0.1.94"
660+
version = "0.1.95"
661661
dependencies = [
662662
"clippy_utils",
663663
"itertools",
@@ -681,7 +681,7 @@ dependencies = [
681681

682682
[[package]]
683683
name = "clippy_lints"
684-
version = "0.1.94"
684+
version = "0.1.95"
685685
dependencies = [
686686
"arrayvec",
687687
"cargo_metadata 0.18.1",
@@ -713,7 +713,7 @@ dependencies = [
713713

714714
[[package]]
715715
name = "clippy_utils"
716-
version = "0.1.94"
716+
version = "0.1.95"
717717
dependencies = [
718718
"arrayvec",
719719
"itertools",
@@ -1117,7 +1117,7 @@ dependencies = [
11171117

11181118
[[package]]
11191119
name = "declare_clippy_lint"
1120-
version = "0.1.94"
1120+
version = "0.1.95"
11211121

11221122
[[package]]
11231123
name = "derive-where"

src/bootstrap/src/utils/exec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl CommandProfiler {
148148
})
149149
.collect();
150150

151-
entries.sort_by(|a, b| b.2.cmp(&a.2));
151+
entries.sort_by_key(|e| std::cmp::Reverse(e.2));
152152

153153
let total_bootstrap_duration = start_time.elapsed();
154154

src/tools/clippy/CHANGELOG.md

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

77
## Unreleased / Beta / In Rust Nightly
88

9-
[d9fb15c...master](https://github.com/rust-lang/rust-clippy/compare/d9fb15c...master)
9+
[92b4b68...master](https://github.com/rust-lang/rust-clippy/compare/92b4b68...master)
10+
11+
## Rust 1.93
12+
13+
Current stable, released 2026-01-22
14+
15+
[View all 96 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2025-10-17T15%3A48%3A11Z..2025-11-28T19%3A22%3A54Z+base%3Amaster)
16+
17+
### New Lints
18+
19+
* Added [`doc_paragraphs_missing_punctuation`] to `restriction`
20+
[#15758](https://github.com/rust-lang/rust-clippy/pull/15758)
21+
22+
### Moves and Deprecations
23+
24+
* Renamed [`needless_if`] to [`needless_ifs`]
25+
[#15961](https://github.com/rust-lang/rust-clippy/pull/15961)
26+
* Renamed [`empty_enum`] to [`empty_enums`]
27+
[#15912](https://github.com/rust-lang/rust-clippy/pull/15912)
28+
29+
### Enhancements
30+
31+
* [`result_large_err`] added `large_error_ignored` configuration
32+
[#15697](https://github.com/rust-lang/rust-clippy/pull/15697)
33+
* [`explicit_deref_methods`] don't lint in `impl Deref(Mut)`
34+
[#16113](https://github.com/rust-lang/rust-clippy/pull/16113)
35+
* [`missing_docs_in_private_items`] don't lint items in bodies and automatically derived impls;
36+
better detect when things are accessible from the crate root; lint unnameable items which are
37+
accessible outside the crate
38+
[#14741](https://github.com/rust-lang/rust-clippy/pull/14741)
39+
* [`unnecessary_unwrap`] and [`panicking_unwrap`] lint field accesses
40+
[#15949](https://github.com/rust-lang/rust-clippy/pull/15949)
41+
* [`ok_expect`] add autofix
42+
[#15867](https://github.com/rust-lang/rust-clippy/pull/15867)
43+
* [`let_and_return`] disallow _any_ text between let and return
44+
[#16006](https://github.com/rust-lang/rust-clippy/pull/16006)
45+
* [`needless_collect`] extend to lint more cases
46+
[#14361](https://github.com/rust-lang/rust-clippy/pull/14361)
47+
* [`needless_doctest_main`] and [`test_attr_in_doctest`] now handle whitespace in language tags
48+
[#15967](https://github.com/rust-lang/rust-clippy/pull/15967)
49+
* [`search_is_some`] now fixes code spanning multiple lines
50+
[#15902](https://github.com/rust-lang/rust-clippy/pull/15902)
51+
* [`unnecessary_find_map`] and [`unnecessary_filter_map`] make diagnostic spans more precise
52+
[#15929](https://github.com/rust-lang/rust-clippy/pull/15929)
53+
* [`precedence`] warn about ambiguity when a closure is used as a method call receiver
54+
[#14421](https://github.com/rust-lang/rust-clippy/pull/14421)
55+
* [`match_as_ref`] suggest `as_ref` when the reference needs to be cast; improve diagnostics
56+
[#15934](https://github.com/rust-lang/rust-clippy/pull/15934)
57+
[#15928](https://github.com/rust-lang/rust-clippy/pull/15928)
58+
59+
### False Positive Fixes
60+
61+
* [`single_range_in_vec_init`] fix FP for explicit `Range`
62+
[#16043](https://github.com/rust-lang/rust-clippy/pull/16043)
63+
* [`mod_module_files`] fix false positive for integration tests in workspace crates
64+
[#16048](https://github.com/rust-lang/rust-clippy/pull/16048)
65+
* [`replace_box`] fix FP when the box is moved
66+
[#15984](https://github.com/rust-lang/rust-clippy/pull/15984)
67+
* [`len_zero`] fix FP on unstable methods
68+
[#15894](https://github.com/rust-lang/rust-clippy/pull/15894)
1069

1170
## Rust 1.92
1271

@@ -6406,6 +6465,7 @@ Released 2018-09-13
64066465
[`duplicate_mod`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicate_mod
64076466
[`duplicate_underscore_argument`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicate_underscore_argument
64086467
[`duplicated_attributes`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
6468+
[`duration_suboptimal_units`]: https://rust-lang.github.io/rust-clippy/master/index.html#duration_suboptimal_units
64096469
[`duration_subsec`]: https://rust-lang.github.io/rust-clippy/master/index.html#duration_subsec
64106470
[`eager_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#eager_transmute
64116471
[`elidable_lifetime_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
@@ -6607,6 +6667,7 @@ Released 2018-09-13
66076667
[`manual_async_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
66086668
[`manual_bits`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits
66096669
[`manual_c_str_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_c_str_literals
6670+
[`manual_checked_ops`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops
66106671
[`manual_clamp`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
66116672
[`manual_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains
66126673
[`manual_dangling_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_dangling_ptr
@@ -6652,6 +6713,7 @@ Released 2018-09-13
66526713
[`manual_string_new`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new
66536714
[`manual_strip`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
66546715
[`manual_swap`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap
6716+
[`manual_take`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_take
66556717
[`manual_try_fold`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold
66566718
[`manual_unwrap_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or
66576719
[`manual_unwrap_or_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default

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.94"
3+
version = "0.1.95"
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ The minimum rust version that the project supports. Defaults to the `rust-versio
905905
* [`manual_split_once`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_split_once)
906906
* [`manual_str_repeat`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat)
907907
* [`manual_strip`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip)
908+
* [`manual_take`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_take)
908909
* [`manual_try_fold`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold)
909910
* [`map_clone`](https://rust-lang.github.io/rust-clippy/master/index.html#map_clone)
910911
* [`map_unwrap_or`](https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or)

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.94"
3+
version = "0.1.95"
44
edition = "2024"
55
publish = false
66

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ define_Conf! {
780780
manual_split_once,
781781
manual_str_repeat,
782782
manual_strip,
783+
manual_take,
783784
manual_try_fold,
784785
map_clone,
785786
map_unwrap_or,

src/tools/clippy/clippy_config/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
unused_lifetimes,
77
unused_qualifications
88
)]
9-
#![allow(
10-
clippy::must_use_candidate,
11-
clippy::missing_panics_doc,
12-
)]
9+
#![allow(clippy::must_use_candidate, clippy::missing_panics_doc)]
1310
#![deny(clippy::derive_deserialize_allowing_unknown)]
1411

1512
extern crate rustc_data_structures;

src/tools/clippy/clippy_dev/src/deprecate_lint.rs

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::parse::{DeprecatedLint, Lint, ParseCx};
1+
use crate::parse::{DeprecatedLint, Lint, ParseCx, RenamedLint};
22
use crate::update_lints::generate_lint_files;
33
use crate::utils::{UpdateMode, Version};
44
use std::ffi::OsStr;
@@ -61,6 +61,58 @@ pub fn deprecate<'cx>(cx: ParseCx<'cx>, clippy_version: Version, name: &'cx str,
6161
}
6262
}
6363

64+
pub fn uplift<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, old_name: &'env str, new_name: &'env str) {
65+
let mut lints = cx.find_lint_decls();
66+
let (deprecated_lints, mut renamed_lints) = cx.read_deprecated_lints();
67+
68+
let Some(lint) = lints.iter().find(|l| l.name == old_name) else {
69+
eprintln!("error: failed to find lint `{old_name}`");
70+
return;
71+
};
72+
73+
let old_name_prefixed = cx.str_buf.with(|buf| {
74+
buf.extend(["clippy::", old_name]);
75+
cx.arena.alloc_str(buf)
76+
});
77+
for lint in &mut renamed_lints {
78+
if lint.new_name == old_name_prefixed {
79+
lint.new_name = new_name;
80+
}
81+
}
82+
match renamed_lints.binary_search_by(|x| x.old_name.cmp(old_name_prefixed)) {
83+
Ok(_) => {
84+
println!("`{old_name}` is already deprecated");
85+
return;
86+
},
87+
Err(idx) => renamed_lints.insert(
88+
idx,
89+
RenamedLint {
90+
old_name: old_name_prefixed,
91+
new_name,
92+
version: cx.str_buf.alloc_display(cx.arena, clippy_version.rust_display()),
93+
},
94+
),
95+
}
96+
97+
let mod_path = {
98+
let mut mod_path = PathBuf::from(format!("clippy_lints/src/{}", lint.module));
99+
if mod_path.is_dir() {
100+
mod_path = mod_path.join("mod");
101+
}
102+
103+
mod_path.set_extension("rs");
104+
mod_path
105+
};
106+
107+
if remove_lint_declaration(old_name, &mod_path, &mut lints).unwrap_or(false) {
108+
generate_lint_files(UpdateMode::Change, &lints, &deprecated_lints, &renamed_lints);
109+
println!("info: `{old_name}` has successfully been uplifted");
110+
println!("note: you must run `cargo uitest` to update the test results");
111+
} else {
112+
eprintln!("error: lint not found");
113+
}
114+
}
115+
64116
fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint<'_>>) -> io::Result<bool> {
65117
fn remove_lint(name: &str, lints: &mut Vec<Lint<'_>>) {
66118
lints.iter().position(|l| l.name == name).map(|pos| lints.remove(pos));

0 commit comments

Comments
 (0)