Skip to content

Clippy subtree update #139337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 184 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
e0175f8
Document how to benchmark with lintcheck --perf
blyxyas Feb 10, 2025
0ee39a2
Several improvements on lintcheck perf (desc.)
blyxyas Feb 10, 2025
4035fc2
Follow remark guidelines
blyxyas Feb 10, 2025
9c3b5cf
more natural suggestions for `cmp_owned`
lapla-cogito Feb 18, 2025
f04bfae
correct version attribute for `io_other_error`
lapla-cogito Feb 23, 2025
517766c
Update as_conversions.rs
dnbln Feb 23, 2025
92fc2bb
Emit `collapsible_match` at the right node
Alexendoo Feb 27, 2025
e1d6f1f
Use a lintcheck specific Clippy configuration file in the CI
samueltardieu Feb 16, 2025
3caa1f2
Add regression tests for `suspicious_doc_comments`
samueltardieu Feb 21, 2025
10cf3cb
Add helper methods checking for "#[non_exhaustive] that's active"
meithecatte Mar 3, 2025
0af0445
Make `visit_map` happy path more evident
smoelius Mar 8, 2025
1066ee0
fix: `redundant_clone` FP on enum cast
profetia Mar 12, 2025
80ce9d1
fix: `borrow_deref_ref` suggests wrongly when coerce to mut
profetia Mar 13, 2025
95d7281
fix: `manual_find` suggests wrongly when early return
profetia Mar 14, 2025
9576c71
Teach rustfmt to handle postfix yield
eholk Mar 13, 2025
ed1778c
Fix clippy
eholk Mar 13, 2025
17351bd
Change frequency to 3000
blyxyas Feb 16, 2025
1fdb9cf
Merge from rustc
Mar 16, 2025
ae3216e
Add comment annotations
heshanpadmasiri Mar 16, 2025
5d7e55c
Mention about .fixed files
heshanpadmasiri Mar 17, 2025
6cf2d72
expand: Leave traces when expanding `cfg_attr` attributes
petrochenkov Mar 14, 2025
e3f1bc8
Refactor YieldKind so postfix yield must have an expression
eholk Mar 18, 2025
22be689
extend `obfuscated_if_else` to support `.then().unwrap_or_default()` …
lapla-cogito Mar 18, 2025
e4daa5a
apply `obfuscated_if_else` to clippy source
lapla-cogito Mar 18, 2025
dd92647
Use `Option<Ident>` for lowered param names.
nnethercote Mar 13, 2025
a463154
set the applicability of `op_ref` to `MachineApplicable`
lapla-cogito Mar 19, 2025
e85fcab
Rollup merge of #138001 - meithecatte:privately-uninhabited, r=Nadrieril
matthiaskrgr Mar 19, 2025
8b5e701
Merge from rustc
Mar 20, 2025
919e767
Rollup merge of #138435 - eholk:prefix-yield, r=oli-obk
matthiaskrgr Mar 20, 2025
d9aec19
Rollup merge of #138685 - nnethercote:use-Option-Ident-for-lowered-pa…
matthiaskrgr Mar 20, 2025
6fb13c6
Auto merge of #138515 - petrochenkov:cfgtrace, r=nnethercote
bors Mar 20, 2025
3d0d04c
Rollup merge of #138435 - eholk:prefix-yield, r=oli-obk
matthiaskrgr Mar 20, 2025
e18fe28
Rollup merge of #138685 - nnethercote:use-Option-Ident-for-lowered-pa…
matthiaskrgr Mar 20, 2025
c86216e
Merge commit '1e5237f4a56ae958af7e5824343eacf737b67083' into clippy-s…
flip1995 Mar 20, 2025
c128221
Auto merge of #138747 - matthiaskrgr:rollup-68x44rw, r=matthiaskrgr
bors Mar 20, 2025
19c7c46
rename `rust-toolchain` to `rust-toolchain.toml`
lapla-cogito Mar 20, 2025
aadda46
Add `ignore_without_reason` lint
smoelius Jan 2, 2025
475d10d
Add test annotation
smoelius Mar 3, 2025
25f1f90
Auto merge of #138760 - matthiaskrgr:rollup-2edtg2h, r=matthiaskrgr
bors Mar 21, 2025
721ac28
fix: `filter_map_bool_then` suggest wrongly when contain return
profetia Mar 7, 2025
3f9ecbe
fix: `filter_map_bool_then`: suggests wrongly when mut capture in then
profetia Mar 11, 2025
4f2ee8c
Auto merge of #138761 - flip1995:clippy-subtree-update, r=Manishearth
bors Mar 21, 2025
6c8400e
remove `feature(inline_const_pat)`
lcnr Mar 14, 2025
90f5f55
rename `rust-toolchain` to `rust-toolchain.toml` (#14442)
flip1995 Mar 21, 2025
7a92626
fix: `filter_map_bool_then` suggest wrongly when the closure cannot b…
blyxyas Mar 21, 2025
da4f5a5
expand `neg_multiply` to lint float numbers as well
lapla-cogito Mar 21, 2025
07f7a9e
Merge from rustc
RalfJung Mar 21, 2025
c418714
expand `neg_multiply` to lint float numbers as well (#14447)
dswij Mar 21, 2025
0a141ab
fix: `redundant_clone` FP on enum cast (#14395)
dswij Mar 21, 2025
5b234c9
Change category to pedantic
smoelius Mar 21, 2025
d5a6688
Use a lintcheck specific Clippy configuration file in the CI (#14233)
flip1995 Mar 22, 2025
37e1b80
fix: `manual_find` suggests wrongly when early return (#14405)
flip1995 Mar 22, 2025
cdf2e7c
fix: `borrow_deref_ref` suggests wrongly when coerce to mut (#14403)
flip1995 Mar 22, 2025
e8e0126
Add comment annotations (#14414)
flip1995 Mar 22, 2025
8238160
Lint more cases in `collapsible_if`
samueltardieu Feb 16, 2025
d993432
set the applicability of `op_ref` to `MachineApplicable` (#14438)
Jarcho Mar 22, 2025
282b61b
fix: `nonminimal_bool` wrongly showed the macro definition
profetia Mar 17, 2025
b41f2e4
Emit `collapsible_match` at the right node (#14311)
Jarcho Mar 22, 2025
a65cc36
Add regression tests for `suspicious_doc_comments` (#14268)
Jarcho Mar 22, 2025
6166f60
Add `ignore_without_reason` lint (#13931)
Alexendoo Mar 22, 2025
c033a4c
Document and improve (a lot) lintcheck --perf (#14194)
Alexendoo Mar 23, 2025
8bc164b
fix: `option_if_let_else` suggests wrongly when coercion
profetia Mar 23, 2025
63e7815
Fix example for unconditional_recursion
alex-semenyuk Mar 10, 2025
cad9083
Lint more cases in `collapsible_if` (#14231)
flip1995 Mar 23, 2025
07e7414
fix: `nonminimal_bool` wrongly showed the macro definition (#14424)
flip1995 Mar 23, 2025
d8dff61
set concurrency for the `deploy` job
lapla-cogito Mar 21, 2025
3786c07
remove the notation of the `deploy` job
lapla-cogito Mar 23, 2025
e9aed87
set concurrency for the `deploy` job (#14448)
flip1995 Mar 23, 2025
b27a2bb
Clarify example for unconditional_recursion (#14385)
Alexendoo Mar 23, 2025
88b590b
`lint-inconsistent-...` -> `check-inconsistent-...`
smoelius Feb 23, 2025
969b5ad
Don't suggests deprecated congurations
smoelius Feb 23, 2025
de3aa1d
Add new lint `manual_dangling_ptr`
aaron-ang Feb 21, 2025
7b1f9d8
Update tests files for `manual_dangling_ptr` lint
aaron-ang Feb 21, 2025
962329f
Rename `Sugg::maybe_par()` into `Sugg::maybe_paren()`
samueltardieu Mar 24, 2025
315e9aa
Don't check deprecated configs in `configs_are_tested` test
smoelius Mar 8, 2025
e8c06a7
remove obsolete "Known Problems" in `ok_expect`
lapla-cogito Mar 24, 2025
809c931
`wildcard_imports`: lint on `pub use` if asked to
samueltardieu Feb 9, 2025
621911a
Fix various typos in lint messages, descriptions and comments
samueltardieu Mar 24, 2025
9c6cb51
`wildcard_imports`: lint on `pub use` if asked to (#14182)
y21 Mar 25, 2025
0ff7fad
Use `code` for references to other lints in as_conversions docs (#14283)
samueltardieu Mar 25, 2025
de8c404
Fix type error in lint description
samueltardieu Mar 25, 2025
b7cbb4e
Add myself to reviewer rotation
samueltardieu Mar 25, 2025
ca48e46
Add myself to reviewer rotation (#14468)
samueltardieu Mar 25, 2025
d88818d
Rename `inconsistent_struct_constructor` configuration; don't suggest…
y21 Mar 25, 2025
f5d81a3
Fix type error in lint description (#14466)
blyxyas Mar 25, 2025
e78216c
suggest `is_some_and` instead of `map_or` in `case_sensitive_file_ext…
lapla-cogito Mar 6, 2025
1d89038
Move `uninlined_format_args` to `style`
nyurik Feb 6, 2025
d063e09
Move `uninlined_format_args` to `style`
nyurik Feb 15, 2025
8e50cfa
make tests consistent
nyurik Feb 16, 2025
9d78426
suggest `is_some_and` instead of `map_or` in `case_sensitive_file_ext…
samueltardieu Mar 25, 2025
1ca79a8
test fixes
nyurik Mar 25, 2025
d95bdcf
Rename `Sugg::maybe_par()` into `Sugg::maybe_paren()` (#14457)
blyxyas Mar 25, 2025
a001ae3
Move `uninlined_format_args` back to `style` (#14160)
Alexendoo Mar 25, 2025
aba76d0
Allow defining opaques in statics and consts
compiler-errors Mar 24, 2025
94233fb
Unify `manual_unwrap_or` and `manual_unwrap_or_default` code
samueltardieu Mar 1, 2025
1893e1e
Unify `manual_unwrap_or` and `manual_unwrap_or_default` code (#14332)
Manishearth Mar 25, 2025
6509de3
Fix situations identified by `collapsible_if` new hits
samueltardieu Feb 16, 2025
d09e658
Apply collapsible if to Clippy sources (#14451)
flip1995 Mar 25, 2025
4517b42
Fix various typos in lint messages, descriptions and comments (#14459)
dswij Mar 26, 2025
939d5f9
fix: `option_if_let_else` suggests wrongly when coercion requires exp…
dswij Mar 26, 2025
a8bfafe
chore: fix some comments
todaymoon Mar 26, 2025
fe4dd5b
chore: fix some comments (#14475)
samueltardieu Mar 26, 2025
1b92712
expand: Leave traces when expanding `cfg` attributes
petrochenkov Mar 22, 2025
9b1945d
Prevent including preceeding whitespaces if line contains non blanks
samueltardieu Mar 26, 2025
c4789a0
Prevent including preceeding whitespaces if line contains non blanks …
Manishearth Mar 26, 2025
3e52867
more natural suggestions for `cmp_owned` (#14247)
Centri3 Mar 27, 2025
764c1b6
remove obsolete "Known Problems" in `ok_expect` (#14458)
dswij Mar 27, 2025
d9913dd
Do not warn about shadowing in a destructuring assigment
samueltardieu Mar 9, 2025
a895265
Do not warn about shadowing in a destructuring assigment (#14381)
samueltardieu Mar 27, 2025
9df5177
Convert the `collapsible_if` early lint to a late one
samueltardieu Mar 26, 2025
cd70152
Make `collapsible_if` recognize the `let_chains` feature
samueltardieu Mar 26, 2025
79c6911
Apply `collapsible_if` to Clippy itself
samueltardieu Mar 26, 2025
01820a9
Do not make incomplete or invalid suggestions
samueltardieu Mar 27, 2025
61b38e7
Do not make incomplete or invalid suggestions (#14487)
Manishearth Mar 27, 2025
c2922d1
Make `collapsible_if` recognize the `let_chains` feature (#14481)
flip1995 Mar 28, 2025
3e960c1
Make missing_const_for_fn operate on non-optimized MIR
1c3t3a Jan 15, 2025
d78622e
Make missing_const_for_fn operate on non-optimized MIR (#14003)
blyxyas Mar 28, 2025
ecb421f
Rollup merge of #139065 - RalfJung:miri-sync, r=RalfJung
matthiaskrgr Mar 28, 2025
432a8a7
Properly handle expansion in `single_match`
samueltardieu Mar 28, 2025
bc70192
Take advantage of match ergonomics in `clippy_utils::hir_utils`
samueltardieu Mar 29, 2025
bc28421
Take advantage of match ergonomics in `clippy_utils::hir_utils` (#14499)
dswij Mar 29, 2025
2df6bba
fix: `unnested_or_patterns` suggests wrongly in `let`
profetia Mar 13, 2025
4c610e3
fix: `unnested_or_patterns` suggests wrongly in `let` (#14401)
y21 Mar 29, 2025
ffaecd0
manually fulfill lint expectations for all unsafe blocks with metavars
y21 Mar 29, 2025
8f3a0db
don't hardcode repository owner in changelog CI
y21 Mar 29, 2025
fb32aaf
new lint: `chars_enumerate_for_byte_indices`
y21 Sep 21, 2024
32cf884
add a note for `str::bytes`
y21 Dec 3, 2024
d5d2189
rename lint to `char_indices_as_byte_indices`
y21 Dec 3, 2024
c739027
add comment and `.clone()` test case
y21 Mar 30, 2025
2eee361
use `is_automatically_derived()` instead of `has_attr(sym::automatica…
WeiTheShinobi Mar 30, 2025
cd67b3b
Don't hardcode repository in changelog CI (#14500)
flip1995 Mar 30, 2025
4f58673
new lint: `char_indices_as_byte_indices` (#13435)
Centri3 Mar 30, 2025
5f26d0e
Drop `clippy::invalid_null_ptr_usage`
Urgau Mar 9, 2025
eee7c58
use `is_automatically_derived()` instead of `has_attr()` (#14506)
Jarcho Mar 31, 2025
5791b9c
Auto merge of #119220 - Urgau:uplift-invalid_null_ptr_usage, r=fee1-dead
bors Mar 31, 2025
b46b311
add `manual_dangling_ptr` lint (#14107)
Jarcho Mar 31, 2025
bb0d09b
Make `visit_map` happy path more evident (#14376)
Jarcho Mar 31, 2025
9172556
Suggest `./x test src/tools/clippy --bless` when in `rust-lang/rust`
Alexendoo Mar 31, 2025
ce39784
Move `FindPanicUnwrap` to `missing_headers.rs`
Alexendoo Mar 14, 2025
c893685
Fix partially const bodies not linting `missing_panics_doc`
Alexendoo Mar 14, 2025
6ee4f34
Abide by `allow`/`expect` in bodies for `missing_panics_doc`
Alexendoo Mar 14, 2025
f894a81
Fulfill expectations after first `missing-panics-doc`
Alexendoo Mar 22, 2025
b96fecf
Allow `#[expect]` and `#[allow]` within function bodies for `missing_…
Jarcho Mar 31, 2025
3e837ec
Enable triagebot's merge conflict notifications
Alexendoo Mar 31, 2025
1e78abc
expand `obfuscated_if_else` to support `{then(), then_some()}.unwrap_…
Manishearth Mar 31, 2025
7d3d824
Properly handle expansion in `single_match` (#14495)
Manishearth Mar 31, 2025
9e6c7af
Suggest `./x test src/tools/clippy --bless` when in `rust-lang/rust` …
flip1995 Mar 31, 2025
6366e31
Enable triagebot's merge conflict notifications (#14508)
flip1995 Mar 31, 2025
a50fb22
Avoid `kw::Empty` use for `AuxParamsAttr`.
nnethercote Mar 27, 2025
d28d234
correct version attribute for `io_other_error` (#14282)
samueltardieu Mar 31, 2025
5101c8e
Move `ast::Item::ident` into `ast::ItemKind`.
nnethercote Mar 20, 2025
3f752b4
Address review comments.
nnethercote Apr 1, 2025
93d0885
Auto merge of #138740 - nnethercote:ast-ItemKind-idents, r=fmease
bors Apr 1, 2025
86e6cb5
Decouple trait impls of different traits wrt incremental
oli-obk Mar 27, 2025
88c46ea
Install cmake to restore lintcheck run
samueltardieu Apr 1, 2025
4304fa2
Auto merge of #138492 - lcnr:rm-inline_const_pat, r=oli-obk
bors Apr 1, 2025
54994b2
Fix the primary span of redundant_pub_crate when flagging nameless items
fmease Apr 1, 2025
227e43a
Install cmake to restore lintcheck runs (#14514)
Alexendoo Apr 1, 2025
6ca6b09
Fix the primary span of `redundant_pub_crate` when flagging nameless …
Manishearth Apr 1, 2025
d81396b
Do not build `tokio-rustls` in the CI for the time being
samueltardieu Apr 1, 2025
46878e3
Do not build `tokio-rustls` in the CI for the time being (#14517)
Alexendoo Apr 1, 2025
e429bde
Manually fulfill lint expectations for all unsafe blocks with metavar…
blyxyas Apr 1, 2025
dc7d9ec
Validate paths in `disallowed_*` configurations
smoelius Mar 12, 2025
e975563
Validate paths in `disallowed_*` configurations (#14397)
samueltardieu Apr 1, 2025
130af3f
Move methods from `Map` to `TyCtxt`, part 5.
nnethercote Apr 1, 2025
777c7cd
Remove a function that has no necessary callers
oli-obk Apr 1, 2025
2e181e7
Auto merge of #139018 - oli-obk:incremental-trait-impls, r=compiler-e…
bors Apr 2, 2025
2d119ce
Stop relabelling PRs with merge conflicts
Alexendoo Apr 2, 2025
978ed96
Rollup merge of #139232 - nnethercote:remove-Map-5, r=Zalathar
TaKO8Ki Apr 2, 2025
0ca62d1
Stop relabelling PRs with merge conflicts (#14521)
flip1995 Apr 2, 2025
416acd8
Don't use `f16` and `f128` directly in `clippy_utils`
beetrees Apr 2, 2025
6f0f22c
Fix a typo in derive.rs comment
smoelius Apr 3, 2025
f9a1a1f
Fix a typo in derive.rs comment (#14529)
samueltardieu Apr 3, 2025
193e9f2
Don't use `f16` and `f128` directly in `clippy_utils` (#14528)
Jarcho Apr 3, 2025
893a6a3
Update to new rinja version (askama)
GuillaumeGomez Apr 3, 2025
41d7e45
Update to new rinja version (askama) (#14530)
flip1995 Apr 3, 2025
ab7e525
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Apr 3, 2025
c44191a
Bump nightly version -> 2025-04-03
flip1995 Apr 3, 2025
c97bd74
Bump Clippy version -> 0.1.88
flip1995 Apr 3, 2025
944dfc7
Changelog for Clippy 1.86
flip1995 Apr 3, 2025
a2251a8
Changelog for Clippy 1.86 :penguin: (#14538)
y21 Apr 3, 2025
7bb54d9
Rustup (#14539)
flip1995 Apr 3, 2025
7be4565
Merge commit '7bb54d91be1af212faaa078786c1d2271a67d4f9' into clippy-s…
flip1995 Apr 3, 2025
57b6898
Update Cargo.lock
flip1995 Apr 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
63 changes: 57 additions & 6 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,48 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"

[[package]]
name = "askama"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a4e46abb203e00ef226442d452769233142bbfdd79c3941e84c8e61c4112543"
dependencies = [
"askama_derive",
"itoa",
"percent-encoding",
"serde",
"serde_json",
]

[[package]]
name = "askama_derive"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54398906821fd32c728135f7b351f0c7494ab95ae421d41b6f5a020e158f28a6"
dependencies = [
"askama_parser",
"basic-toml",
"memchr",
"proc-macro2",
"quote",
"rustc-hash 2.1.1",
"serde",
"serde_derive",
"syn 2.0.100",
]

[[package]]
name = "askama_parser"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf315ce6524c857bb129ff794935cf6d42c82a6cff60526fe2a63593de4d0d4f"
dependencies = [
"memchr",
"serde",
"serde_derive",
"winnow 0.7.4",
]

[[package]]
name = "autocfg"
version = "1.4.0"
Expand Down Expand Up @@ -504,9 +546,10 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"

[[package]]
name = "clippy"
version = "0.1.87"
version = "0.1.88"
dependencies = [
"anstream",
"askama",
"cargo_metadata 0.18.1",
"clippy_config",
"clippy_lints",
Expand All @@ -520,7 +563,6 @@ dependencies = [
"pulldown-cmark 0.11.3",
"quote",
"regex",
"rinja",
"rustc_tools_util 0.4.2",
"serde",
"serde_json",
Expand All @@ -535,7 +577,7 @@ dependencies = [

[[package]]
name = "clippy_config"
version = "0.1.87"
version = "0.1.88"
dependencies = [
"clippy_utils",
"itertools",
Expand All @@ -560,7 +602,7 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.87"
version = "0.1.88"
dependencies = [
"arrayvec",
"cargo_metadata 0.18.1",
Expand All @@ -583,7 +625,7 @@ dependencies = [

[[package]]
name = "clippy_utils"
version = "0.1.87"
version = "0.1.88"
dependencies = [
"arrayvec",
"itertools",
Expand Down Expand Up @@ -5418,7 +5460,7 @@ dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
"winnow 0.5.40",
]

[[package]]
Expand Down Expand Up @@ -6429,6 +6471,15 @@ dependencies = [
"memchr",
]

[[package]]
name = "winnow"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36"
dependencies = [
"memchr",
]

[[package]]
name = "winsplit"
version = "0.1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/.github/workflows/clippy_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Check Changelog
if: ${{ github.event_name == 'pull_request' }}
run: |
body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR_NUMBER" | \
body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" | \
python -c "import sys, json; print(json.load(sys.stdin)['body'])")
output=$(awk '/^changelog:\s*\S/ && !/changelog: \[.*\]: your change/' <<< "$body" | sed "s/changelog:\s*//g")
if [ -z "$output" ]; then
Expand Down
4 changes: 4 additions & 0 deletions src/tools/clippy/.github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
tags:
- rust-1.**

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

env:
TARGET_BRANCH: 'gh-pages'
SHA: '${{ github.sha }}'
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/.github/workflows/lintcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:

- name: Run lintcheck
if: steps.cache-json.outputs.cache-hit != 'true'
run: ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml

- name: Upload base JSON
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
run: cargo build --manifest-path=lintcheck/Cargo.toml

- name: Run lintcheck
run: ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml

- name: Upload head JSON
uses: actions/upload-artifact@v4
Expand Down
67 changes: 64 additions & 3 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,68 @@ document.

## Unreleased / Beta / In Rust Nightly

[609cd310...master](https://github.com/rust-lang/rust-clippy/compare/609cd310...master)
[3e3715c3...master](https://github.com/rust-lang/rust-clippy/compare/3e3715c3...master)

## Rust 1.86

Current stable, released 2025-04-03

[View all 108 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-12-27T15%3A11%3A38Z..2025-02-06T13%3A57%3A58Z+base%3Amaster)

### New Lints

* Added [`unneeded_struct_pattern`] to `style` [#13465](https://github.com/rust-lang/rust-clippy/pull/13465)
* Added [`doc_overindented_list_items`] to `style` [#13711](https://github.com/rust-lang/rust-clippy/pull/13711)
* Added [`manual_ok_err`] to `complexity` [#13740](https://github.com/rust-lang/rust-clippy/pull/13740)
* Added [`non_std_lazy_statics`] to `pedantic` [#13770](https://github.com/rust-lang/rust-clippy/pull/13770)
* Added [`manual_repeat_n`] to `style` [#13858](https://github.com/rust-lang/rust-clippy/pull/13858)
* Added [`manual_option_as_slice`] to `complexity` [#13901](https://github.com/rust-lang/rust-clippy/pull/13901)
* Added [`double_ended_iterator_last`] to `perf` [#13922](https://github.com/rust-lang/rust-clippy/pull/13922)
* Added [`useless_nonzero_new_unchecked`] to `complexity` [#13993](https://github.com/rust-lang/rust-clippy/pull/13993)
* Added [`sliced_string_as_bytes`] to `perf` [#14002](https://github.com/rust-lang/rust-clippy/pull/14002)
* Added [`unnecessary_semicolon`] to `pedantic` [#14032](https://github.com/rust-lang/rust-clippy/pull/14032)
* Added [`return_and_then`] to `restriction` [#14051](https://github.com/rust-lang/rust-clippy/pull/14051)
* Added [`manual_slice_fill`] to `style` [#14082](https://github.com/rust-lang/rust-clippy/pull/14082)
* Added [`precedence_bits`] to `restriction` [#14115](https://github.com/rust-lang/rust-clippy/pull/14115)

### Moves and Deprecations

* Moved [`redundant_locals`] to `suspicious` (from `correctness`, now warn-by-default)
[#13747](https://github.com/rust-lang/rust-clippy/pull/13747)
* Moved [`format_push_string`] to `pedantic` (from `restriction`)
[#13894](https://github.com/rust-lang/rust-clippy/pull/13894)
* Moved [`format_collect`] to `pedantic` (from `perf`, now allow-by-default)
[#13894](https://github.com/rust-lang/rust-clippy/pull/13894)
* Moved [`mutex_integer`] to `restriction` (from `nursery`) [#14110](https://github.com/rust-lang/rust-clippy/pull/14110)

### Enhancements

* Add `lint-inconsistent-struct-field-initializers` configuration option to [`inconsistent_struct_constructor`]
[#13737](https://github.com/rust-lang/rust-clippy/pull/13737)
* [`len_zero`] now also triggers if deref target implements `is_empty()`
[#13871](https://github.com/rust-lang/rust-clippy/pull/13871)
* [`obfuscated_if_else`] now also triggers for the `.then(..).unwrap_or(..)` pattern
[#14021](https://github.com/rust-lang/rust-clippy/pull/14021)

### False Positive Fixes

* [`trailing_empty_array`] no longer triggers in tests [#13844](https://github.com/rust-lang/rust-clippy/pull/13844)
* [`missing_const_for_fn`] no longer triggers in tests [#13945](https://github.com/rust-lang/rust-clippy/pull/13945)
* [`significant_drop_in_scrutinee`]: do not falsely warn for temporaries created by `.await` expansion
[#13985](https://github.com/rust-lang/rust-clippy/pull/13985)

### ICE Fixes

* [`borrow_interior_mutable_const`] Fix an ICE that can occur when taking a reference to a tuple/`struct` field of an
interior mutable `const` [#13877](https://github.com/rust-lang/rust-clippy/pull/13877)

### Others

* Clippy now uses Rust edition 2024 [#13751](https://github.com/rust-lang/rust-clippy/pull/13751)

## Rust 1.85

Current stable, released 2025-02-20
Released 2025-02-20

[View all 72 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-11-15T19%3A31%3A08Z..2024-12-26T13%3A59%3A48Z+base%3Amaster)

Expand Down Expand Up @@ -5516,6 +5573,7 @@ Released 2018-09-13
[`cast_slice_different_sizes`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_slice_different_sizes
[`cast_slice_from_raw_parts`]: https://rust-lang.github.io/rust-clippy/master/index.html#cast_slice_from_raw_parts
[`cfg_not_test`]: https://rust-lang.github.io/rust-clippy/master/index.html#cfg_not_test
[`char_indices_as_byte_indices`]: https://rust-lang.github.io/rust-clippy/master/index.html#char_indices_as_byte_indices
[`char_lit_as_u8`]: https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
[`chars_last_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp
[`chars_next_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp
Expand Down Expand Up @@ -5681,6 +5739,7 @@ Released 2018-09-13
[`if_same_then_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
[`if_then_some_else_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
[`ifs_same_cond`]: https://rust-lang.github.io/rust-clippy/master/index.html#ifs_same_cond
[`ignore_without_reason`]: https://rust-lang.github.io/rust-clippy/master/index.html#ignore_without_reason
[`ignored_unit_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
[`impl_hash_borrow_with_str_and_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#impl_hash_borrow_with_str_and_bytes
[`impl_trait_in_params`]: https://rust-lang.github.io/rust-clippy/master/index.html#impl_trait_in_params
Expand Down Expand Up @@ -5789,6 +5848,7 @@ Released 2018-09-13
[`manual_c_str_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_c_str_literals
[`manual_clamp`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
[`manual_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains
[`manual_dangling_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_dangling_ptr
[`manual_div_ceil`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
[`manual_filter`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter
[`manual_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter_map
Expand Down Expand Up @@ -6346,6 +6406,7 @@ Released 2018-09-13
[`await-holding-invalid-types`]: https://doc.rust-lang.org/clippy/lint_configuration.html#await-holding-invalid-types
[`cargo-ignore-publish`]: https://doc.rust-lang.org/clippy/lint_configuration.html#cargo-ignore-publish
[`check-incompatible-msrv-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-incompatible-msrv-in-tests
[`check-inconsistent-struct-field-initializers`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-inconsistent-struct-field-initializers
[`check-private-items`]: https://doc.rust-lang.org/clippy/lint_configuration.html#check-private-items
[`cognitive-complexity-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#cognitive-complexity-threshold
[`disallowed-macros`]: https://doc.rust-lang.org/clippy/lint_configuration.html#disallowed-macros
Expand All @@ -6362,7 +6423,7 @@ Released 2018-09-13
[`future-size-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#future-size-threshold
[`ignore-interior-mutability`]: https://doc.rust-lang.org/clippy/lint_configuration.html#ignore-interior-mutability
[`large-error-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#large-error-threshold
[`lint-inconsistent-struct-field-initializers`]: https://doc.rust-lang.org/clippy/lint_configuration.html#lint-inconsistent-struct-field-initializers
[`lint-commented-code`]: https://doc.rust-lang.org/clippy/lint_configuration.html#lint-commented-code
[`literal-representation-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#literal-representation-threshold
[`matches-for-let-else`]: https://doc.rust-lang.org/clippy/lint_configuration.html#matches-for-let-else
[`max-fn-params-bools`]: https://doc.rust-lang.org/clippy/lint_configuration.html#max-fn-params-bools
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "clippy"
# begin autogenerated version
version = "0.1.87"
version = "0.1.88"
# end autogenerated version
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
Expand Down Expand Up @@ -42,7 +42,7 @@ walkdir = "2.3"
filetime = "0.2.9"
itertools = "0.12"
pulldown-cmark = { version = "0.11", default-features = false, features = ["html"] }
rinja = { version = "0.3", default-features = false, features = ["config"] }
askama = { version = "0.13", default-features = false, features = ["alloc", "config", "derive"] }

# UI test dependencies
clippy_utils = { path = "clippy_utils" }
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/tools/clippy/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- [Updating the Changelog](development/infrastructure/changelog_update.md)
- [Release a New Version](development/infrastructure/release.md)
- [The Clippy Book](development/infrastructure/book.md)
- [Benchmarking Clippy](development/infrastructure/benchmarking.md)
- [Proposals](development/proposals/README.md)
- [Roadmap 2021](development/proposals/roadmap-2021.md)
- [Syntax Tree Patterns](development/proposals/syntax-tree-patterns.md)
Expand Down
18 changes: 12 additions & 6 deletions src/tools/clippy/book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,22 @@ struct A;
impl A {
pub fn fo(&self) {}
pub fn foo(&self) {}
//~^ foo_functions
pub fn food(&self) {}
}

// Default trait methods
trait B {
fn fo(&self) {}
fn foo(&self) {}
//~^ foo_functions
fn food(&self) {}
}

// Plain functions
fn fo() {}
fn foo() {}
//~^ foo_functions
fn food() {}

fn main() {
Expand All @@ -122,17 +125,20 @@ fn main() {
}
```

Now we can run the test with `TESTNAME=foo_functions cargo uibless`, currently
this test is meaningless though.
Note that we are adding comment annotations with the name of our lint to mark
lines where we expect an error. Once we have implemented our lint we can run
`TESTNAME=foo_functions cargo uibless` to generate the `.stderr` file. If our
lint makes use of structured suggestions then this command will also generate
the corresponding `.fixed` file.

While we are working on implementing our lint, we can keep running the UI test.
That allows us to check if the output is turning into what we want by checking the
`.stderr` file that gets updated on every test run.

Running `TESTNAME=foo_functions cargo uitest` should pass on its own. When we
commit our lint, we need to commit the generated `.stderr` files, too. In
general, you should only commit files changed by `cargo bless` for the
specific lint you are creating/editing.
Once we have implemented our lint running `TESTNAME=foo_functions cargo uitest`
should pass on its own. When we commit our lint, we need to commit the generated
`.stderr` and if applicable `.fixed` files, too. In general, you should only
commit files changed by `cargo bless` for the specific lint you are creating/editing.

> _Note:_ you can run multiple test files by specifying a comma separated list:
> `TESTNAME=foo_functions,test2,test3`.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/development/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ following:

First, take note of the toolchain
[override](https://rust-lang.github.io/rustup/overrides.html) in
`/rust-toolchain`. We will use this override to install Clippy into the right
`/rust-toolchain.toml`. We will use this override to install Clippy into the right
toolchain.

> Tip: You can view the active toolchain for the current directory with `rustup
Expand Down
Loading
Loading