Commit graph

22979 commits

Author SHA1 Message Date
Alejandra González
b28049d92b
Not on vacation, again! (#15214)
As I said in my on-vacation PR (a little bit late) I'm getting
reincorporated into the review queue. Something that I'd like to do is
implement the reviewer capacity system into Clippy, but seems that it's
not supported yet. https://github.com/rust-lang/triagebot/issues/2007

r? @ghost
changelog:none
2025-07-06 00:35:46 +00:00
blyxyas
b49064e9df Not on vacation, again! 2025-07-06 02:24:22 +02:00
Samuel Tardieu
60a978d2e9
Simplify clippy lints page further (#15208)
Follow-up of rust-lang/rust-clippy#15140.

This time, I removed some unneeded `<span>` wrappings and some unneeded
CSS classes. As usual, no changes in the UI.

Before this PR: 1876091
With this PR: 1751097
Reduction: -6.6%

r? @samueltardieu

changelog: Reduce page size and number of DOM elements on clippy lints
page
2025-07-04 12:54:02 +00:00
Guillaume Gomez
dd1a52f8b6 Simplify clippy lints page further 2025-07-04 13:57:38 +02:00
Samuel Tardieu
da2f0ad53c
Reduce page size and number of DOM elements on clippy lints page (#15140)
This is the first pass of "reducing the size of the clippy lints page"
I'm currently going through. This first one reduces the size page but
mostly reduces the number of DOM elements.

Page size change:
* Before this PR: 1938957
* With this PR: 1876167
* Reduction: -3.2%

r? @Alexendoo

changelog: Reduce page size and number of DOM elements on clippy lints
page
2025-07-04 10:09:34 +00:00
Samuel Tardieu
876e05d307
bump termize (#15207)
Bump termize to remove one more dep with winapi
(https://github.com/JohnTitor/termize/releases/tag/v0.2.0)

changelog: none
2025-07-04 09:19:03 +00:00
klensy
9d8e68d1d6 bump termize 2025-07-04 11:55:03 +03:00
dswij
b631cef729
Remove unneeded .as_bytes() (#15196)
`&str` already implements `AsRef<[u8]>`

changelog: none
2025-07-03 15:51:56 +00:00
dswij
a7c1469530
Do not lint intrinsics as empty loops (#15201)
Fix rust-lang/rust-clippy#15200

changelog: [`empty_loop`]: fix false positive on intrinsic function
declaration
2025-07-03 15:50:30 +00:00
Samuel Tardieu
8bc4add579
Do not lint intrinsics as empty loops 2025-07-03 13:12:40 +02:00
Philipp Krones
321542e611
Correct the Cognitive Complexity lint's documentation (#14915)
changelog: corrected the Cognitive Complexity lint's documentation.
2025-07-03 08:53:03 +00:00
Philipp Krones
8b034bc598
Add Triagebot's concern capability to the Clippy repository (#14916)
This is a newly added triagebot capability, which allows registering and
then resolving concerns with an issue or a pull request. The concerns
are gathered by Triagebot in the issue/PR summary.

Concerns are different from notes: when a concern is resolved, it is
striked through in the issue/PR summary, and a link to the comment
resolving it is also added, whereas a note can only be removed and then
disappears from the summary.

The `has-concerns` label, which must be created at the time of merging
this change, will be automatically set on issues/PRs that have
unresolved concerns, and cleared when all concerns are resolved.

changelog: none
2025-07-02 15:24:32 +00:00
Samuel Tardieu
fc076315d2
Add Triagebot's concern capability to the Clippy repository
This is a newly added triagebot capability, which allows registering and
then resolving concerns with an issue or a pull request. The concerns
are gathered by Triagebot in the issue/PR summary.

Concerns are different from notes: when a concern is resolved, it is
striked through in the issue/PR summary, and a link to the comment
resolving it is also added, whereas a note can only be removed and then
disappears from the summary.

The `has-concerns` label, which must be created at the time of merging
this change, will be automatically set on issues/PRs that have
unresolved concerns, and cleared when all concerns are resolved.
2025-07-02 15:51:16 +02:00
Samuel Tardieu
8e4b5448cf
use ui_test dependency builder for test dependencies (#14883)
changelog: none

This tries to make progress on
https://github.com/rust-lang/rust/issues/78717 by using the ui_test
dependency handling instead of linking in the dependencies of clippy
itself with the tests. This partially reverts
https://github.com/rust-lang/rust-clippy/pull/11045. However, we still
use the old style of dealing with dependencies for clippy's own crates
and the "internal" tests, as otherwise those would get rebuilt which
takes too long.
2025-07-02 13:44:39 +00:00
Samuel Tardieu
ebdbd7cfc0
doc_nested_refdefs: do not falsely report checkboxes as refdefs (#15146)
changelog: [`doc_nested_refdefs`]: fix false positive where [task
lists](http://pulldown-cmark.github.io/pulldown-cmark/third_party/gfm_tasklist.html)
are reported as refdefs
2025-07-01 22:31:15 +00:00
Samuel Tardieu
fc3d5e6827
Remove unneeded .as_bytes()
`&str` already implements `AsRef<[u8]>`
2025-07-02 00:25:37 +02:00
Samuel Tardieu
ad15b60022
Fix std-instead-of-core FP when not all items come from the new crate (#15165)
Closes rust-lang/rust-clippy#15143

Covering edge cases missed in rust-lang/rust-clippy#15016

changelog: [`std-instead-of-core`] fix FP when not all items come from
the new crate
2025-07-01 19:06:03 +00:00
yanglsh
9eb8512255 fix: std-instead-of-core FP when not all items come from the new crate 2025-07-01 22:46:24 +08:00
Ralf Jung
5ff1a4164c use ui_test dependency builder for non-internal test dependencies 2025-07-01 13:27:49 +02:00
Philipp Krones
0732085b43
Polishing changelog update doc (#15167)
Polishing changelog update doc

changelog: none

r? @flip1995
2025-07-01 07:45:53 +00:00
Philipp Krones
a53144e8dd
Activate feature freeze automated notice (#15177)
changelog: none
2025-07-01 07:43:11 +00:00
Samuel Tardieu
e32c65d714
Activate feature freeze automated notice 2025-07-01 09:08:46 +02:00
Samuel Tardieu
4c9980966b
bump ui_test to 0.30.1 (#15184)
@oli-obk I am not entirely sure whether this is the intended port, the
types look a bit gnarly and the changelog doesn't say anything about
this breakage... but https://github.com/oli-obk/ui_test/pull/316 does
something similar.

*Please write a short comment explaining your change (or "none" for
internal only changes)*

changelog: none
2025-07-01 05:17:42 +00:00
Ralf Jung
1fcd632be3 bump ui_test to 0.30.1 2025-07-01 07:08:11 +02:00
llogiq
bca8931bbb
Fix coerce_container_to_any false positive on autoderef (#15057)
Fixes the false positive reported in rust-lang/rust-clippy#15045. ~I
still need to work out how to fix the suggestion.~

changelog: none
2025-06-30 20:00:06 +00:00
Timo
936baca0cd
Consider deref'ed argument as non-temporary (#15172)
If there are more than one dereference (there is one corresponding
matched with a borrow in any case), consider that the argument might
point to a place expression, which is the safest choice.

Also, use an appropriate number of dereferences in suggestions involving
arguments using themselves multiple dereferences.

Fixes rust-lang/rust-clippy#15166

changelog: [`swap_with_temporary`]: fix false positive leading to
different semantics being suggested, and use the right number of
dereferences in suggestion

r? y21

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

-
[beta-nomination](https://github.com/rust-lang/rust-clippy/pull/15172#issuecomment-3016752569)
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-06-30 18:46:11 +00:00
alexey semenyuk
f3b3c096fd Polishing changelog update doc 2025-06-30 17:19:12 +05:00
Samuel Tardieu
b57bf6b64d
Fix cast_possible_truncation should not suggest inside const context (#15164)
Closes rust-lang/rust-clippy#15163

This lint should not give suggestions in const context for now, since a
lot of the commonly used method of `Result` is not const.

changelog: [`cast_possible_truncation`] fix improperly give suggestions
inside const context
2025-06-29 21:53:52 +00:00
yanglsh
9cba70b283 fix: cast_possible_truncation should not suggest inside const context 2025-06-30 01:33:35 +08:00
Samuel Tardieu
1f76a23d4d
missing_panics_doc: Allow unwrap() and expect() inside const-only contexts (#15170)
changelog: [`missing_panics_doc`]: Allow unwrap() and expect()s in
const-only contexts

Fixes rust-lang/rust-clippy#15169.

As far as I can tell, this change keeps this lint in line with similar
issues and their fixes such as
https://github.com/rust-lang/rust-clippy/pull/13382 and
rust-lang/rust-clippy#10240, so I feel pretty confident that the
behavior it exhibits after this PR is correct.
2025-06-29 17:12:04 +00:00
itsjunetime
ff3c9c15b7
missing_panics_doc: Correctly distinguish maybe-const vs always-const contexts for missing_panics_doc
changelog: [`missing_panics_doc`]: Allow unwrap() and expect()s in const-only contexts
2025-06-29 10:54:13 -06:00
Samuel Tardieu
ad7de948a8
Consider deref'ed argument as non-temporary
If there are more than one dereference (there is one corresponding
matched with a borrow in any case), consider that the argument might
point to a place expression, which is the safest choice.

Also, use an appropriate number of dereferences in suggestions involving
arguments using themselves multiple dereferences.
2025-06-29 16:36:50 +02:00
dswij
428208eb9b
Fix disallowed_script_idents FP on identifiers with _ (#15123)
Closes rust-lang/rust-clippy#15116

The cause for this issue is that `_` belongs to the `Common` catagory in
unicode instead of `Latin` like other ASCII alphabets. Since ASCII
characters are always allowed, I just added an extra `is_ascii()` check
to ensure this.

changelog: [`disallowed_script_idents`] fix FP on identifiers with `_`
2025-06-28 08:48:07 +00:00
dswij
8633bcbc3c
zero_ptr: lint in const context as well (#15152)
The lint was extra restrictive, and didn't suggest using
`core::ptr::null` and `core::ptr::null_mut` in `const` contexts although
they have been const-stabilized since Rust 1.24.

changelog: [`zero_ptr`]: lint in `const` context as well

@rustbot label +I-false-negative +C-bug
2025-06-28 08:46:57 +00:00
yanglsh
7e406e276a fix: disallowed_script_idents FP on identifiers with _ 2025-06-27 22:16:58 +08:00
Samuel Tardieu
9117cb0223
zero_ptr: lint in const context as well
The lint was extra restrictive, and didn't suggest using
`core::ptr::null` and `core::ptr::null_mut` in `const` contexts although
they have been const-stabilized since Rust 1.24.
2025-06-26 23:09:37 +02:00
Samuel Tardieu
c5dbd1de07
Lint docs: Sort versions, so that stable comes first (#15149)
I expect that most people use stable Clippy. So having `master` be the
first documentation link in the list is weird. Now the versions are
sorted stable->beta->master.

changelog: none
2025-06-26 19:13:14 +00:00
Philipp Krones
22c0226aff
Lint docs: Sort versions, so that stable comes first
I expect that most people use stable Clippy. So having `master` be the first
documentation link in the list is weird. Now the versions are sorted
stable->beta->master.
2025-06-26 19:59:04 +02:00
Philipp Krones
cd15aeb70b
Ping notriddle when a clippy lint in clippy_lints/doc is modified (#15147)
Related to [this Zulip
thread](https://rust-lang.zulipchat.com/#narrow/channel/257328-clippy/topic/Reviewing.20the.20.60doc.60.20lints/with/525943439).

@notriddle Would you want that?

changelog: none
2025-06-26 17:48:02 +00:00
Philipp Krones
c950602c01
Rustup (#15148)
r? @ghost

changelog: none
2025-06-26 17:34:27 +00:00
Philipp Krones
32fcff8aa8
Bump Clippy version -> 0.1.90 2025-06-26 19:30:02 +02:00
Philipp Krones
9b41d8fdb6
Bump nightly version -> 2025-06-26 2025-06-26 19:29:50 +02:00
Philipp Krones
90364dd178
Merge remote-tracking branch 'upstream/master' into rustup 2025-06-26 19:29:33 +02:00
Philipp Krones
8050e591b6
Update book and templates with feature freeze (#14456)
This PR announces the feature freeze period talked about in
https://github.com/rust-lang/rust-clippy/issues/14364

1. Add the page to the book
2. Modify the in-Github templates.
3. The third commit (to be squashed into the first) rolls the date
mentioned 6 weeks (so, starting on May 9th and ending on August 20th).
This gives us a comfortable buffer to make choices for this period.

We have a pending discussion on the #14364. So having some more time to
make choices is very nice. I'm also preparing a Github action for
detecting new lints and posting a comment about the feature freeze
(being worked on in another branch)

Something I'd like comment on is the date formatting. I'm not sure if
"May 9th to the first of August" is the correct way of writing this
information in a book 😅.

changelog: Announce the feature freeze from May 9th to the first of
August
2025-06-26 16:45:13 +00:00
Samuel Tardieu
4116a72a08
Ping notriddle when a clippy lint in clippy_lints/doc is modified 2025-06-26 18:45:11 +02:00
Philipp Krones
b88d162d2a
Add link to the feature freeze tracking issue to the book 2025-06-26 18:40:51 +02:00
Philipp Krones
40554ef4aa
Add beta-accepted to CHANGELOG for 1.88 (#15130)
Add beta-accepted to CHANGELOG for 1.88 since it was missed at
rust-lang/rust-clippy#5095

changelog: none

r? flip1995
2025-06-26 16:30:45 +00:00
Michael Howell
664b143dac doc_nested_refdefs: do not falsely report checkboxes as refdefs 2025-06-26 09:19:59 -07:00
Guillaume Gomez
ecb397a365 Reduce page size and number of DOM elements on clippy lints page 2025-06-25 20:39:14 +02:00
Alexey Semenyuk
95f0991ad4 Add beta-nominated to changelog for 1.88 2025-06-25 15:38:20 +05:00