Skip to content

Commit a3ac2f2

Browse files
committed
Auto merge of #153449 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update r? Manishearth Cargo.lock update due to Clippy version bump.
2 parents ff08635 + b17d678 commit a3ac2f2

File tree

307 files changed

+9920
-8630
lines changed

Some content is hidden

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

307 files changed

+9920
-8630
lines changed

Cargo.lock

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

621621
[[package]]
622622
name = "clippy"
623-
version = "0.1.95"
623+
version = "0.1.96"
624624
dependencies = [
625625
"anstream",
626626
"askama",
@@ -647,7 +647,7 @@ dependencies = [
647647

648648
[[package]]
649649
name = "clippy_config"
650-
version = "0.1.95"
650+
version = "0.1.96"
651651
dependencies = [
652652
"clippy_utils",
653653
"itertools",
@@ -671,7 +671,7 @@ dependencies = [
671671

672672
[[package]]
673673
name = "clippy_lints"
674-
version = "0.1.95"
674+
version = "0.1.96"
675675
dependencies = [
676676
"arrayvec",
677677
"cargo_metadata 0.18.1",
@@ -703,7 +703,7 @@ dependencies = [
703703

704704
[[package]]
705705
name = "clippy_utils"
706-
version = "0.1.95"
706+
version = "0.1.96"
707707
dependencies = [
708708
"arrayvec",
709709
"itertools",
@@ -1107,7 +1107,7 @@ dependencies = [
11071107

11081108
[[package]]
11091109
name = "declare_clippy_lint"
1110-
version = "0.1.95"
1110+
version = "0.1.96"
11111111

11121112
[[package]]
11131113
name = "derive-where"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ jobs:
2020
- name: Check Changelog
2121
if: ${{ github.event_name == 'pull_request' }}
2222
run: |
23-
if [[ -z $(grep -oP 'changelog: *\K\S+' <<< "$PR_BODY") ]]; then
23+
# Checks that the PR body contains a changelog entry, ignoring the placeholder from the PR template.
24+
if [[ -z $(grep -oP 'changelog: *\K(?!\[`lint_name`\])\S+' <<< "$PR_BODY") ]]; then
2425
echo "::error::Pull request message must contain 'changelog: ...' with your changelog. Please add it."
2526
exit 1
2627
fi

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.95"
3+
version = "0.1.96"
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/development/the_team.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ this group to help with triaging, which can include:
5151
busy or wants to abandon it. If the reviewer is busy, the PR can be
5252
reassigned to someone else.
5353

54-
Checkout: https://triage.rust-lang.org/triage/rust-lang/rust-clippy to
54+
Checkout: <https://triage.rust-lang.org/triage/rust-lang/rust-clippy> to
5555
monitor PRs.
5656

5757
While not part of their duties, contributors are encouraged to review PRs

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

src/tools/clippy/clippy_dev/src/edit_lints.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::parse::cursor::{self, Capture, Cursor};
22
use crate::parse::{ActiveLint, DeprecatedLint, Lint, LintData, LintName, ParseCx, RenamedLint};
3-
use crate::update_lints::generate_lint_files;
43
use crate::utils::{
54
ErrAction, FileUpdater, UpdateMode, UpdateStatus, Version, delete_dir_if_exists, delete_file_if_exists,
65
expect_action, try_rename_dir, try_rename_file, walk_dir_no_dot_or_target,
@@ -40,7 +39,7 @@ pub fn deprecate<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, name
4039
};
4140

4241
remove_lint_declaration(name, &prev_lint, &data, &mut FileUpdater::default());
43-
generate_lint_files(UpdateMode::Change, &data);
42+
data.gen_decls(UpdateMode::Change);
4443
println!("info: `{name}` has successfully been deprecated");
4544
println!("note: you must run `cargo uitest` to update the test results");
4645
}
@@ -74,7 +73,7 @@ pub fn uplift<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, old_nam
7473
updater.update_file(e.path(), &mut update_fn);
7574
}
7675
}
77-
generate_lint_files(UpdateMode::Change, &data);
76+
data.gen_decls(UpdateMode::Change);
7877
println!("info: `{old_name}` has successfully been uplifted as `{new_name}`");
7978
println!("note: you must run `cargo uitest` to update the test results");
8079
}
@@ -151,7 +150,7 @@ pub fn rename<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, old_nam
151150
updater.update_file(e.path(), &mut update_fn);
152151
}
153152
}
154-
generate_lint_files(UpdateMode::Change, &data);
153+
data.gen_decls(UpdateMode::Change);
155154

156155
println!("Renamed `{old_name}` to `{new_name}`");
157156
println!("All code referencing the old name has been updated");
@@ -172,11 +171,11 @@ fn remove_lint_declaration(name: &str, lint: &ActiveLint<'_>, data: &LintData<'_
172171
delete_file_if_exists(lint.path.as_ref())
173172
} else {
174173
updater.update_file(&lint.path, &mut |_, src, dst| -> UpdateStatus {
175-
let mut start = &src[..lint.declaration_range.start];
174+
let mut start = &src[..lint.declaration_range.start as usize];
176175
if start.ends_with("\n\n") {
177176
start = &start[..start.len() - 1];
178177
}
179-
let mut end = &src[lint.declaration_range.end..];
178+
let mut end = &src[lint.declaration_range.end as usize..];
180179
if end.starts_with("\n\n") {
181180
end = &end[1..];
182181
}

src/tools/clippy/clippy_dev/src/fmt.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
use crate::generate::gen_sorted_lints_file;
2+
use crate::new_parse_cx;
3+
use crate::parse::VecBuf;
14
use crate::utils::{
25
ErrAction, FileUpdater, UpdateMode, UpdateStatus, expect_action, run_with_output, split_args_for_threads,
36
walk_dir_no_dot_or_target,
@@ -326,10 +329,35 @@ fn run_rustfmt(update_mode: UpdateMode) {
326329

327330
// the "main" function of cargo dev fmt
328331
pub fn run(update_mode: UpdateMode) {
329-
run_rustfmt(update_mode);
330332
fmt_syms(update_mode);
331333
if let Err(e) = fmt_conf(update_mode.is_check()) {
332334
e.display();
333335
process::exit(1);
334336
}
337+
338+
new_parse_cx(|cx| {
339+
let mut data = cx.parse_lint_decls();
340+
let (mut lints, passes) = data.split_by_lint_file();
341+
let mut updater = FileUpdater::default();
342+
let mut ranges = VecBuf::with_capacity(256);
343+
344+
for passes in passes {
345+
let path = passes[0].path.clone();
346+
let mut lints = lints.remove(&*path);
347+
let lints = lints.as_deref_mut().unwrap_or_default();
348+
updater.update_file_checked("cargo dev fmt", update_mode, &path, &mut |_, src, dst| {
349+
gen_sorted_lints_file(src, dst, lints, passes, &mut ranges);
350+
UpdateStatus::from_changed(src != dst)
351+
});
352+
}
353+
354+
for (&path, lints) in &mut lints {
355+
updater.update_file_checked("cargo dev fmt", update_mode, path, &mut |_, src, dst| {
356+
gen_sorted_lints_file(src, dst, lints, &mut [], &mut ranges);
357+
UpdateStatus::from_changed(src != dst)
358+
});
359+
}
360+
});
361+
362+
run_rustfmt(update_mode);
335363
}

0 commit comments

Comments
 (0)