Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
10000 commits
Select commit Hold shift + click to select a range
ef1aab3
`entry`: link to `Entry` API if can't make a suggestion (#15546)
samueltardieu Aug 23, 2025
f942b58
Activate `range-diff` feature of triagebot (#15538)
flip1995 Aug 23, 2025
bab765e
Rollup merge of #145781 - Kobzol:clippy-remove-profile, r=lqd
samueltardieu Aug 23, 2025
1ccc618
`get_diagnostic_item` in a bunch more places (#15519)
samueltardieu Aug 23, 2025
90951c6
clean-up `transmute_int_to_non_zero` (#15521)
samueltardieu Aug 23, 2025
74cea30
Adjust clippy lints for rustc `integer_to_ptr_transmutes` lint
Urgau Jul 27, 2025
b7f7272
Adjust clippy lints for rustc `integer_to_ptr_transmutes` lint
Urgau Jul 27, 2025
b55e45f
Use unnamed lifetime spans as primary spans for MISMATCHED_LIFETIME_S…
compiler-errors Aug 23, 2025
0384d26
Use unnamed lifetime spans as primary spans for MISMATCHED_LIFETIME_S…
compiler-errors Aug 23, 2025
6d6ead5
Refactor `useless_vec` lint (#14503)
samueltardieu Aug 23, 2025
a4ed695
`cast_slice_from_raw_parts`: check for implicit cast to raw slice poi…
zihan0822 Aug 7, 2025
5bc0761
changelog: [`cast_slice_from_raw_parts`]: properly select std/core
zihan0822 Aug 7, 2025
1c36543
`cast_slice_from_raw_parts`: check for implicit cast to raw slice poi…
samueltardieu Aug 23, 2025
1ea9b8f
use `get_diagnostic_item` in even more places (#15528)
samueltardieu Aug 23, 2025
edaed19
Auto merge of #145796 - samueltardieu:rollup-linfi86, r=samueltardieu
bors Aug 23, 2025
49b61c9
Rollup merge of #144531 - Urgau:int_to_ptr_transmutes, r=jackh726
jhpratt Aug 24, 2025
17857bf
Rollup merge of #144531 - Urgau:int_to_ptr_transmutes, r=jackh726
jhpratt Aug 24, 2025
57a1d3b
Rollup merge of #145798 - compiler-errors:unnamed-lt-primary, r=lqd
jhpratt Aug 24, 2025
87260c6
Rollup merge of #145798 - compiler-errors:unnamed-lt-primary, r=lqd
jhpratt Aug 24, 2025
1573e00
Auto merge of #145805 - jhpratt:rollup-h1bm4z7, r=jhpratt
bors Aug 24, 2025
d521862
misc: remove one level of nesting
ada4a Aug 13, 2025
b915dca
`cast_ptr_alignment`: move the `.cast()` check into a separate fn
ada4a Aug 13, 2025
5944207
`cast_ptr_alignment`: move the regular check into the `if`
ada4a Aug 13, 2025
d9fef66
clean-up `ptr_cast_constness`
ada4a Aug 13, 2025
dc8c32e
fix: `unnested_or_patterns` FP on structs with only shorthand field p…
llogiq Aug 24, 2025
bc7eb45
clean-up `ptr_cast_constness` (#15478)
samueltardieu Aug 24, 2025
6b52b09
Rewrite `unwrap_in_result` lint
samueltardieu Aug 8, 2025
aeadaa1
fix `or_then_unwrap`: suggestion preserves macro calls (#15483)
llogiq Aug 24, 2025
3127b79
`missing_inline_in_public_items`: fix lint emission source HirId (#15…
llogiq Aug 24, 2025
69095d7
check f16 and f128 in float_equality_without_abs
usamoi Jun 14, 2025
e01d625
get rid of confusing nested `map_or`s
ada4a Aug 23, 2025
73f852e
pattern-match on slices
ada4a Aug 23, 2025
e95a93a
`unused_unit`: small clean-up (#15550)
samueltardieu Aug 24, 2025
fd65b8d
check f16 and f128 in float_equality_without_abs (#15054)
llogiq Aug 24, 2025
c927085
Rewrite `unwrap_in_result` lint (#15445)
llogiq Aug 24, 2025
4de0cb5
`unused_unit`: don't lint on closure return types
ada4a Aug 23, 2025
b8ff759
split `cast_ptr_alignment` (#15479)
llogiq Aug 24, 2025
fcb9590
move `ptr_as_ptr` to under `if`
ada4a Aug 13, 2025
05e41f4
misc: replace `match` with an equality check
ada4a Aug 13, 2025
35dad30
`ptr_as_ptr`: move to `if` (#15480)
samueltardieu Aug 24, 2025
c491ecf
Fix `semicolon_inside_block` FP when attribute over expr is not enabl…
blyxyas Aug 24, 2025
8c78f7d
Suggest naming types before using explicit type names
samueltardieu Jun 6, 2025
ef45b66
`unnecessary_mut_passed`: add structured suggestion
ada4a Aug 8, 2025
3134ef3
fix: `never_loop` forget to remove break in nested loop
profetia Jul 27, 2025
d2255a2
Suggest naming types before using explicit type names (#14996)
blyxyas Aug 24, 2025
c305cb2
`unnecessary_mut_passed`: add structured suggestion (#15438)
blyxyas Aug 24, 2025
8811e52
add span to struct pattern rest (..)
Erk- Aug 23, 2025
0dd33fd
add span to struct pattern rest (..)
Erk- Aug 23, 2025
5d1a782
fix: `async_yields_async` wrongly unmangled macros
profetia Aug 25, 2025
cde77d5
Fix `async_yields_async` wrongly unmangled macros (#15553)
samueltardieu Aug 25, 2025
1498a62
Remove expect collapsible_span_lint_calls from span_lint_and_then
alex-semenyuk Aug 25, 2025
0a315ec
`doc_markdown`: add InfiniBand and RoCE to whitelist
profetia Aug 25, 2025
e0f1a2e
`unused_unit`: don't lint on closure return types (#15549)
samueltardieu Aug 25, 2025
7f117aa
ptr_cast_constness: avoid suggesting unresolvable method call
notriddle Aug 22, 2025
1856220
using full path in suggestion of
relaxcn Aug 26, 2025
4a4abd3
add a flag to codegen fn attrs for foreign items
jdonszelmann Aug 25, 2025
0cba514
add a flag to codegen fn attrs for foreign items
jdonszelmann Aug 25, 2025
e001cf9
docs(cognitive_complexity): Correct lint group
szokeasaurusrex Aug 26, 2025
ed30a8f
docs(cognitive_complexity): Correct lint group (#15563)
blyxyas Aug 26, 2025
1992d64
Enable clippy::panic in const contexts
YohDeadfall Aug 26, 2025
b8bd414
Enable clippy::panic in const contexts (#15565)
samueltardieu Aug 26, 2025
773b164
Allow `--print=crate-root-lint-levels`
ShE3py Aug 26, 2025
46ed9d4
Allow `--print=crate-root-lint-levels` (#15567)
llogiq Aug 26, 2025
63866a6
Preserve `unsafe` blocks in `option_map_unit` suggestion
samueltardieu Aug 26, 2025
5b0430d
Rollup merge of #145892 - jdonszelmann:codegen-fn-attrs-foreign-item,…
samueltardieu Aug 26, 2025
a13b28a
Auto merge of #145906 - samueltardieu:rollup-p8ibzhz, r=samueltardieu
bors Aug 26, 2025
b0eddc5
Document `is_unit_expr()`
samueltardieu Aug 26, 2025
6898fe5
`unit_cmp`: don't lint on explicitly written unit expr
zihan0822 Aug 26, 2025
8cc50b5
using full path in the suggestion of `clone_on_ref_ptr` (#15561)
y21 Aug 27, 2025
892962a
Add InfiniBand and RoCE to `doc_markdown` whitelist (#15558)
llogiq Aug 27, 2025
53a2eef
Document `is_unit_expr()` (#15571)
blyxyas Aug 27, 2025
d31b5e1
`map_identity`: suggest making the variable mutable when necessary
ada4a Jul 13, 2025
9d89f3e
fix: `collapsible_match` suggests ref/derefs when needed
vishruth-thimmaiah Feb 14, 2025
84a6688
fix: `collapsible_match` suggests ref/derefs when needed (#14221)
samueltardieu Aug 27, 2025
ed21a35
`unit_cmp`: don't lint on explicitly written unit expr (#15562)
samueltardieu Aug 27, 2025
7c98113
triagebot: Amend a review to include a link to what was changed since
samueltardieu Aug 27, 2025
13f6352
triagebot: Amend a review to include a link to what was changed since…
flip1995 Aug 28, 2025
d43acd2
`map_identity`: suggest making the variable mutable when necessary (#…
y21 Aug 28, 2025
e49c21e
fix: `print_literal` suggests wrongly for inline literal following a …
profetia Aug 28, 2025
f04e47b
Fix `print_literal` suggests wrongly for inline literal following a n…
samueltardieu Aug 28, 2025
afd9fa2
Fix false positive of `needless_range_loop` when meeting multidimensi…
relaxcn Aug 14, 2025
dc95529
Fix `redundant_closure` suggests wrongly with deref overload (#15077)
dswij Aug 29, 2025
e25f53c
Rollup merge of #145756 - okaneco:stabilize_char_boundary, r=scottmcm
tgross35 Aug 30, 2025
0e98fd5
Rollup merge of #145756 - okaneco:stabilize_char_boundary, r=scottmcm
tgross35 Aug 30, 2025
5de4462
Auto merge of #146023 - tgross35:rollup-gbec538, r=tgross35
bors Aug 30, 2025
0dc9163
fix: `assertions_on_result_states` avoid changing return type in more…
ada4a Aug 30, 2025
01b62ec
Fix FP of `needless_range_loop` when meeting multidimensional array (…
Jarcho Aug 30, 2025
2443c7e
Commas to semicolons in clippy.toml reasons
smoelius Aug 30, 2025
6681282
fix: `needless_for_each` suggests wrongly with explicit closure input…
ada4a Aug 30, 2025
e248b3a
Commas to semicolons in clippy.toml reasons (#15592)
blyxyas Aug 31, 2025
c412999
Get the block content from the proper context (#15014)
y21 Aug 31, 2025
e09b2e3
Supress excessive_precision when constants are overly precise
teofr Jul 1, 2025
ab44ea8
fix: `needless_for_each` suggests wrongly with explicit closure input…
dswij Aug 31, 2025
bdb631f
Supress `excessive_precision` when constants are overly precise (#15193)
samueltardieu Aug 31, 2025
17db952
fix: `assertions_on_result_states` avoid changing return type in more…
samueltardieu Aug 31, 2025
beb1c2a
fix: `alloc_instead_of_core` FP when `alloc` is an alias
profetia Aug 27, 2025
6511586
Fix `alloc_instead_of_core` FP when `alloc` is an alias (#15581)
Jarcho Sep 2, 2025
8b18620
Preserve `unsafe` blocks in `option_map_unit` suggestion (#15570)
Alexendoo Sep 2, 2025
8ae5b5d
ptr_cast_constness: avoid suggesting unresolvable method call (#15540)
Alexendoo Sep 2, 2025
578828a
Rollup merge of #145783 - Erk-:et-cetera-span, r=compiler-errors
GuillaumeGomez Sep 2, 2025
2bcb14e
Rollup merge of #145783 - Erk-:et-cetera-span, r=compiler-errors
GuillaumeGomez Sep 2, 2025
dcabe41
Auto merge of #146125 - GuillaumeGomez:rollup-ld81n7e, r=GuillaumeGomez
bors Sep 2, 2025
f684cb4
fix: `read_zero_byte_vec` suggests wrongly inside `let` stmt
profetia Aug 27, 2025
c2d3b1d
Set flip1995 to on-vacation
flip1995 Sep 4, 2025
81f14a6
Set flip1995 to on-vacation (#15614)
flip1995 Sep 4, 2025
2b81f80
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Sep 4, 2025
1b8138b
Bump nightly version -> 2025-09-04
flip1995 Sep 4, 2025
fc08c24
Rustup (#15616)
flip1995 Sep 4, 2025
a75033d
Merge commit 'e9b70454e4c9584be3b22ddabd26b741aeb06c10' into clippy-s…
flip1995 Sep 4, 2025
8fb9da6
Merge commit 'e9b70454e4c9584be3b22ddabd26b741aeb06c10' into clippy-s…
flip1995 Sep 4, 2025
e250ed4
fix: Filter suggestion parts that match existing code
Muscraft Aug 28, 2025
c2070c5
fix: Filter suggestion parts that match existing code
Muscraft Aug 28, 2025
7dbc84e
Auto merge of #146218 - flip1995:clippy-subtree-update, r=Manishearth
bors Sep 5, 2025
dafc72e
Auto merge of #146121 - Muscraft:filter-suggestion-parts, r=petrochenkov
bors Sep 5, 2025
a2b664f
Auto merge of #146121 - Muscraft:filter-suggestion-parts, r=petrochenkov
bors Sep 5, 2025
2bf9b02
Fix `never_loop` forget to remove `break` in nested loop (#15356)
blyxyas Sep 5, 2025
4f7fd05
clean-up a bit
ada4a Sep 5, 2025
48e60ab
fix(transmute_ptr_to_ref): don't suggest `.cast` when to-type is DST
ada4a Sep 5, 2025
cb998c8
clean-up a bit
ada4a Sep 4, 2025
7c97d02
fix(use_self): descend into type's children when looking for lifetimes
ada4a Sep 4, 2025
b6fab72
remove `has_lifetime`
ada4a Sep 4, 2025
788fdfb
Move `derive.rs` to `derive/mod.rs`
ada4a Sep 6, 2025
318bb9f
Split out each lint into a separate module
ada4a Sep 6, 2025
716cc99
extend the let-chain
ada4a Aug 25, 2025
6c4cb73
split `any` in two parts
ada4a Sep 6, 2025
50d6a3a
Fix `read_zero_byte_vec` suggests wrongly inside `let` stmt (#15582)
dswij Sep 7, 2025
50a5722
extract to a separate file
ada4a Sep 7, 2025
fee6fb4
tiny clean-up
ada4a Sep 7, 2025
269141e
`let_unit_with_type_underscore`: make early-pass (#15458)
Jarcho Sep 7, 2025
3af1e2a
move `toplevel_ref_args` out of `misc` (#15627)
samueltardieu Sep 8, 2025
f9bc963
fix(semicolon_inside_block): don't lint if block is in parens
ada4a Aug 2, 2025
d918686
change end to last
Qelxiros Aug 1, 2025
e817b90
change end to last
Qelxiros Aug 1, 2025
1f64233
fix(semicolon_inside_block): don't lint if block is in parens (#15626)
samueltardieu Sep 9, 2025
f2d2515
erase_regions to erase_and_anonymize_regions
BoxyUwU Aug 21, 2025
24909cf
erase_regions to erase_and_anonymize_regions
BoxyUwU Aug 21, 2025
e4984b6
Auto merge of #145717 - BoxyUwU:erase_regions_rename, r=lcnr
bors Sep 9, 2025
4041467
fix: `useless_attribute` FP on `deprecated_in_future`
profetia Sep 9, 2025
653511c
Strip frontmatter in fewer places
fmease Sep 8, 2025
45485c5
Strip frontmatter in fewer places
fmease Sep 8, 2025
cc3346b
fix(needless_closure): don't lint on `AsyncFn*`s
ada4a Sep 10, 2025
e75a0d9
Rollup merge of #144765 - Qelxiros:range-inclusive-last, r=jhpratt
matthiaskrgr Sep 10, 2025
d263449
Rollup merge of #144765 - Qelxiros:range-inclusive-last, r=jhpratt
matthiaskrgr Sep 10, 2025
6305d72
Auto merge of #146409 - matthiaskrgr:rollup-thju381, r=matthiaskrgr
bors Sep 10, 2025
796470f
Rollup merge of #146340 - fmease:frontmatter-containment, r=fee1-dead…
matthiaskrgr Sep 10, 2025
73ca2b2
Rollup merge of #146340 - fmease:frontmatter-containment, r=fee1-dead…
matthiaskrgr Sep 10, 2025
9fd1803
fixup no_{core,std} handling code
jdonszelmann Aug 24, 2025
c14e8c4
fixup no_{core,std} handling code
jdonszelmann Aug 24, 2025
1118d23
Auto merge of #146418 - matthiaskrgr:rollup-za0lrux, r=matthiaskrgr
bors Sep 10, 2025
c69320c
Revert "Rollup merge of #122661 - estebank:assert-macro-span, r=petro…
jieyouxu Sep 11, 2025
471c06f
Revert "Rollup merge of #122661 - estebank:assert-macro-span, r=petro…
jieyouxu Sep 11, 2025
fc1a5fe
Rollup merge of #146428 - jieyouxu:revert-assert-desugaring, r=esteba…
Zalathar Sep 11, 2025
e707120
clean-up `future_not_send` a bit (#15554)
blyxyas Sep 11, 2025
b15dc39
Fix `useless_attribute` FP on `deprecated_in_future` (#15645)
y21 Sep 11, 2025
59b5291
Auto merge of #146429 - Zalathar:rollup-eivhl6u, r=Zalathar
bors Sep 11, 2025
1b3286e
fix(len_zero): don't eagerly call `GenericArgs::type_at`
ada4a Sep 11, 2025
696bcb2
fix(needless_closure): don't lint on `AsyncFn*`s (#15649)
dswij Sep 11, 2025
8f652e0
refactor: split `derive` lints into separate modules (#15622)
Jarcho Sep 11, 2025
d72f269
fix(len_zero): don't eagerly call `GenericArgs::type_at` (#15660)
y21 Sep 11, 2025
f24f197
Add suggestion to `cast_sign_loss` and `cast_possible_wrap` using the…
Jarcho Sep 11, 2025
811a75a
fix: `invalid_upcast_comparisons` wrongly unmangled macros
profetia Aug 25, 2025
86354e8
Only suggest type in as_underscore when it's suggestable
teofr Sep 10, 2025
c1e7571
Fix `as_underscore` to only suggest when it's suggestable (#15652)
Alexendoo Sep 12, 2025
2ac7d42
Fix `invalid_upcast_comparisons` wrongly unmangled macros (#15663)
samueltardieu Sep 12, 2025
626649e
other clean-up
ada4a Aug 16, 2025
164a980
reorganize `peel_*_ty_refs` functions
ada4a Aug 16, 2025
373752f
clean-up tests
ada4a Sep 10, 2025
7645c7c
fix: ignore unsafe ops from `.await` desugaring
ada4a Sep 10, 2025
5719301
fix(use_self): don't early-return if the outer type has no lifetimes …
samueltardieu Sep 12, 2025
6a7eb71
`clippy_utils`: make `peel_*_ty_refs` class of functions a bit more c…
samueltardieu Sep 12, 2025
e9dc041
autofix for `rest_pat_in_fully_bound_structs`
Erk- Sep 10, 2025
a67a8b3
Introduce trait_item_of
camsteffen Aug 15, 2025
e939ca8
Introduce trait_item_of
camsteffen Aug 15, 2025
5b83d16
Rename AssocItemContainer -> AssocContainer
camsteffen Aug 13, 2025
42f6b08
Rename AssocItemContainer -> AssocContainer
camsteffen Aug 13, 2025
832eef2
Introduce hir::ImplItemImplKind
camsteffen Aug 5, 2025
683e4ca
Introduce hir::ImplItemImplKind
camsteffen Aug 5, 2025
f0599cf
Split AssocContainer::{InherentImpl,TraitImpl}
camsteffen Aug 13, 2025
8f6ac2b
Split AssocContainer::{InherentImpl,TraitImpl}
camsteffen Aug 13, 2025
cdc0ae5
small clean-up
ada4a Sep 12, 2025
b49ff83
Rollup merge of #146389 - jdonszelmann:no-std, r=oli-obk
jdonszelmann Sep 13, 2025
cccb75f
Rollup merge of #146389 - jdonszelmann:no-std, r=oli-obk
jdonszelmann Sep 13, 2025
0c78aca
Auto merge of #146494 - jdonszelmann:rollup-0bbwwwf, r=jdonszelmann
bors Sep 13, 2025
4da21c1
clean-up
ada4a Sep 12, 2025
1170632
fix(ref_option): don't lint in external and proc-macros
ada4a Sep 12, 2025
75468a0
fix(ref_option): don't lint in external and proc-macros (#15668)
samueltardieu Sep 13, 2025
5bf56ac
tiny clean-up
ada4a Sep 9, 2025
ba9912e
split `returns` module
ada4a Sep 9, 2025
362c487
refactor: split `return` lints into separate modules (#15646)
samueltardieu Sep 13, 2025
ef14d39
fix(needless_return): FP with `cfg`d code after `return`
ada4a Sep 13, 2025
d602b90
fix(needless_return): FP with `cfg`d code after `return` (#15669)
samueltardieu Sep 13, 2025
e5fee1d
Auto merge of #145186 - camsteffen:assoc-impl-kind, r=petrochenkov
bors Sep 13, 2025
d95da61
Auto merge of #145186 - camsteffen:assoc-impl-kind, r=petrochenkov
bors Sep 13, 2025
963bbc6
Remove expect `collapsible_span_lint_calls` and use `span_lint_and_he…
blyxyas Sep 13, 2025
5e32714
Implement `Debug` for `SourceText`
samueltardieu Sep 13, 2025
4e1cea3
Implement `Debug` for `SourceText` (#15672)
Jarcho Sep 14, 2025
841b82c
Remove unnecessary `#![allow]` in test
samueltardieu Sep 14, 2025
87441ff
fix(multiple_unsafe_ops_per_block): ignore unsafe ops from `.await` d…
samueltardieu Sep 14, 2025
bd635a4
Remove unnecessary `#![allow]` in test (#15675)
dswij Sep 14, 2025
9690255
fix(elidable_lifetime_names): avoid overlapping spans in suggestions
ada4a Sep 12, 2025
fdf2c28
fix(elidable_lifetime_names): avoid overlapping spans in suggestions …
samueltardieu Sep 14, 2025
9975abd
refactor `ptr_offset_with_cast`
folkertdev Sep 4, 2025
5e5856b
Refactor `ptr_offset_with_cast` (#15613)
samueltardieu Sep 14, 2025
9116d85
Changelog for Clippy 1.90
alex-semenyuk Sep 13, 2025
0da1739
Recognize canonical `?` pattern with `Result`
samueltardieu Sep 15, 2025
92c99bb
Recognize canonical `?` pattern with `Result` (#15680)
Jarcho Sep 16, 2025
71316d5
Changelog for Clippy 1.90 🍂 (#15670)
flip1995 Sep 16, 2025
ec9d601
Fix `unnecessary_unwrap` false negative when unwrapping a known value…
GalileoCap Sep 16, 2025
ac04829
Remove Rvalue::Len.
cjgillot Sep 14, 2025
f68e1e7
Remove Rvalue::Len.
cjgillot Sep 14, 2025
37af039
Remove `DynKind`
fmease Sep 17, 2025
ce981d8
Rollup merge of #146564 - cjgillot:mir-nolen, r=scottmcm
Zalathar Sep 17, 2025
060b4d8
Auto merge of #146666 - Zalathar:rollup-m2b8low, r=Zalathar
bors Sep 17, 2025
2704990
fix(transmute_ptr_to_ref): don't suggest `.cast` when to-type is DST …
dswij Sep 17, 2025
7a2993c
Fix `unnecessary_unwrap` false negative (#12295) (#15689)
Alexendoo Sep 17, 2025
837f462
Remove automatic feature freeze comment
samueltardieu Sep 17, 2025
985c0a8
Do not look for `Cargo.toml` inside `target`
samueltardieu Sep 17, 2025
c02115f
`match_as_ref`: do not lint if other arm is not `None => None`
samueltardieu Sep 17, 2025
4118a9e
suggestion for `rest_pat_in_fully_bound_structs` (#15648)
samueltardieu Sep 17, 2025
67c6837
`match_as_ref`: do not lint if other arm is not `None => None` (#15693)
Alexendoo Sep 17, 2025
e78a180
Remove jujutsu directory from search tools.
Jarcho Sep 17, 2025
7aa0c97
Remove jujutsu directory from search tools. (#15695)
samueltardieu Sep 17, 2025
ea8b39a
Do not look for `Cargo.toml` inside `target` (#15692)
Jarcho Sep 17, 2025
761d7b2
Rollup merge of #146664 - fmease:clean-up-dyn, r=jdonszelmann
Zalathar Sep 18, 2025
1c2dcb6
test cases for option_if_let_else
dgulotta Sep 18, 2025
3aaf2ce
Auto merge of #146698 - Zalathar:rollup-0oxl4gx, r=Zalathar
bors Sep 18, 2025
7ff1c46
fix `option_if_let_else` when `Err` variant is ignored (#14429)
Manishearth Sep 18, 2025
751253b
Remove automatic feature freeze comment (#15690)
blyxyas Sep 18, 2025
1aad97c
Remove feature-freeze from gh templates
lukaslueg Sep 18, 2025
a4a4695
Remove feature-freeze from gh templates (#15698)
samueltardieu Sep 18, 2025
1065374
Check that `.unwrap_or(LITERAL)` doesn't trigger `unwrap_or_default`
samueltardieu Sep 18, 2025
9ffb7d0
Do not replace `.unwrap_or(vec![])` by `.unwrap_or_default()`
samueltardieu Sep 18, 2025
b58dcb4
Do not replace `.unwrap_or(vec![])` by `.unwrap_or_default()` (#15699)
Jarcho Sep 18, 2025
e86adaf
`redundant_clone`: split iterator checks into `redundant_iter_cloned`…
blyxyas Sep 18, 2025
b0ff571
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Sep 18, 2025
939468d
Bump nightly version -> 2025-09-18
flip1995 Sep 18, 2025
69b607c
Bump Clippy version -> 0.1.92
flip1995 Sep 18, 2025
9bf33ca
Rustup (#15704)
flip1995 Sep 18, 2025
c14231c
Merge commit '20ce69b9a63bcd2756cd906fe0964d1e901e042a' into clippy-s…
flip1995 Sep 18, 2025
3b2796c
Auto merge of #146728 - flip1995:clippy-subtree-update, r=samueltardieu
bors Sep 18, 2025
377862a
Port #[macro_export] to the new attribute parsing infrastructure
JonathanBrouwer Sep 21, 2025
bfa277f
Rollup merge of #143857 - Periodic1911:macro-export, r=jdonszelmann
matthiaskrgr Sep 21, 2025
8c8cc42
Auto merge of #146862 - matthiaskrgr:rollup-1zqootr, r=matthiaskrgr
bors Sep 21, 2025
9ad3e7d
Implement sync subcommand in clippy_dev
flip1995 May 4, 2024
306eccd
Implement release subcommand in clippy_dev
flip1995 May 4, 2024
c7fda78
fixup! Implement sync subcommand in clippy_dev
flip1995 May 16, 2025
ae5f760
fixup! Implement sync subcommand in clippy_dev
flip1995 May 17, 2025
19c34d4
fixup! Implement sync subcommand in clippy_dev
flip1995 Sep 24, 2025
431140b
Bump nightly version -> 2025-09-24
flip1995 Sep 24, 2025
c1bccb6
Merge from rustc
flip1995 Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clippy_dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ edition = "2024"
[dependencies]
chrono = { version = "0.4.38", default-features = false, features = ["clock"] }
clap = { version = "4.4", features = ["derive"] }
directories = "5"
indoc = "1.0"
itertools = "0.12"
opener = "0.7"
walkdir = "2.3"
xshell = "0.2"

[package.metadata.rust-analyzer]
# This package uses #[feature(rustc_private)]
Expand Down
37 changes: 33 additions & 4 deletions clippy_dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,17 @@ fn main() {
),
DevCommand::Deprecate { name, reason } => deprecate_lint::deprecate(clippy.version, &name, &reason),
DevCommand::Sync(SyncCommand { subcommand }) => match subcommand {
SyncSubcommand::UpdateNightly => sync::update_nightly(),
SyncSubcommand::Pull => sync::rustc_pull(),
SyncSubcommand::Push {
repo_path,
user,
branch,
force,
} => sync::rustc_push(repo_path, &user, &branch, force),
},
DevCommand::Release(ReleaseCommand { subcommand }) => match subcommand {
ReleaseSubcommand::BumpVersion => release::bump_version(clippy.version),
ReleaseSubcommand::Commit { repo_path, branch } => release::rustc_clippy_commit(repo_path, branch),
},
}
}
Expand Down Expand Up @@ -329,9 +336,24 @@ struct SyncCommand {

#[derive(Subcommand)]
enum SyncSubcommand {
#[command(name = "update_nightly")]
/// Update nightly version in `rust-toolchain.toml` and `clippy_utils`
UpdateNightly,
/// Pull changes from rustc and update the toolchain
Pull,
/// Push changes to rustc
Push {
/// The path to a rustc repo that will be used for pushing changes
repo_path: String,
#[arg(long)]
/// The GitHub username to use for pushing changes
user: String,
#[arg(long, short, default_value = "clippy-subtree-update")]
/// The branch to push to
///
/// This is mostly for experimentation and usually the default should be used.
branch: String,
#[arg(long, short)]
/// Force push changes
force: bool,
},
}

#[derive(Args)]
Expand All @@ -345,4 +367,11 @@ enum ReleaseSubcommand {
#[command(name = "bump_version")]
/// Bump the version in the Cargo.toml files
BumpVersion,
/// Print the Clippy commit in the rustc repo for the specified branch
Commit {
/// The path to a rustc repo to look for the commit
repo_path: String,
/// For which branch to print the commit
branch: release::Branch,
},
}
51 changes: 50 additions & 1 deletion clippy_dev/src/release.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
use crate::sync::PUSH_PR_DESCRIPTION;
use crate::utils::{FileUpdater, UpdateStatus, Version, parse_cargo_package};
use std::fmt::Write;

use std::fmt::{Display, Write};

use clap::ValueEnum;
use xshell::{Shell, cmd};

static CARGO_TOML_FILES: &[&str] = &[
"clippy_config/Cargo.toml",
Expand Down Expand Up @@ -28,3 +33,47 @@ pub fn bump_version(mut version: Version) {
});
}
}

#[derive(ValueEnum, Copy, Clone)]
pub enum Branch {
Stable,
Beta,
Master,
}

impl Display for Branch {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Branch::Stable => write!(f, "stable"),
Branch::Beta => write!(f, "beta"),
Branch::Master => write!(f, "master"),
}
}
}

pub fn rustc_clippy_commit(rustc_path: String, branch: Branch) {
let sh = Shell::new().expect("failed to create shell");
sh.change_dir(rustc_path);

let base = branch.to_string();
cmd!(sh, "git fetch https://github.com/rust-lang/rust {base}")
.run()
.expect("failed to fetch base commit");
let last_rustup_commit = cmd!(
sh,
"git log -1 --merges --grep=\"{PUSH_PR_DESCRIPTION}\" FETCH_HEAD -- src/tools/clippy"
)
.read()
.expect("failed to run git log");

let commit = last_rustup_commit
.lines()
.find(|c| c.contains("Sync from Clippy commit:"))
.expect("no commit found")
.trim()
.rsplit_once('@')
.expect("no commit hash found")
.1;

println!("{commit}");
}
230 changes: 227 additions & 3 deletions clippy_dev/src/sync.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,102 @@
use crate::utils::{FileUpdater, update_text_region_fn};
use chrono::offset::Utc;
use std::fmt::Write;
use std::process;
use std::process::exit;

pub fn update_nightly() {
use xshell::{Shell, cmd};

const JOSH_FILTER: &str =
":rev(20ce69b9a63bcd2756cd906fe0964d1e901e042a:prefix=src/tools/clippy):/src/tools/clippy:prune=trivial-merge";
const JOSH_PORT: &str = "42042";
const TOOLCHAIN_TOML: &str = "rust-toolchain.toml";
const UTILS_README: &str = "clippy_utils/README.md";

fn start_josh() -> impl Drop {
// Create a wrapper that stops it on drop.
struct Josh(process::Child);
impl Drop for Josh {
fn drop(&mut self) {
#[cfg(unix)]
{
// Try to gracefully shut it down.
process::Command::new("kill")
.args(["-s", "INT", &self.0.id().to_string()])
.output()
.expect("failed to SIGINT josh-proxy");
// Sadly there is no "wait with timeout"... so we just give it some time to finish.
std::thread::sleep(std::time::Duration::from_secs(1));
// Now hopefully it is gone.
if self.0.try_wait().expect("failed to wait for josh-proxy").is_some() {
return;
}
}
// If that didn't work (or we're not on Unix), kill it hard.
eprintln!("I have to kill josh-proxy the hard way, let's hope this does not break anything.");
self.0.kill().expect("failed to SIGKILL josh-proxy");
}
}

// Determine cache directory.
let local_dir = {
let user_dirs = directories::ProjectDirs::from("org", "rust-lang", "clippy-josh").unwrap();
user_dirs.cache_dir().to_owned()
};
println!("Using local cache directory: {}", local_dir.display());

// Start josh, silencing its output.
let mut cmd = process::Command::new("josh-proxy");
cmd.arg("--local").arg(local_dir);
cmd.arg("--remote").arg("https://github.com");
cmd.arg("--port").arg(JOSH_PORT);
cmd.arg("--no-background");
cmd.stdout(process::Stdio::null());
cmd.stderr(process::Stdio::null());
let josh = cmd
.spawn()
.expect("failed to start josh-proxy, make sure it is installed");
// Give it some time so hopefully the port is open.
std::thread::sleep(std::time::Duration::from_secs(1));

Josh(josh)
}

fn rustc_hash() -> String {
let sh = Shell::new().expect("failed to create shell");
// Make sure we pick up the updated toolchain (usually rustup pins the toolchain
// inside a single cargo/rustc invocation via this env var).
sh.set_var("RUSTUP_TOOLCHAIN", "");
cmd!(sh, "rustc --version --verbose")
.read()
.expect("failed to run `rustc -vV`")
.lines()
.find(|line| line.starts_with("commit-hash:"))
.expect("failed to parse `rustc -vV`")
.split_whitespace()
.last()
.expect("failed to get commit from `rustc -vV`")
.to_string()
}

fn assert_clean_repo(sh: &Shell) {
if !cmd!(sh, "git status --untracked-files=no --porcelain")
.read()
.expect("failed to run git status")
.is_empty()
{
eprintln!("working directory must be clean before running `cargo dev sync pull`");
exit(1);
}
}

pub fn rustc_pull() {
const MERGE_COMMIT_MESSAGE: &str = "Merge from rustc";

let sh = Shell::new().expect("failed to create shell");

assert_clean_repo(&sh);

// Update rust-toolchain file
let date = Utc::now().format("%Y-%m-%d").to_string();
let toolchain_update = &mut update_text_region_fn(
"# begin autogenerated nightly\n",
Expand All @@ -20,6 +114,136 @@ pub fn update_nightly() {
);

let mut updater = FileUpdater::default();
updater.update_file("rust-toolchain.toml", toolchain_update);
updater.update_file("clippy_utils/README.md", readme_update);
updater.update_file(TOOLCHAIN_TOML, toolchain_update);
updater.update_file(UTILS_README, readme_update);

let message = format!("Bump nightly version -> {date}");
cmd!(
sh,
"git commit --no-verify -m {message} -- {TOOLCHAIN_TOML} {UTILS_README}"
)
.run()
.expect("FAILED to commit rust-toolchain.toml file, something went wrong");

let commit = rustc_hash();

// Make sure josh is running in this scope
{
let _josh = start_josh();

// Fetch given rustc commit.
cmd!(
sh,
"git fetch http://localhost:{JOSH_PORT}/rust-lang/rust.git@{commit}{JOSH_FILTER}.git"
)
.run()
.inspect_err(|_| {
// Try to un-do the previous `git commit`, to leave the repo in the state we found it.
cmd!(sh, "git reset --hard HEAD^")
.run()
.expect("FAILED to clean up again after failed `git fetch`, sorry for that");
})
.expect("FAILED to fetch new commits, something went wrong");
}

// This should not add any new root commits. So count those before and after merging.
let num_roots = || -> u32 {
cmd!(sh, "git rev-list HEAD --max-parents=0 --count")
.read()
.expect("failed to determine the number of root commits")
.parse::<u32>()
.unwrap()
};
let num_roots_before = num_roots();

// Merge the fetched commit.
cmd!(sh, "git merge FETCH_HEAD --no-verify --no-ff -m {MERGE_COMMIT_MESSAGE}")
.run()
.expect("FAILED to merge new commits, something went wrong");

// Check that the number of roots did not increase.
if num_roots() != num_roots_before {
eprintln!("Josh created a new root commit. This is probably not the history you want.");
exit(1);
}
}

pub(crate) const PUSH_PR_DESCRIPTION: &str = "Sync from Clippy commit:";

pub fn rustc_push(rustc_path: String, github_user: &str, branch: &str, force: bool) {
let sh = Shell::new().expect("failed to create shell");

assert_clean_repo(&sh);

// Prepare the branch. Pushing works much better if we use as base exactly
// the commit that we pulled from last time, so we use the `rustc --version`
// to find out which commit that would be.
let base = rustc_hash();

println!("Preparing {github_user}/rust (base: {base})...");
sh.change_dir(rustc_path);
if !force
&& cmd!(sh, "git fetch https://github.com/{github_user}/rust {branch}")
.ignore_stderr()
.read()
.is_ok()
{
eprintln!(
"The branch '{branch}' seems to already exist in 'https://github.com/{github_user}/rust'. Please delete it and try again."
);
exit(1);
}
cmd!(sh, "git fetch https://github.com/rust-lang/rust {base}")
.run()
.expect("failed to fetch base commit");
let force_flag = if force { "--force" } else { "" };
cmd!(
sh,
"git push https://github.com/{github_user}/rust {base}:refs/heads/{branch} {force_flag}"
)
.ignore_stdout()
.ignore_stderr() // silence the "create GitHub PR" message
.run()
.expect("failed to push base commit to the new branch");

// Make sure josh is running in this scope
{
let _josh = start_josh();

// Do the actual push.
println!("Pushing Clippy changes...");
cmd!(
sh,
"git push http://localhost:{JOSH_PORT}/{github_user}/rust.git{JOSH_FILTER}.git HEAD:{branch}"
)
.run()
.expect("failed to push changes to Josh");

// Do a round-trip check to make sure the push worked as expected.
cmd!(
sh,
"git fetch http://localhost:{JOSH_PORT}/{github_user}/rust.git{JOSH_FILTER}.git {branch}"
)
.ignore_stderr()
.read()
.expect("failed to fetch the branch from Josh");
}

let head = cmd!(sh, "git rev-parse HEAD")
.read()
.expect("failed to get HEAD commit");
let fetch_head = cmd!(sh, "git rev-parse FETCH_HEAD")
.read()
.expect("failed to get FETCH_HEAD");
if head != fetch_head {
eprintln!("Josh created a non-roundtrip push! Do NOT merge this into rustc!");
exit(1);
}
println!("Confirmed that the push round-trips back to Clippy properly. Please create a rustc PR:");
let description = format!("{}+rust-lang/rust-clippy@{head}", PUSH_PR_DESCRIPTION.replace(' ', "+"));
println!(
// Open PR with `subtree update` title to silence the `no-merges` triagebot check
// See https://github.com/rust-lang/rust/pull/114157
" https://github.com/rust-lang/rust/compare/{github_user}:{branch}?quick_pull=1&title=Clippy+subtree+update&body=r?+@ghost%0A%0A{description}"
);
}
Loading
Loading