Skip to content
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

Clippy subtree update #137752

Merged
merged 261 commits into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
261 commits
Select commit Hold shift + click to select a range
19ddb69
Handle more cases in `is_normalizable`
samueltardieu Dec 15, 2024
277bf08
Fix regression #14007
GuillaumeGomez Jan 18, 2025
06221e6
Deprecate the `option_map_or_err_ok` lint
samueltardieu Jan 18, 2025
a03242f
Move `manual_ok_or` from pedantic to style
samueltardieu Jan 18, 2025
ac87b0c
fix ICE in `unnecessary_mut_passed`
lapla-cogito Jan 23, 2025
40c2c64
fix broken link of UI test in the book
lapla-cogito Jan 26, 2025
665e78f
add MSRV check for `manual_flatten`
lapla-cogito Jan 27, 2025
16e2196
`useless_asref`: no lint if in a closure to change the ref depth
samueltardieu Jan 27, 2025
736ac3d
Undo most of last commit and add type alias
smoelius Jan 28, 2025
b827529
Don't use labeled block as top-level blocks
samueltardieu Jan 29, 2025
d13897b
change the applicability of `if_then_some_else_none` to `MachineAppli…
lapla-cogito Jan 30, 2025
045e36d
doc_link_code: add check for `text`[`adjacent`] style links
notriddle Jan 30, 2025
58d4834
Resolve projections during internal mutability analysis
GrigorenkoPV Jan 31, 2025
2a52fbe
add MSRV check for `repeat_vec_with_capacity`
lapla-cogito Feb 1, 2025
f9669e4
add MSRV check for `lines_filter_map_ok`
lapla-cogito Feb 1, 2025
2a7d1d4
Remove `Known problems` section `invalid_upcast_comparisons`
alex-semenyuk Feb 1, 2025
a5329bd
autofix for `range_zip_with_len`
lapla-cogito Feb 2, 2025
5884fd0
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`
safinaskar Feb 3, 2025
64dec07
Simplify `reindent_multiline()` signature
samueltardieu Jan 29, 2025
4220dbd
allow `assign_op_pattern` in the test of `string_add`
lapla-cogito Feb 4, 2025
a2f9861
fix [`manual_map`] not catching type adjustment
J-ZhengLi Jul 2, 2024
2a4be53
move `expr_requires_coercion` to clippy_utils & some other adjustments
J-ZhengLi Sep 13, 2024
60f9445
don't emit lint inside macro in `manual_async_fn`
lapla-cogito Feb 4, 2025
44fda91
Correct version of `doc_overindented_list_items`
ohno418 Feb 5, 2025
f3e292d
Uniformly handle HIR literals in visitors and lints
oli-obk Feb 1, 2025
5f6dd7a
remove an outdated line
lapla-cogito Feb 6, 2025
daab21e
Pulicize `clippy_utils::ty::ty_from_hir_ty`
tesuji Jul 19, 2024
83b97ae
Use `clippy_utils::ty::ty_from_hir_ty` to avoid ICE
tesuji Jul 19, 2024
925718d
Make the "expensive" comment belong to a branch
tesuji Jul 20, 2024
e3e6e6e
add bug 13092
tesuji Jul 24, 2024
bcfd0d1
Skip `use_self` inside macro expansion of `impl Self` items
tesuji Sep 4, 2024
9ea2b65
add test to check for popping wrong items
tesuji Sep 6, 2024
d2497ac
Auto merge of #136471 - safinaskar:parallel, r=SparrowLii
bors Feb 6, 2025
ece0658
Rollup merge of #136393 - oli-obk:pattern-type-lit-oflo-checks, r=com…
matthiaskrgr Feb 6, 2025
5aa9d7a
Merge commit '3e3715c31236bff56f1c63a1de2c7bbdfcfb0923' into clippy-s…
flip1995 Feb 6, 2025
20b2461
Skip `use_self` inside macro expansions of a `impl Self` block (#13128)
Alexendoo Feb 6, 2025
6f62e68
Auto merge of #136641 - matthiaskrgr:rollup-lajwje5, r=matthiaskrgr
bors Feb 6, 2025
8a9d550
Use edition 2024 when running `cargo dev lint`
samueltardieu Feb 5, 2025
7cda242
don't emit suggestion inside macro in `manual_async_fn` (#14142)
Jarcho Feb 6, 2025
888365d
Don't use labeled block as top-level blocks (#14102)
Jarcho Feb 6, 2025
512b08f
change the applicability of `if_then_some_else_none` to `MachineAppli…
Jarcho Feb 6, 2025
b43dc00
Rollup merge of #136645 - flip1995:clippy-subtree-update, r=Manishearth
matthiaskrgr Feb 6, 2025
0e42ba9
Permit specifying a non-default edition when linting file
samueltardieu Feb 5, 2025
dc330b8
Use edition 2024 when running `cargo dev lint` (#14166)
y21 Feb 7, 2025
4a94ad6
Simplify `reindent_multiline()` signature (#14101)
y21 Feb 7, 2025
33394d2
Correct version of `doc_overindented_list_items` (#14152)
llogiq Feb 7, 2025
16781bf
add `manual_option_as_slice` to the lint documentation
lapla-cogito Feb 7, 2025
c529b70
Fix ICE in `unnecessary_mut_passed` (#14065)
Centri3 Feb 7, 2025
b0ad06d
add MSRV check for `lines_filter_map_ok` (#14130)
Centri3 Feb 7, 2025
9289cca
remove an outdated line in `transmute/mod.rs` (#14159)
Centri3 Feb 7, 2025
b5ea249
[`path_buf_push_overwrite`]: mark suggestion as `MaybeIncorrect` (#14…
Centri3 Feb 7, 2025
c6a8616
add `manual_option_as_slice` MSRV to the lint documentation (#14171)
Centri3 Feb 7, 2025
f6d23c8
Handle more cases in `is_normalizable` (#13833)
llogiq Feb 7, 2025
0d3bf65
`useless_asref`: no lint if in a closure to change the ref depth (#14…
Centri3 Feb 7, 2025
7c94744
Address additional review comments
smoelius Feb 7, 2025
24ea8a5
Convert `EMPTY_LINE_AFTER_OUTER_ATTR` and `EMPTY_LINE_AFTER_OUTER_ATT…
GuillaumeGomez Feb 6, 2025
42453bd
Update UI tests
GuillaumeGomez Feb 6, 2025
4044c1a
fix empty after lint on impl/trait items
jdonszelmann Feb 6, 2025
8ebc52e
fix typo
jdonszelmann Feb 7, 2025
477be94
add tests for spurious failure and fix typo
jdonszelmann Feb 7, 2025
4e5d00a
Deprecate redundant lint `option_map_or_err_ok` and take `manual_ok_o…
dswij Feb 7, 2025
a25e152
Remove `Known problems` section `invalid_upcast_comparisons` (#14133)
dswij Feb 7, 2025
b18bb0a
clippy: directly use rustc_abi instead of reexports
workingjubilee Feb 5, 2025
5211148
add MSRV check for `manual_flatten` (#14086)
dswij Feb 8, 2025
8cc596c
autofix for `range_zip_with_len` (#14136)
dswij Feb 8, 2025
0ff9540
Two improvements to `disallowed_*` (#13669)
Centri3 Feb 8, 2025
6cdb7f6
allow `assign_op_pattern` in the test of `string_add` (#14143)
Centri3 Feb 8, 2025
5e3b968
remove "Known problems" section for `branches_sharing_code`
lapla-cogito Feb 8, 2025
aad3686
Add error markers for `obfuscated_if_else` lint
samueltardieu Feb 9, 2025
77344b8
remove "Known problems" section for `branches_sharing_code` (#14176)
blyxyas Feb 9, 2025
ac0a11a
Fix `obfuscated_if_else` suggestion on left side of a binary expr
samueltardieu Jan 31, 2025
8c01600
Fix `obfuscated_if_else` suggestion on left side of a binary expr (#1…
blyxyas Feb 9, 2025
fba8952
Rollup merge of #136706 - workingjubilee:finish-up-rustc-abi-updates,…
workingjubilee Feb 9, 2025
d7fd1c8
make [`manual_map`] ignore types that contain `dyn` (#12712)
Alexendoo Feb 9, 2025
657dda7
`let_and_return`: look for non-static references in expansion as well
samueltardieu Feb 9, 2025
5d2fe07
`let_and_return`: lint more cases in edition ≥ 2024
samueltardieu Feb 9, 2025
4d4ef00
Add single_option_map lint
Jan 19, 2025
c3239ba
Add `single_option_map` lint (#14033)
llogiq Feb 9, 2025
521a800
Fix `let_and_return` with temporary variables, and distinguish betwee…
llogiq Feb 9, 2025
749eb37
correct "Affected lints" for `allow-one-hash-in-raw-strings`
lapla-cogito Feb 10, 2025
b32ad4c
Use parentheses when needed in `nonminimal_bool` lint
samueltardieu Feb 10, 2025
8939915
Use parentheses when needed in `nonminimal_bool` lint (#14187)
llogiq Feb 10, 2025
91ff190
Rename rustc_middle::Ty::is_unsafe_ptr to is_raw_ptr
1c3t3a Jan 24, 2025
15d08ef
Convert two missed places
1c3t3a Jan 24, 2025
b7ec4c1
correct "Affected lints" for `allow-one-hash-in-raw-strings` (#14186)
flip1995 Feb 10, 2025
3a0b1ae
Show diff suggestion format on verbose replacement
estebank Jul 9, 2024
aff497f
Use a separate loop to drive the check for code clusters
notriddle Feb 10, 2025
39d73d5
Use MIR body to identify more "default equivalent" calls
estebank Jan 12, 2025
ff87bea
Use MIR body to identify more "default equivalent" calls for `derivab…
Jarcho Feb 11, 2025
7139436
add index checks for the slice in `manual_slice_fill`
lapla-cogito Feb 10, 2025
c40898e
`declare_interior_mutable_const`, `borrow_interior_mutable_const`: re…
blyxyas Feb 11, 2025
ac15a10
just_underscores_and_digits: ignore empty ident
notriddle Feb 6, 2025
ffa1caf
just_underscores_and_digits: fix false positive in error recovery sce…
blyxyas Feb 11, 2025
da6a059
`{expect,unwrap}_used`: add options to lint at compilation time
samueltardieu Feb 11, 2025
32aef11
`{expect,unwrap}_used`: add options to lint at compilation time (#14200)
llogiq Feb 12, 2025
8b6de49
New lint: `unbuffered_bytes`
JonathanBrouwer Jan 27, 2025
8573725
Remove ignored `#[must_use]` attributes from Clippy
samueltardieu Feb 12, 2025
a342340
add index checks for the slice in `manual_slice_fill` (#14193)
Jarcho Feb 12, 2025
1cb4236
New lint: `unbuffered_bytes` (#14089)
Jarcho Feb 12, 2025
39bde6d
Reorganize code in `mem_replace.rs`
samueltardieu Feb 12, 2025
b167895
Fix `used_underscore_items` lint uses of foreign functions
WeiTheShinobi Feb 12, 2025
342ac8e
New lint: `mem_replace_option_with_some`
samueltardieu Feb 11, 2025
4129f5c
New lint: `mem_replace_option_with_some` (#14197)
llogiq Feb 12, 2025
7cd3b8c
Auto merge of #135994 - 1c3t3a:rename-unsafe-ptr, r=oli-obk
bors Feb 12, 2025
a75cc61
intern valtrees
Feb 7, 2025
c47746c
fix: `needless_option_as_deref` FP in trait
profetia Feb 13, 2025
8ae4750
fix broken link of UI test in the book (#14077)
flip1995 Feb 13, 2025
8cac5b0
rustc_tools_util: Change release channel default to stable
ignatz Jan 31, 2025
943d604
Fix rustc_tools_util's `version.host_compiler` release channel, expos…
flip1995 Feb 13, 2025
f826193
`unnecessary_map_or`: do not consume the non-`Copy` comparison value
samueltardieu Feb 12, 2025
ef7aa51
Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obk
bors Feb 13, 2025
b83762c
Fix `literal_string_with_formatting_args` lint emitted when it should…
y21 Feb 13, 2025
fc532c5
Trim suggestion parts to the subset that is purely additive
compiler-errors Feb 13, 2025
50ecb6e
doc_link_code: add check for links with code spans that render weird …
Centri3 Feb 14, 2025
f7f7888
Make rust_tools_util package compatible with current stable by loweri…
ignatz Feb 13, 2025
823b818
Make rust_tools_util package compatible with current stable by loweri…
flip1995 Feb 14, 2025
4e899e1
`unnecessary_map_or`: do not consume the comparison value if it does …
Jarcho Feb 15, 2025
0dd5c4d
Fix `used_underscore_items` lint uses of foreign functions (#14205)
Jarcho Feb 15, 2025
1338829
Add example for macro_use
alex-semenyuk Feb 15, 2025
379c8f4
Clarify example for macro_use (#14220)
y21 Feb 15, 2025
95c6866
Make UI tests annotations mandatory
GuillaumeGomez Feb 11, 2025
f666fd6
Update UI tests
GuillaumeGomez Feb 11, 2025
10184ec
Allowed `clippy::tests/ui/attrs.2.fixed` in `tests/ui/attr.rs` becaus…
GuillaumeGomez Feb 11, 2025
0a99075
Handle compilation error in `builtin_type_shadow.rs`
GuillaumeGomez Feb 12, 2025
d5ebe50
Add manual annotations
GuillaumeGomez Feb 12, 2025
8a2dae6
Make `if_let_mutex` test pass on both 2021 and 2024 editions
GuillaumeGomez Feb 12, 2025
1f94d55
Fix new tests updates
GuillaumeGomez Feb 12, 2025
a2c890f
Make fmt (weirdly) happy
GuillaumeGomez Feb 12, 2025
3053bad
Update ui-toml tests
GuillaumeGomez Feb 13, 2025
0841f6e
Don't make ui test annotations madatory for `ui-cargo`
GuillaumeGomez Feb 13, 2025
a50953c
Disable mandatory annotations for `ui-internals` tests for now until …
GuillaumeGomez Feb 13, 2025
cc915cc
Add missing ui annotations to new ui tests
GuillaumeGomez Feb 15, 2025
211f79d
Fix `tests/ui-toml/absolute_paths/absolute_paths_2015.rs` test
GuillaumeGomez Feb 15, 2025
0fcc2db
Fix 32 bits tests
samueltardieu Feb 15, 2025
8ae4e7f
Fix `tests/ui/transmute_32bit.rs` annotations
GuillaumeGomez Feb 15, 2025
2c0c661
Better handle 32bit/64bit-specific ui tests
GuillaumeGomez Feb 15, 2025
847bd67
f
GuillaumeGomez Feb 15, 2025
a8b1782
Make UI test annotations mandatory (#11421)
flip1995 Feb 15, 2025
e0a62ac
Add `clippy_utils::is_mutable()`
samueltardieu Feb 2, 2025
35ad69c
Cleanup: remove useless `span_is_local()` calls in `manual_slice_fill`
samueltardieu Feb 10, 2025
510d3b6
Use `clippy_utils::is_mutable()` in `unnecessary_struct_initialization`
samueltardieu Feb 2, 2025
44aa75f
`manual_slice_fill`: initializer must not reference the iterator
samueltardieu Feb 10, 2025
01d7a32
`manual_strip`: use existing identifier instead of placeholder
samueltardieu Feb 10, 2025
91548d0
prevent `useless_asref` from suggesting `.clone()` on types without t…
lapla-cogito Feb 8, 2025
fd17bfe
add `manual_contains` lint
lapla-cogito Feb 11, 2025
1c0e120
apply `manual_contains` to Clippy sources
lapla-cogito Feb 11, 2025
8cef0b6
new lint: `manual_contains` (#13817)
Manishearth Feb 15, 2025
a12d5a0
add suggestion example for `cast_possible_wrap`
lapla-cogito Feb 16, 2025
6dd477a
Add `--allow-no-vcs` to `cargo dev dogfood --fix`
samueltardieu Feb 16, 2025
ef7e9fe
Update version attribute for 1.85 clippy lints
xFrednet Feb 16, 2025
3e63720
Changelog for Clippy 1.85 :parrot:
xFrednet Feb 16, 2025
f68f0b3
clippy: string_from_utf8_as_bytes: also detect inherent `from_utf8`
GrigorenkoPV Feb 15, 2025
058ae80
Add `cargo dev setup toolchain --standalone`
Alexendoo Feb 16, 2025
d03ae8b
`ui_test` annotation cleanup
Alexendoo Feb 16, 2025
0f20a12
`ui_test` annotation cleanup (#14232)
Alexendoo Feb 16, 2025
8cf9eea
Move some `Map` methods onto `TyCtxt`.
nnethercote Feb 2, 2025
91481e3
Overhaul the `intravisit::Map` trait.
nnethercote Feb 3, 2025
42114c9
Rollup merge of #137101 - GrigorenkoPV:str-inherent-lint, r=Urgau
matthiaskrgr Feb 17, 2025
1750411
Add `--allow-no-vcs` to `cargo dev dogfood --fix` (#14227)
flip1995 Feb 17, 2025
735bed7
Add `cargo dev setup toolchain --standalone` (#14230)
flip1995 Feb 17, 2025
822e45b
"Typo Catch Check" passed by @flip1995
xFrednet Feb 17, 2025
66d19d8
`manual_ok_err`: blockify the replacement of an `else if …`
samueltardieu Feb 17, 2025
01085cb
Update mention of `ref_to_mut` to `invalid_reference_casting`
tamird Feb 17, 2025
5e4d166
`manual_ok_err`: blockify the replacement of an `else if …` (#14240)
Manishearth Feb 17, 2025
437014b
Update mention of `ref_to_mut` to `invalid_reference_casting` (#14241)
Manishearth Feb 17, 2025
835e6a6
Move methods from `Map` to `TyCtxt`, part 2.
nnethercote Feb 17, 2025
e2d9b9a
fix: `needless_option_as_deref` FP in trait (#14210)
blyxyas Feb 17, 2025
758ec1d
remove an unneeded `#![feature]`
cyrgani Feb 18, 2025
45f7a60
`.last()` to `.next_back()` requires a mutable receiver
samueltardieu Feb 2, 2025
f49b4bc
remove an unneeded `#![feature]` (#14245)
blyxyas Feb 18, 2025
939429a
update `rustfix` link
lapla-cogito Feb 18, 2025
48fffe7
add a preferred fix for `cast_possible_wrap` description (#14225)
blyxyas Feb 18, 2025
e2cdfed
fix: `map_entry` FP on struct member
profetia Feb 5, 2025
dcd643a
`double_ended_iterator_last`: note when drop order is changed
samueltardieu Feb 14, 2025
6872e94
update `rustfix` link in docs (#14248)
flip1995 Feb 19, 2025
975a813
`.last()` to `.next_back()` requires a mutable receiver (#14140)
Centri3 Feb 19, 2025
d8ecde0
fix: `map_entry` FP on struct member (#14151)
Centri3 Feb 19, 2025
a81c264
Rollup merge of #136923 - samueltardieu:push-vxxqvqwspssv, r=davidtwco
matthiaskrgr Feb 19, 2025
83f5cba
add `owned_cow` lint
llogiq Jan 5, 2025
90bd46b
Simplify `Postorder` customization.
nnethercote Feb 19, 2025
1202508
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Feb 20, 2025
3c9a0ab
rename the MSRV alias `MANUAL_DIV_CEIL` to `DIV_CEIL`
lapla-cogito Feb 20, 2025
8844a96
Bump Clippy version -> 0.1.87
flip1995 Feb 20, 2025
55f32d9
add missing MSRV configuration information for `manual_div_ceil`
lapla-cogito Feb 20, 2025
934471c
Bump nightly version -> 2025-02-20
flip1995 Feb 20, 2025
7c889ac
Changelog for Clippy 1.85 🦜 (#14229)
xFrednet Feb 20, 2025
bbf65f0
add `owned_cow` lint (#13948)
y21 Feb 20, 2025
e6be02e
Rustup: fix 32bit tests
flip1995 Feb 20, 2025
238edf2
Rustup (#14262)
flip1995 Feb 20, 2025
acfbbc6
Remove obsolete comment and simplify code
samueltardieu Feb 20, 2025
41a3455
Rename `ClearCrossCrate::assert_crate_local`.
nnethercote Feb 13, 2025
732e329
Remove obsolete comment and simplify code (#14264)
Manishearth Feb 20, 2025
fef0ea9
More sophisticated span trimming
compiler-errors Feb 20, 2025
a04e819
Trim suggestion part before generating highlights
compiler-errors Feb 21, 2025
c2d75cf
Move methods from Map to TyCtxt, part 3.
nnethercote Feb 20, 2025
373f809
Add `todo!` & `unimplemented!` to format macros list
nyurik Feb 21, 2025
4ac7a53
Represent the capability instead of the lint name in msrv aliases
samueltardieu Feb 21, 2025
1250c26
Represent the capability instead of the lint name in msrv aliases (#1…
y21 Feb 21, 2025
85329db
Rollup merge of #137299 - nnethercote:simplify-PostOrder-customizatio…
matthiaskrgr Feb 21, 2025
8113d54
Rollup merge of #137305 - nnethercote:rustc_middle-2, r=lcnr
matthiaskrgr Feb 21, 2025
649cef0
rename `MANUAL_DIV_CEIL` MSRV alias and add missing conf info for `ma…
blyxyas Feb 21, 2025
6c6ffd2
extend `obfuscated_if_else` to support `then().unwrap_or_else()` and …
lapla-cogito Feb 6, 2025
49082f9
Auto merge of #137397 - matthiaskrgr:rollup-ls2pilo, r=matthiaskrgr
bors Feb 21, 2025
6366cca
add `io_other_error` lint
llogiq Jan 18, 2025
e479a9f
add `io_other_error` lint (#14022)
xFrednet Feb 21, 2025
a666d6a
Auto merge of #137348 - compiler-errors:span-trim, r=estebank
bors Feb 21, 2025
e5dbcc2
Make asm a named field
compiler-errors Feb 17, 2025
ba8079d
Make a fake body to store typeck results for global_asm
compiler-errors Feb 17, 2025
2ad3520
fix: `too_long_first_doc_paragraph` suggests wrongly when first line …
profetia Feb 22, 2025
d5488b3
`useless_asref`: add a check for `Clone` before suggesting the use of…
y21 Feb 22, 2025
d92da0f
`manual_slice_fill`: do not initialize from the iterator (#14191)
dswij Feb 22, 2025
15820ec
Rollup merge of #137180 - compiler-errors:sym-regions, r=oli-obk
matthiaskrgr Feb 22, 2025
35d5ee0
add MSRV check for `repeat_vec_with_capacity` (#14126)
Manishearth Feb 23, 2025
0fa1706
fix: `too_long_first_doc_paragraph` suggests wrongly when first line …
Jarcho Feb 24, 2025
443b0f5
Fix rustdoc and clippy
jdonszelmann Feb 9, 2025
17bda0c
simplify must-use lint slightly
jdonszelmann Feb 9, 2025
efcf1f5
Split needless_lifetime '_ suggestions into elidable_lifetime_names
Alexendoo Jan 7, 2025
0fb004d
extend `obfuscated_if_else` to support `{then(), then_some()}.unwrap_…
blyxyas Feb 24, 2025
162b0e8
Add `todo!` & `unimplemented!` to format macros list (#14266)
blyxyas Feb 24, 2025
325bfef
configuration option to lint `incompatible_msrv` in test code
bryceberger Feb 22, 2025
6af901c
Add `unnecessary_debug_formatting` lint
smoelius Dec 29, 2024
b821f97
`manual_strip`: use existing identifier instead of placeholder (#14188)
Alexendoo Feb 26, 2025
b583568
Add `unnecessary_debug_formatting` lint (#13893)
blyxyas Feb 26, 2025
e956128
Remove obsolete TODO
samueltardieu Feb 26, 2025
52bf26e
Remove obsolete TODO (#14304)
Manishearth Feb 26, 2025
e399e15
Fix ICE
Jake-Shadle Feb 27, 2025
f50266a
Split `needless_lifetime` `'_` suggestions into `elidable_lifetime_na…
xFrednet Feb 27, 2025
527ab05
fix: Avoid ICE in `doc_nested_refdefs` check by checking range (#14308)
dswij Feb 27, 2025
329acde
fix: `map_entry` FP inside closure
profetia Feb 27, 2025
4a9b8c6
fix: `map_entry` FP inside closure (#14307)
Alexendoo Feb 27, 2025
063d6ae
macro_use_import: Don't check is attribute comes from expansion
flip1995 Feb 27, 2025
15180d4
macro_use_import: Don't check is attribute comes from expansion (#14317)
Centri3 Feb 27, 2025
02e812a
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Feb 27, 2025
53a1ff7
Check os_str_display MSRV instead of feature
flip1995 Feb 26, 2025
28555d1
Split must_use_unit test into an unfixable part
flip1995 Feb 26, 2025
b3d35b1
Bump nightly version -> 2025-02-27
flip1995 Feb 27, 2025
715d3f9
Rustup (#14300)
flip1995 Feb 27, 2025
06175f4
Add `is_float_literal` utility
samueltardieu Dec 17, 2024
baadee8
New lint: `manual_midpoint`
samueltardieu Dec 17, 2024
e1c1ac1
configuration option to lint `incompatible_msrv` in test code (#14279)
blyxyas Feb 28, 2025
2cdb90d
New lint: `manual_midpoint` (#13851)
y21 Feb 28, 2025
0972c3b
Check for MSRV attributes in late passes using the HIR
Alexendoo Dec 13, 2024
5b0004c
Migrate `clippy_lints` to new MSRV API
Alexendoo Jan 18, 2025
900aab7
Fix ICE in manual_map lint
flip1995 Feb 28, 2025
6f66a60
Fix ICE in manual_map lint (#14326)
y21 Feb 28, 2025
9f9a822
Check for MSRV attributes in late passes using the HIR (#13821)
y21 Feb 28, 2025
65eb2b2
Merge commit '9f9a822509e5ad3e560cbbe830d1013f936fca28' into clippy-s…
flip1995 Feb 28, 2025
f5851e7
Clippy: skip check_host_compiler check in rustc testsuite
flip1995 Feb 20, 2025
1e4bce2
Fix link to ty::Ty in clippy_utils
flip1995 Feb 21, 2025
7bfea66
Update Cargo.lock
flip1995 Feb 28, 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
  •  
  •  
  •  
16 changes: 10 additions & 6 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ dependencies = [
"cargo_metadata 0.18.1",
"directories",
"rustc-build-sysroot",
"rustc_tools_util",
"rustc_tools_util 0.4.0",
"rustc_version",
"serde",
"serde_json",
Expand Down Expand Up @@ -522,7 +522,7 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"

[[package]]
name = "clippy"
version = "0.1.86"
version = "0.1.87"
dependencies = [
"anstream",
"cargo_metadata 0.18.1",
Expand All @@ -539,7 +539,7 @@ dependencies = [
"quote",
"regex",
"rinja",
"rustc_tools_util",
"rustc_tools_util 0.4.2",
"serde",
"serde_json",
"syn 2.0.96",
Expand All @@ -553,7 +553,7 @@ dependencies = [

[[package]]
name = "clippy_config"
version = "0.1.86"
version = "0.1.87"
dependencies = [
"clippy_utils",
"itertools",
Expand All @@ -578,7 +578,7 @@ dependencies = [

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

[[package]]
name = "clippy_utils"
version = "0.1.86"
version = "0.1.87"
dependencies = [
"arrayvec",
"itertools",
Expand Down Expand Up @@ -4454,6 +4454,10 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3316159ab19e19d1065ecc49278e87f767a9dae9fae80348d2b4d4fa4ae02d4d"

[[package]]
name = "rustc_tools_util"
version = "0.4.2"

[[package]]
name = "rustc_trait_selection"
version = "0.0.0"
Expand Down
59 changes: 57 additions & 2 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,53 @@ document.

## Unreleased / Beta / In Rust Nightly

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

## Rust 1.85

Current stable, 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)

### New Lints

* Added [`repr_packed_without_abi`] to `suspicious`
[#13398](https://github.com/rust-lang/rust-clippy/pull/13398)
* Added [`as_pointer_underscore`] to `restriction`
[#13251](https://github.com/rust-lang/rust-clippy/pull/13251)
* Added [`doc_nested_refdefs`] to `suspicious`
[#13707](https://github.com/rust-lang/rust-clippy/pull/13707)
* Added [`literal_string_with_formatting_args`] to `nursery`
[#13410](https://github.com/rust-lang/rust-clippy/pull/13410)
* Added [`doc_include_without_cfg`] to `restriction`
[#13625](https://github.com/rust-lang/rust-clippy/pull/13625)

### Enhancements

* [`indexing_slicing`]: Can now be allowed in tests using the [`allow-indexing-slicing-in-tests`]
configuration
[#13854](https://github.com/rust-lang/rust-clippy/pull/13854)
* [`if_let_mutex`]: disable lint from Edition 2024 since
[if_let_rescope](https://github.com/rust-lang/rust/issues/131154) was stabilized
[#13695](https://github.com/rust-lang/rust-clippy/pull/13695)
* [`format_in_format_args`], [`recursive_format_impl`], [`to_string_in_format_args`],
[`uninlined_format_args`], [`unused_format_specs`]: Can now support 3rd party format macros
if they're marked with the `#[clippy::format_args]` attribute
[#9948](https://github.com/rust-lang/rust-clippy/pull/9948)

### ICE Fixes

* [`trait_duplication_in_bounds`]: fix ICE on duplicate type or constant bound
[#13722](https://github.com/rust-lang/rust-clippy/pull/13722)

### Others

* `clippy_utils` is now published to crates.io. Note that this crate is and will remain unstable.
[#13700](https://github.com/rust-lang/rust-clippy/pull/13700)

## Rust 1.84

Current stable, released 2025-01-09
Released 2025-01-09

[View all 84 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-10-03T21%3A23%3A58Z..2024-11-14T17%3A41%3A37Z+base%3Amaster)

Expand Down Expand Up @@ -5530,6 +5572,7 @@ Released 2018-09-13
[`diverging_sub_expression`]: https://rust-lang.github.io/rust-clippy/master/index.html#diverging_sub_expression
[`doc_include_without_cfg`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_include_without_cfg
[`doc_lazy_continuation`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
[`doc_link_code`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_code
[`doc_link_with_quotes`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes
[`doc_markdown`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
[`doc_nested_refdefs`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_nested_refdefs
Expand All @@ -5549,6 +5592,7 @@ Released 2018-09-13
[`duplicated_attributes`]: https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
[`duration_subsec`]: https://rust-lang.github.io/rust-clippy/master/index.html#duration_subsec
[`eager_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#eager_transmute
[`elidable_lifetime_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
[`else_if_without_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#else_if_without_else
[`empty_docs`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_docs
[`empty_drop`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_drop
Expand Down Expand Up @@ -5683,6 +5727,7 @@ Released 2018-09-13
[`invalid_utf8_in_unchecked`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_utf8_in_unchecked
[`inverted_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#inverted_saturating_sub
[`invisible_characters`]: https://rust-lang.github.io/rust-clippy/master/index.html#invisible_characters
[`io_other_error`]: https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
[`is_digit_ascii_radix`]: https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix
[`items_after_statements`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
[`items_after_test_module`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module
Expand Down Expand Up @@ -5742,6 +5787,7 @@ Released 2018-09-13
[`manual_bits`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits
[`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_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 All @@ -5761,6 +5807,7 @@ Released 2018-09-13
[`manual_main_separator_str`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_main_separator_str
[`manual_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
[`manual_memcpy`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy
[`manual_midpoint`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_midpoint
[`manual_next_back`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_next_back
[`manual_non_exhaustive`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
[`manual_ok_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err
Expand Down Expand Up @@ -5812,6 +5859,7 @@ Released 2018-09-13
[`mem_discriminant_non_enum`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_discriminant_non_enum
[`mem_forget`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_forget
[`mem_replace_option_with_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none
[`mem_replace_option_with_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_some
[`mem_replace_with_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default
[`mem_replace_with_uninit`]: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_uninit
[`min_ident_chars`]: https://rust-lang.github.io/rust-clippy/master/index.html#min_ident_chars
Expand Down Expand Up @@ -5939,6 +5987,7 @@ Released 2018-09-13
[`out_of_bounds_indexing`]: https://rust-lang.github.io/rust-clippy/master/index.html#out_of_bounds_indexing
[`overflow_check_conditional`]: https://rust-lang.github.io/rust-clippy/master/index.html#overflow_check_conditional
[`overly_complex_bool_expr`]: https://rust-lang.github.io/rust-clippy/master/index.html#overly_complex_bool_expr
[`owned_cow`]: https://rust-lang.github.io/rust-clippy/master/index.html#owned_cow
[`panic`]: https://rust-lang.github.io/rust-clippy/master/index.html#panic
[`panic_in_result_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#panic_in_result_fn
[`panic_params`]: https://rust-lang.github.io/rust-clippy/master/index.html#panic_params
Expand Down Expand Up @@ -6067,6 +6116,7 @@ Released 2018-09-13
[`single_element_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_element_loop
[`single_match`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_match
[`single_match_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
[`single_option_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_option_map
[`single_range_in_vec_init`]: https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init
[`size_of_in_element_count`]: https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count
[`size_of_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#size_of_ref
Expand Down Expand Up @@ -6143,6 +6193,7 @@ Released 2018-09-13
[`type_complexity`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
[`type_id_on_box`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_id_on_box
[`type_repetition_in_bounds`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
[`unbuffered_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#unbuffered_bytes
[`unchecked_duration_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_duration_subtraction
[`unconditional_recursion`]: https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
[`undocumented_unsafe_blocks`]: https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
Expand All @@ -6161,6 +6212,7 @@ Released 2018-09-13
[`unnecessary_box_returns`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_box_returns
[`unnecessary_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
[`unnecessary_clippy_cfg`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_clippy_cfg
[`unnecessary_debug_formatting`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_debug_formatting
[`unnecessary_fallible_conversions`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
[`unnecessary_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map
[`unnecessary_find_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_find_map
Expand Down Expand Up @@ -6267,6 +6319,7 @@ Released 2018-09-13
[`accept-comment-above-statement`]: https://doc.rust-lang.org/clippy/lint_configuration.html#accept-comment-above-statement
[`allow-comparison-to-zero`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-comparison-to-zero
[`allow-dbg-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-dbg-in-tests
[`allow-expect-in-consts`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-expect-in-consts
[`allow-expect-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-expect-in-tests
[`allow-indexing-slicing-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-indexing-slicing-in-tests
[`allow-mixed-uninlined-format-args`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-mixed-uninlined-format-args
Expand All @@ -6275,6 +6328,7 @@ Released 2018-09-13
[`allow-print-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-print-in-tests
[`allow-private-module-inception`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-private-module-inception
[`allow-renamed-params-for`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-renamed-params-for
[`allow-unwrap-in-consts`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-in-consts
[`allow-unwrap-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-in-tests
[`allow-useless-vec-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-useless-vec-in-tests
[`allowed-dotfiles`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-dotfiles
Expand All @@ -6290,6 +6344,7 @@ Released 2018-09-13
[`avoid-breaking-exported-api`]: https://doc.rust-lang.org/clippy/lint_configuration.html#avoid-breaking-exported-api
[`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-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 Down
6 changes: 3 additions & 3 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.86"
version = "0.1.87"
# end autogenerated version
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
Expand All @@ -25,7 +25,7 @@ path = "src/driver.rs"
[dependencies]
clippy_config = { path = "clippy_config" }
clippy_lints = { path = "clippy_lints" }
rustc_tools_util = "0.4.0"
rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
tempfile = { version = "3.3", optional = true }
termize = "0.1"
color-print = "0.3.4"
Expand Down Expand Up @@ -54,7 +54,7 @@ parking_lot = "0.12"
tokio = { version = "1", features = ["io-util"] }

[build-dependencies]
rustc_tools_util = "0.4.0"
rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }

[features]
integration = ["tempfile"]
Expand Down
33 changes: 15 additions & 18 deletions src/tools/clippy/book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ from the lint to the code of the test file and compare that to the contents of a
Use `cargo bless` to automatically generate the `.fixed` file while running
the tests.

[rustfix]: https://github.com/rust-lang/rustfix
[rustfix]: https://github.com/rust-lang/cargo/tree/master/crates/rustfix

## Testing manually

Expand Down Expand Up @@ -460,7 +460,7 @@ pub struct ManualStrip {

impl ManualStrip {
pub fn new(conf: &'static Conf) -> Self {
Self { msrv: conf.msrv.clone() }
Self { msrv: conf.msrv }
}
}
```
Expand All @@ -469,24 +469,13 @@ The project's MSRV can then be matched against the feature MSRV in the LintPass
using the `Msrv::meets` method.

``` rust
if !self.msrv.meets(msrvs::STR_STRIP_PREFIX) {
if !self.msrv.meets(cx, msrvs::STR_STRIP_PREFIX) {
return;
}
```

The project's MSRV can also be specified as an attribute, which overrides
the value from `clippy.toml`. This can be accounted for using the
`extract_msrv_attr!(LintContext)` macro and passing
`LateContext`/`EarlyContext`.

```rust,ignore
impl<'tcx> LateLintPass<'tcx> for ManualStrip {
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
...
}
extract_msrv_attr!(LateContext);
}
```
Early lint passes should instead use `MsrvStack` coupled with
`extract_msrv_attr!()`

Once the `msrv` is added to the lint, a relevant test case should be added to
the lint's test file, `tests/ui/manual_strip.rs` in this example. It should
Expand All @@ -512,8 +501,16 @@ in `clippy_config/src/conf.rs`:

```rust
define_Conf! {
/// Lint: LIST, OF, LINTS, <THE_NEWLY_ADDED_LINT>. The minimum rust version that the project supports
(msrv: Option<String> = None),
#[lints(
allow_attributes,
allow_attributes_without_reason,
..
<the newly added lint name>,
..
unused_trait_names,
use_self,
)]
msrv: Msrv = Msrv::default(),
...
}
```
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 @@ -75,7 +75,7 @@ or if you modify a test file to add a test case.
> _Note:_ This command may update more files than you intended. In that case
> only commit the files you wanted to update.
[UI test]: https://rustc-dev-guide.rust-lang.org/tests/adding.html#guide-to-the-ui-tests
[UI test]: https://rustc-dev-guide.rust-lang.org/tests/adding.html#ui-test-walkthrough

## `cargo dev`

Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/development/writing_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ We'll talk about suggestions more in depth in a [later chapter](emitting_lints.m
Use `cargo bless` to automatically generate the `.fixed` file after running
the tests.

[`rustfix`]: https://github.com/rust-lang/rustfix
[`rustfix`]: https://github.com/rust-lang/cargo/tree/master/crates/rustfix
[`span_lint_and_sugg`]: https://doc.rust-lang.org/beta/nightly-rustc/clippy_utils/diagnostics/fn.span_lint_and_sugg.html

## Testing Manually
Expand Down
Loading
Loading