Commit graph

24208 commits

Author SHA1 Message Date
Tom Fryers
da7bde794c
Fix mod_module_files FP for tests in workspaces
Workspaces don't have their integration tests in tests/ at the root, so
this check missed them.
2025-11-07 12:59:25 +00:00
llogiq
8ed05abef3
Fix missing_asserts_for_indexing changes assert_eq to assert (#16040)
Closes rust-lang/rust-clippy#16026

changelog: [`missing_asserts_for_indexing`] fix wrongly changing
`assert_eq` to `assert`
2025-11-06 22:28:32 +00:00
Jason Newcomb
c004be44c8
Fix nonminimal_bool wrongly unmangled terms (#16017)
Closes rust-lang/rust-clippy#16014

changelog: [`nonminimal_bool`] fix wrongly unmangled terms
2025-11-06 18:26:11 +00:00
llogiq
36324e8e9c
Don't flag cfg(test) as multiple inherent impl (#16041)
changelog: [`multiple_inherent_impl`]: Don't flag cfg(test) impls as
repeats

fixes rust-lang/rust-clippy#13040
2025-11-06 18:25:48 +00:00
Alex Macleod
52a39998fa
Fix missing_inline_in_public_items fail to fulfill expect in --test build (#15320)
Closes rust-lang/rust-clippy#13394

changelog: [`missing_inline_in_public_items`] fix failure to fulfill
`expect` in `--test` build
2025-11-06 16:49:21 +00:00
Nick Drozd
8539de9ccf Don't flag cfg(test) as multiple inherent impl 2025-11-06 09:49:10 -06:00
yanglsh
a86dd63818 Make missing_inline_in_public_items warn on executables 2025-11-06 15:29:30 +00:00
Linshu Yang
0ab135f9d0 fix: missing_asserts_for_indexing changes assert_eq to assert 2025-11-06 15:12:08 +00:00
llogiq
c95d95bf95
Fix match_single_binding suggests wrongly inside tuple (#15539)
Closes rust-lang/rust-clippy#15537
Closes rust-lang/rust-clippy#15840

changelog: [`match_single_binding`] fix wrong suggestions inside tuple
2025-11-06 11:01:03 +00:00
Linshu Yang
c100a0808b fix: nonminimal_bool wrongly unmangled terms 2025-11-05 16:14:59 +00:00
Philipp Krones
8769afffe6
CI: do not run merge queue tests on tier 2 x86_64-apple-darwin (#16035)
x86_64-apple-darwin has been demoted to tier 2 since Rust 1.90.
Moreover, Github runners for macOS 14 on x86_64 are much slower than the
others.

changelog: none

r? flip1995
2025-11-05 09:27:37 +00:00
Samuel Tardieu
3dab273824
Do not run merge queue tests on tier 2 x86_64-apple-darwin
x86_64-apple-darwin has been demoted to tier 2 since Rust 1.90.
Moreover, Github runners for macOS 14 on x86_64 are much slower than the
others.
2025-11-05 09:35:10 +01:00
Samuel Tardieu
4eac58a0b0
Consider type conversion that won't overflow (#15950)
Fix rust-lang/rust-clippy#15943

```rust
pub fn from_days(days: u8) -> Duration {
    Duration::from_secs(86400 * u64::from(days))
}
```

An initial foundation that can be used for future improvements. It is
been a while since I touched Clippy so feel free to indicate better
designs if applicable.

Looks like https://github.com/rust-lang/rust-clippy/pull/15342 will help
but it is unclear when it will be finished. This PR provides a partial
solution for the current time.

changelog: [`arithmetic_side_effects`]: Consider type conversion that
won't overflow
2025-11-05 08:07:35 +00:00
Philipp Krones
deff3fd050
CI: use macOS 14 instead of GitHub-deprecated macOS 13 in merge queue checks (#16032)
The "macos 13" runners are being phased out
(https://github.com/actions/runner-images/issues/13046).

Some jobs have started to fail in the CI while attempting a merge
because of the brownout period.

changelog: none

r? flip1995
2025-11-05 07:46:07 +00:00
Samuel Tardieu
0d6fdc089a
Use macOS 14 instead of GitHub-deprecated macOS 13
The "macos 13" runners are being phased out
(https://github.com/actions/runner-images/issues/13046).
2025-11-05 01:00:11 +01:00
Catherine Flores
ad7fc4f468
Fix missing_transmute_annotations example (#16024)
The "bad" example in the `missing_transmute_annotations` example didn't
actually trigger the lint and so wasn't a "bad" example. This PR
replaces it with an actual "bad" example.

It was discussed on zulip
[here](https://rust-lang.zulipchat.com/#narrow/channel/257328-clippy/topic/missing_transmute_annotations/near/547657390).

changelog: Fix `missing_transmute_annotations` example

r? @Centri3
2025-11-03 19:38:41 +00:00
Guillaume Gomez
0afbb65bac Remove no_run tags on missing_transmute_annotations code examples 2025-11-03 20:28:00 +01:00
Guillaume Gomez
8f9ef1cb8f Fix missing_transmute_annotations example 2025-11-03 20:22:00 +01:00
Samuel Tardieu
a456519ce0
fix(let_and_return): disallow _any_ text between let and return (#16006)
Fixes https://github.com/rust-lang/rust-clippy/issues/15987

changelog: [`let_and_return`]: disallow _any_ text between let and
return
2025-11-02 09:28:39 +00:00
Samuel Tardieu
e121ab877e
Fix replace_box FP when the box is moved (#15984)
Closes rust-lang/rust-clippy#15968

changelog: [`replace_box`] fix FP when the box is moved

r? samueltardieu As you wish

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

-
[Beta-nomination](https://github.com/rust-lang/rust-clippy/pull/15984#issuecomment-3469127087)
by [samueltardieu](https://github.com/samueltardieu)

*Managed by `@rustbot`—see
[help](https://forge.rust-lang.org/triagebot/note.html) for details*

<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
2025-11-02 09:12:28 +00:00
Linshu Yang
098ded3160 fix: replace_box FP when the box is moved 2025-11-02 03:23:16 +00:00
llogiq
6729799845
Fix spacing typo in new inefficient_to_string info (#15888)
changelog: none
2025-11-01 22:11:09 +00:00
llogiq
8e8fe61198
Introduce helper functions for Some(x)/None patterns and expressions (#15930)
Reduces boilerplate a bit

changelog: none
2025-11-01 22:10:25 +00:00
Timo
31d8210a53
unused_enumerate_index: move to loops lint pass (#15279)
Needed to split the lint crate.

Both the method and loop versions of the lint should also behave the
same now.

changelog: None
2025-11-01 19:39:44 +00:00
Ada Alakbarova
6bc8d214b4
fix(let_and_return): disallow _any_ text between let and return 2025-11-01 18:01:28 +01:00
Jason Newcomb
7562179364
Overhaul and document clippy_utils::attrs (#15763)
For https://github.com/rust-lang/rust-clippy/issues/15569

changelog: none
2025-11-01 10:50:07 +00:00
Jason Newcomb
a2c13c1153
refactor(ptr): split each lint into a separate module (#16001)
changelog: none
2025-11-01 05:37:59 +00:00
Jason Newcomb
f51c555c78
clean-up unnested_or_patterns (#15344)
misc stuff I found while working on rust-lang/rust-clippy#15343. Not
sure about the `P` part, but the rest should be fine

changelog: none
2025-11-01 04:15:19 +00:00
Ada Alakbarova
ccd51307df
extract each lint into its own module 2025-10-31 23:44:46 +01:00
Ada Alakbarova
54a84c1d76
move ptr.rs to ptr/mod.rs 2025-10-31 22:21:19 +01:00
Ada Alakbarova
e7b4ae869e
clean-up 2025-10-31 22:20:53 +01:00
Ada Alakbarova
44e3b16e7c
rm some Boxes 2025-10-31 21:21:20 +01:00
Ada Alakbarova
31b7ddc939
use if let 2025-10-31 21:21:20 +01:00
Ada Alakbarova
adf38c0b62
match on kind directly
this destructuring is.. a bit weird
2025-10-31 21:21:18 +01:00
Ada Alakbarova
34abe4ef70
use ExtractIf 2025-10-31 21:21:16 +01:00
Jason Newcomb
e6298692a5
extend needless_collect (#14361)
changelog: [`needless_collect`]: extend needless_collect to lint more
cases

Fix #14350
2025-10-31 19:12:13 +00:00
Alex Macleod
c23eed6ddc
refactor(write): split each lint into its own module (#15857)
changelog: none
2025-10-31 19:11:42 +00:00
Philipp Krones
c936595d17
Rustup (#16000)
r? @ghost

changelog: none
2025-10-31 18:04:36 +00:00
Philipp Krones
a53104042e
Bump Clippy version -> 0.1.93 2025-10-31 18:58:42 +01:00
Philipp Krones
2b9c8f1981
Bump nightly version -> 2025-10-31 2025-10-31 18:58:33 +01:00
Philipp Krones
f64e401f74
Merge remote-tracking branch 'upstream/master' into rustup 2025-10-31 18:58:07 +01:00
Jason Newcomb
0b784f8ed6
Remove/fix setTimeout logic in lints page (#15983)
If you double clicked the clipboard icon it would become permanently
stuck as the tick, it now resets correctly

The search timeout looks intended to implement debouncing but as
`searchState.timeout` is never assigned to it just delays the update by
50ms. The logic and delay are removed, so the search is now 50ms more
responsive

changelog: none
2025-10-31 16:49:42 +00:00
Ada Alakbarova
0fcb000aed
extract each lint into its own module 2025-10-31 17:40:14 +01:00
Ada Alakbarova
6c9342782e
move write.rs to write/mod.rs 2025-10-31 17:40:13 +01:00
Ada Alakbarova
938dd5f404
misc: test cases with escaping are mostly autofixable now 2025-10-31 17:40:12 +01:00
Alex Macleod
88554d64bb Remove/fix setTimeout logic in lints page 2025-10-31 15:05:35 +00:00
Jason Newcomb
e415911f49
fix(use_debug): don't get confused by nested Debug impls (#15946)
Fixes https://github.com/rust-lang/rust-clippy/issues/15942

changelog: [`use_debug`]: don't get confused by nested `Debug` impls
2025-10-31 08:10:46 +00:00
Jason Newcomb
bcc40ce3b9
fix(double_parens): don't lint in proc-macros (#15939)
Fixes https://github.com/rust-lang/rust-clippy/issues/15852

changelog: [`double_parens`]: don't lint in proc-macros
2025-10-31 08:09:28 +00:00
Jason Newcomb
b69d2ff639
Changelog for Clippy 1.91 🎃 (#15971)
Violets are red,
Roses are blue,
Ghosts haunt the night,
And pumpkins grin too.

-----

Meet @thefiddler's Mowgli and @bjornwein's Buffy, our winners at
https://github.com/rust-lang/rust-clippy/pull/15670
It's our first dual winner of the Clippy Cat Changelog Contest!

<img width="1100" height="714" alt="image"
src="https://github.com/user-attachments/assets/ee9399d5-f8bd-45bb-a18c-c24a94817672"
/>

<img width="1664" height="1940" alt="image"
src="https://github.com/user-attachments/assets/2734c5df-2ebc-465f-89e4-5801f4d33678"
/>

-----

Cats for the next release can be traditionally nominated in the
comments.

changelog: none

r? flip1995
2025-10-31 07:53:52 +00:00
dswij
5e7ce90dd8
Improve doc comment code language tag parsing, don't use a full parser (#15967)
Now only tokenizes the contents of code blocks instead of spawning a
thread for a full parser

The language tag handling now correctly picks up things like `rust,
ignore`

`no_test` (rust-lang/rust-clippy#10491) is no longer specially handled,
rustdoc considers `rust,no_test` to be a regular test

changelog: [`needless_doctest_main`], [`test_attr_in_doctest`]: now
handles whitespace in language tags
2025-10-30 15:51:36 +00:00