Skip to content

Commit 59cec72

Browse files
committed
Auto merge of #132746 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update r? `@Manishearth`
2 parents 209799f + 0aafd65 commit 59cec72

File tree

249 files changed

+5023
-900
lines changed

Some content is hidden

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

249 files changed

+5023
-900
lines changed

Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -2861,7 +2861,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
28612861
checksum = "679341d22c78c6c649893cbd6c3278dcbe9fc4faa62fea3a9296ae2b50c14625"
28622862
dependencies = [
28632863
"bitflags 2.6.0",
2864-
"getopts",
28652864
"memchr",
28662865
"pulldown-cmark-escape 0.11.0",
28672866
"unicase",
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
name: Clippy Dev Test
22

33
on:
4-
push:
5-
branches:
6-
- auto
7-
- try
4+
merge_group:
85
pull_request:
9-
# Only run on paths, that get checked by the clippy_dev tool
10-
paths:
11-
- 'CHANGELOG.md'
12-
- 'README.md'
13-
- '**.stderr'
14-
- '**.rs'
156

167
env:
178
RUST_BACKTRACE: 1
@@ -47,28 +38,21 @@ jobs:
4738
cargo check
4839
git reset --hard HEAD
4940
50-
# These jobs doesn't actually test anything, but they're only used to tell
51-
# bors the build completed, as there is no practical way to detect when a
52-
# workflow is successful listening to webhooks only.
53-
#
54-
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
55-
56-
end-success:
57-
name: bors dev test finished
58-
if: github.event.pusher.name == 'bors' && success()
59-
runs-on: ubuntu-latest
60-
needs: [clippy_dev]
61-
62-
steps:
63-
- name: Mark the job as successful
64-
run: exit 0
65-
66-
end-failure:
67-
name: bors dev test finished
68-
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
41+
conclusion_dev:
42+
needs: [ clippy_dev ]
43+
# We need to ensure this job does *not* get skipped if its dependencies fail,
44+
# because a skipped job is considered a success by GitHub. So we have to
45+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
46+
# when the workflow is canceled manually.
47+
#
48+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
49+
if: ${{ !cancelled() }}
6950
runs-on: ubuntu-latest
70-
needs: [clippy_dev]
71-
7251
steps:
73-
- name: Mark the job as a failure
74-
run: exit 1
52+
# Manually check the status of all dependencies. `if: failure()` does not work.
53+
- name: Conclusion
54+
run: |
55+
# Print the dependent jobs to see them in the CI log
56+
jq -C <<< '${{ toJson(needs) }}'
57+
# Check if all jobs that we depend on (in the needs array) were successful.
58+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

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

+18-33
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
name: Clippy Test (bors)
1+
name: Clippy Test (merge queue)
22

33
on:
4-
push:
5-
branches:
6-
- auto
7-
- try
4+
merge_group:
85

96
env:
107
RUST_BACKTRACE: 1
@@ -13,11 +10,6 @@ env:
1310
CARGO_INCREMENTAL: 0
1411
RUSTFLAGS: -D warnings
1512

16-
concurrency:
17-
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
18-
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
19-
cancel-in-progress: true
20-
2113
defaults:
2214
run:
2315
shell: bash
@@ -218,28 +210,21 @@ jobs:
218210
env:
219211
INTEGRATION: ${{ matrix.integration }}
220212

221-
# These jobs doesn't actually test anything, but they're only used to tell
222-
# bors the build completed, as there is no practical way to detect when a
223-
# workflow is successful listening to webhooks only.
224-
#
225-
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
226-
227-
end-success:
228-
name: bors test finished
229-
if: github.event.pusher.name == 'bors' && success()
213+
conclusion:
214+
needs: [ changelog, base, metadata_collection, integration_build, integration ]
215+
# We need to ensure this job does *not* get skipped if its dependencies fail,
216+
# because a skipped job is considered a success by GitHub. So we have to
217+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
218+
# when the workflow is canceled manually.
219+
#
220+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
221+
if: ${{ !cancelled() }}
230222
runs-on: ubuntu-latest
231-
needs: [changelog, base, metadata_collection, integration_build, integration]
232-
233-
steps:
234-
- name: Mark the job as successful
235-
run: exit 0
236-
237-
end-failure:
238-
name: bors test finished
239-
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
240-
runs-on: ubuntu-latest
241-
needs: [changelog, base, metadata_collection, integration_build, integration]
242-
243223
steps:
244-
- name: Mark the job as a failure
245-
run: exit 1
224+
# Manually check the status of all dependencies. `if: failure()` does not work.
225+
- name: Conclusion
226+
run: |
227+
# Print the dependent jobs to see them in the CI log
228+
jq -C <<< '${{ toJson(needs) }}'
229+
# Check if all jobs that we depend on (in the needs array) were successful.
230+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

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

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
11
name: Clippy Test
22

33
on:
4-
push:
5-
# Ignore bors branches, since they are covered by `clippy_bors.yml`
6-
branches-ignore:
7-
- auto
8-
- try
9-
# Don't run Clippy tests, when only text files were modified
10-
paths-ignore:
11-
- 'COPYRIGHT'
12-
- 'LICENSE-*'
13-
- '**.md'
14-
- '**.txt'
154
pull_request:
16-
# Don't run Clippy tests, when only text files were modified
17-
paths-ignore:
18-
- 'COPYRIGHT'
19-
- 'LICENSE-*'
20-
- '**.md'
21-
- '**.txt'
225

236
env:
247
RUST_BACKTRACE: 1
@@ -35,7 +18,7 @@ concurrency:
3518

3619
jobs:
3720
base:
38-
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
21+
# NOTE: If you modify this job, make sure you copy the changes to clippy_mq.yml
3922
runs-on: ubuntu-latest
4023

4124
steps:
@@ -73,3 +56,24 @@ jobs:
7356
run: .github/driver.sh
7457
env:
7558
OS: ${{ runner.os }}
59+
60+
# We need to have the "conclusion" job also on PR CI, to make it possible
61+
# to add PRs to a merge queue.
62+
conclusion:
63+
needs: [ base ]
64+
# We need to ensure this job does *not* get skipped if its dependencies fail,
65+
# because a skipped job is considered a success by GitHub. So we have to
66+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
67+
# when the workflow is canceled manually.
68+
#
69+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
70+
if: ${{ !cancelled() }}
71+
runs-on: ubuntu-latest
72+
steps:
73+
# Manually check the status of all dependencies. `if: failure()` does not work.
74+
- name: Conclusion
75+
run: |
76+
# Print the dependent jobs to see them in the CI log
77+
jq -C <<< '${{ toJson(needs) }}'
78+
# Check if all jobs that we depend on (in the needs array) were successful.
79+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
run: cargo generate-lockfile
5353

5454
- name: Cache
55-
uses: Swatinem/rust-cache@v2.7.0
55+
uses: Swatinem/rust-cache@v2
5656
with:
5757
save-if: ${{ github.ref == 'refs/heads/master' }}
5858

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

+17-29
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
name: Remark
22

33
on:
4-
push:
5-
branches:
6-
- auto
7-
- try
4+
merge_group:
85
pull_request:
9-
paths:
10-
- '**.md'
116

127
jobs:
138
remark:
@@ -45,28 +40,21 @@ jobs:
4540
- name: Build mdbook
4641
run: mdbook build book
4742

48-
# These jobs doesn't actually test anything, but they're only used to tell
49-
# bors the build completed, as there is no practical way to detect when a
50-
# workflow is successful listening to webhooks only.
51-
#
52-
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
53-
54-
end-success:
55-
name: bors remark test finished
56-
if: github.event.pusher.name == 'bors' && success()
57-
runs-on: ubuntu-latest
58-
needs: [remark]
59-
60-
steps:
61-
- name: Mark the job as successful
62-
run: exit 0
63-
64-
end-failure:
65-
name: bors remark test finished
66-
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
43+
conclusion_remark:
44+
needs: [ remark ]
45+
# We need to ensure this job does *not* get skipped if its dependencies fail,
46+
# because a skipped job is considered a success by GitHub. So we have to
47+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
48+
# when the workflow is canceled manually.
49+
#
50+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
51+
if: ${{ !cancelled() }}
6752
runs-on: ubuntu-latest
68-
needs: [remark]
69-
7053
steps:
71-
- name: Mark the job as a failure
72-
run: exit 1
54+
# Manually check the status of all dependencies. `if: failure()` does not work.
55+
- name: Conclusion
56+
run: |
57+
# Print the dependent jobs to see them in the CI log
58+
jq -C <<< '${{ toJson(needs) }}'
59+
# Check if all jobs that we depend on (in the needs array) were successful.
60+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

src/tools/clippy/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -5331,6 +5331,7 @@ Released 2018-09-13
53315331
[`almost_complete_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_range
53325332
[`almost_swapped`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_swapped
53335333
[`approx_constant`]: https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant
5334+
[`arbitrary_source_item_ordering`]: https://rust-lang.github.io/rust-clippy/master/index.html#arbitrary_source_item_ordering
53345335
[`arc_with_non_send_sync`]: https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
53355336
[`arithmetic_side_effects`]: https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
53365337
[`as_conversions`]: https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
@@ -5689,13 +5690,15 @@ Released 2018-09-13
56895690
[`manual_unwrap_or_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
56905691
[`manual_while_let_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some
56915692
[`many_single_char_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
5693+
[`map_all_any_identity`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity
56925694
[`map_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
56935695
[`map_collect_result_unit`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_collect_result_unit
56945696
[`map_entry`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_entry
56955697
[`map_err_ignore`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
56965698
[`map_flatten`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
56975699
[`map_identity`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_identity
56985700
[`map_unwrap_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
5701+
[`map_with_unused_argument_over_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_with_unused_argument_over_ranges
56995702
[`match_as_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_as_ref
57005703
[`match_bool`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_bool
57015704
[`match_like_matches_macro`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
@@ -5761,6 +5764,7 @@ Released 2018-09-13
57615764
[`mutex_integer`]: https://rust-lang.github.io/rust-clippy/master/index.html#mutex_integer
57625765
[`naive_bytecount`]: https://rust-lang.github.io/rust-clippy/master/index.html#naive_bytecount
57635766
[`needless_arbitrary_self_type`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type
5767+
[`needless_as_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes
57645768
[`needless_bitwise_bool`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_bitwise_bool
57655769
[`needless_bool`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool
57665770
[`needless_bool_assign`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign
@@ -6205,19 +6209,22 @@ Released 2018-09-13
62056209
[`max-trait-bounds`]: https://doc.rust-lang.org/clippy/lint_configuration.html#max-trait-bounds
62066210
[`min-ident-chars-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#min-ident-chars-threshold
62076211
[`missing-docs-in-crate-items`]: https://doc.rust-lang.org/clippy/lint_configuration.html#missing-docs-in-crate-items
6212+
[`module-item-order-groupings`]: https://doc.rust-lang.org/clippy/lint_configuration.html#module-item-order-groupings
62086213
[`msrv`]: https://doc.rust-lang.org/clippy/lint_configuration.html#msrv
62096214
[`pass-by-value-size-limit`]: https://doc.rust-lang.org/clippy/lint_configuration.html#pass-by-value-size-limit
62106215
[`pub-underscore-fields-behavior`]: https://doc.rust-lang.org/clippy/lint_configuration.html#pub-underscore-fields-behavior
62116216
[`semicolon-inside-block-ignore-singleline`]: https://doc.rust-lang.org/clippy/lint_configuration.html#semicolon-inside-block-ignore-singleline
62126217
[`semicolon-outside-block-ignore-multiline`]: https://doc.rust-lang.org/clippy/lint_configuration.html#semicolon-outside-block-ignore-multiline
62136218
[`single-char-binding-names-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#single-char-binding-names-threshold
6219+
[`source-item-ordering`]: https://doc.rust-lang.org/clippy/lint_configuration.html#source-item-ordering
62146220
[`stack-size-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#stack-size-threshold
62156221
[`standard-macro-braces`]: https://doc.rust-lang.org/clippy/lint_configuration.html#standard-macro-braces
62166222
[`struct-field-name-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#struct-field-name-threshold
62176223
[`suppress-restriction-lint-in-const`]: https://doc.rust-lang.org/clippy/lint_configuration.html#suppress-restriction-lint-in-const
62186224
[`too-large-for-stack`]: https://doc.rust-lang.org/clippy/lint_configuration.html#too-large-for-stack
62196225
[`too-many-arguments-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#too-many-arguments-threshold
62206226
[`too-many-lines-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#too-many-lines-threshold
6227+
[`trait-assoc-item-kinds-order`]: https://doc.rust-lang.org/clippy/lint_configuration.html#trait-assoc-item-kinds-order
62216228
[`trivial-copy-size-limit`]: https://doc.rust-lang.org/clippy/lint_configuration.html#trivial-copy-size-limit
62226229
[`type-complexity-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#type-complexity-threshold
62236230
[`unnecessary-box-size`]: https://doc.rust-lang.org/clippy/lint_configuration.html#unnecessary-box-size

src/tools/clippy/CONTRIBUTING.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ All contributors are expected to follow the [Rust Code of Conduct].
2121
- [Rust Analyzer](#rust-analyzer)
2222
- [How Clippy works](#how-clippy-works)
2323
- [Issue and PR triage](#issue-and-pr-triage)
24-
- [Bors and Homu](#bors-and-homu)
2524
- [Contributions](#contributions)
2625
- [License](#license)
2726

@@ -213,26 +212,13 @@ We have prioritization labels and a sync-blocker label, which are described belo
213212
Or rather: before the sync this should be addressed,
214213
e.g. by removing a lint again, so it doesn't hit beta/stable.
215214

216-
## Bors and Homu
217-
218-
We use a bot powered by [Homu][homu] to help automate testing and landing of pull
219-
requests in Clippy. The bot's username is @bors.
220-
221-
You can find the Clippy bors queue [here][homu_queue].
222-
223-
If you have @bors permissions, you can find an overview of the available
224-
commands [here][homu_instructions].
225-
226215
[triage]: https://forge.rust-lang.org/release/triage-procedure.html
227216
[l-crash]: https://github.com/rust-lang/rust-clippy/labels/L-crash
228217
[l-bug]: https://github.com/rust-lang/rust-clippy/labels/L-bug
229218
[p-low]: https://github.com/rust-lang/rust-clippy/labels/P-low
230219
[p-medium]: https://github.com/rust-lang/rust-clippy/labels/P-medium
231220
[p-high]: https://github.com/rust-lang/rust-clippy/labels/P-high
232221
[l-sync-blocker]: https://github.com/rust-lang/rust-clippy/labels/L-sync-blocker
233-
[homu]: https://github.com/rust-lang/homu
234-
[homu_instructions]: https://bors.rust-lang.org/
235-
[homu_queue]: https://bors.rust-lang.org/queue/clippy
236222

237223
## Contributions
238224

@@ -244,7 +230,7 @@ All PRs should include a `changelog` entry with a short comment explaining the c
244230
"what do you believe is important from an outsider's perspective?" Often, PRs are only related to a single property of a
245231
lint, and then it's good to mention that one. Otherwise, it's better to include too much detail than too little.
246232

247-
Clippy's [changelog] is created from these comments. Every release, someone gets all commits from bors with a
233+
Clippy's [changelog] is created from these comments. Every release, someone gets all merge commits with a
248234
`changelog: XYZ` entry and combines them into the changelog. This is a manual process.
249235

250236
Examples:

src/tools/clippy/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ toml = "0.7.3"
3939
walkdir = "2.3"
4040
filetime = "0.2.9"
4141
itertools = "0.12"
42-
pulldown-cmark = "0.11"
42+
pulldown-cmark = { version = "0.11", default-features = false, features = ["html"] }
4343
rinja = { version = "0.3", default-features = false, features = ["config"] }
4444

4545
# UI test dependencies

src/tools/clippy/README.md

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

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)
43
[![License: MIT OR Apache-2.0](https://img.shields.io/crates/l/clippy.svg)](#license)
54

65
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
76

8-
[There are over 700 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
7+
[There are over 750 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
98

109
Lints are divided into categories, each with a default [lint level](https://doc.rust-lang.org/rustc/lints/levels.html).
1110
You can choose how much Clippy is supposed to ~~annoy~~ help you by changing the lint level by category.

0 commit comments

Comments
 (0)