Commit graph

22971 commits

Author SHA1 Message Date
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
Alexey Semenyuk
95f0991ad4 Add beta-nominated to changelog for 1.88 2025-06-25 15:38:20 +05:00
Philipp Krones
75463814c6
changelog: link to the correct PR (#15125)
changelog: none
2025-06-25 09:13:30 +00:00
bors
708ffd5ccf Auto merge of #142997 - workingjubilee:rollup-6lxec87, r=workingjubilee
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#135731 (Implement parsing of pinned borrows)
 - rust-lang/rust#138780 (Add `#[loop_match]` for improved DFA codegen)
 - rust-lang/rust#142453 (Windows: make `read_dir` stop iterating after the first error is encountered)
 - rust-lang/rust#142633 (Error on invalid signatures for interrupt ABIs)
 - rust-lang/rust#142768 (Avoid a bitcast FFI call in transmuting)
 - rust-lang/rust#142825 (Port `#[track_caller]` to the new attribute system)
 - rust-lang/rust#142844 (Enable short-ice for Windows)
 - rust-lang/rust#142934 (Tweak `-Zmacro-stats` measurement.)
 - rust-lang/rust#142955 (Couple of test suite fixes for cg_clif)
 - rust-lang/rust#142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠)
 - rust-lang/rust#142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect)
 - rust-lang/rust#142982 (Corrected spelling mistake in c_str.rs)
 - rust-lang/rust#142983 (Taint body on invalid call ABI)
 - rust-lang/rust#142988 (Update wasm-component-ld to 0.5.14)
 - rust-lang/rust#142993 (Update cargo)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-25 04:05:47 +00:00
bors
4a4d67227e Auto merge of #140999 - hkBst:update-escaper, r=nnethercote
update to literal-escaper 0.0.4 for better API without `unreachable` and faster string parsing

This is the replacement for just the part of https://github.com/rust-lang/rust/pull/138163 dealing with the changed API of unescape functionality, since that got moved into its own crate.

<del>This uses an unpublished version of literal-escaper (https://github.com/rust-lang/literal-escaper/pull/8).</del>

r? `@nnethercote`
2025-06-25 01:03:30 +00:00
Ada Alakbarova
c11bc75fb0
changelog: link to the correct PR 2025-06-25 01:00:34 +02:00
Jana Dönszelmann
ae6ab44d68 fix clippy 2025-06-24 23:00:31 +02:00
Philipp Krones
ad6e19a269
Changelog for Clippy 1.88 🏄 (#15095)
Violets are red,
Roses are blue,
Summer’s a feeling,
And we’re feeling it too.

<hr>

> (Please ping me when June made it as the cat of the release. I want to
send it to her owner :D)

@xFrednet voila:

![image](https://github.com/user-attachments/assets/7908abd0-76a5-4a64-a553-9c443d4c8b37)

Cats for the next release can be traditionally nominated in the comments
:D
Please be more active and cat-minded 😻

<hr>

changelog: none

r? flip1995
2025-06-24 16:15:22 +00:00
Alexey Semenyuk
2e63c7c684 Changelog for Clippy 1.88 2025-06-23 22:26:52 +05:00
Marijn Schouten
05b74d558f update to literal-escaper 0.0.4 for better API without unreachable and faster string parsing 2025-06-23 06:36:22 +00:00