Commit Graph

23342 Commits

Author SHA1 Message Date
Samuel Tardieu dfbbeee151 Get myself off assignment rotation (#15459)
r? ghost
changelog: none
2025-08-11 16:31:45 +00:00
Samuel Tardieu 2ba5fe8ddc Get myself off assignment rotation 2025-08-11 18:26:24 +02:00
Alejandra González 1f9a6ad00e Correct needless_borrow_for_generic_args doc comment (#15440)
I think the comment is meant to refer to `needless_borrow_count`.

changelog: none
2025-08-11 14:30:14 +00:00
Philipp Krones 02eb548054 doc: use is_some_and instead of map_or(false, _) (#15455)
see
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or

changelog: none
2025-08-11 11:04:51 +00:00
Ada Alakbarova 2293095c91 doc: use is_some_and instead of map_or(false, _)
see
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
2025-08-11 09:48:20 +02:00
Alex Macleod 7dd3ecb1f9 Update CONTRIBUTING.md to use RustRover instead of IntelliJ Rust (#15448)
JetBrains has transitioned from the IntelliJ Rust plugin to RustRover as
their dedicated Rust IDE. This updates the documentation to reflect this
change while maintaining backward compatibility with the existing `cargo
dev setup intellij` command.

Changes:
- Replace IntelliJ Rust references with RustRover in CONTRIBUTING.md
- Update links to point to official RustRover homepage
- Update development guide in book/src/development/basics.md
- Keep existing command names for backward compatibility

**Question**: Do we also need to change the `intellij` command to
`rustrover`?

fixes rust-lang/rust-clippy#15406

changelog: Update CONTRIBUTING.md to reference RustRover instead of
deprecated IntelliJ Rust
2025-08-10 13:52:35 +00:00
Timo 14dfc03597 feat: introduce path_to_local_with_projections (#15396)
As suggested in
https://github.com/rust-lang/rust-clippy/pull/15268#discussion_r2249249661

WIP because:
- [x] what should be done with the now-error-pattern-less
`tests/ui/double_ended_iterator_last_unfixable.rs`?
- [x] is the change in behaviour of `double_ended_iterator_last` okay in
general?
- cc @samueltardieu because this changes the code you added in
https://github.com/rust-lang/rust-clippy/pull/14140

changelog: none

r? @y21
2025-08-10 10:33:05 +00:00
Samuel Tardieu e6b63d15fa fix &str type check in from_str_radix_10 (#15410)
minor fix in `from_str_radix_10` lint, `is_type_diagnostic_item` only
checks `Adt`, use `.is_str()` instead

changelog: [`from_str_radix_10`]: properly lint references to `&str` as
well
2025-08-09 22:30:18 +00:00
llogiq f3ced4d1c1 expect_fun_call: move helper functions out of the main one (#15446)
just a clean-up

changelog: none
2025-08-09 21:47:37 +00:00
Ada Alakbarova 04606e27dc introduce path_to_local_with_projections
combine two similar arms

use in `eager_transmute`

use in `double_ended_iterator_last`

use different numbers in the new test case to avoid possible confusion

move the other "unfixable" case as well; it shouldn't lint anyway, so
having it in the main test file is fine
2025-08-09 20:27:30 +02:00
Alex Macleod e6223005af Add "PowerPC" to the list of valid CamelCase strings in docs (#15447)
```
changelog: [`doc-valid-idents`]: add "PowerPC" to the list of words not considered as identifiers
```

---

changelog: add "PowerPC" to the list of words not considered as
identifiers by `doc-valid-idents` rule
2025-08-09 16:46:06 +00:00
reddevilmidzy aeec153974 Update CONTRIBUTING.md to use RustRover instead of IntelliJ Rust
JetBrains has transitioned from the IntelliJ Rust plugin to RustRover
as their dedicated Rust IDE. This updates the documentation to reflect
this change while maintaining backward compatibility with the existing
cargo dev setup intellij command.

Changes:
- Replace IntelliJ Rust references with RustRover in CONTRIBUTING.md
- Update links to point to official RustRover homepage
- Update development guide in book/src/development/basics.md
- Keep existing command names for backward compatibility
2025-08-10 01:45:54 +09:00
Dave Rolsky 5c617b4867 Add "PowerPC" to the list of valid CamelCase strings in docs 2025-08-09 10:28:14 -05:00
dswij 386372a0e4 [[infinite_loop] fix infinite loop false positive (#15157)
changelog: [infinite_loop]: Improve handling of infinite loops in async
blocks

Fix rust-lang/rust-clippy#14000

This PR refines the [infinite_loop] lint to avoid false positives when
infinite loops occur inside async blocks that are not awaited (such as
those that are spawned or assigned to variables for later use). The lint
will now only trigger when the async block containing the loop is
directly awaited.
2025-08-09 15:08:54 +00:00
Jason Newcomb ea7ebaa825 Do not attempt to compute size of a type with escaping lifetimes (#15434)
A type with escaping bound vars cannot be wrapped in a dummy binder
during size computation.

Fixes rust-lang/rust-clippy#15429

changelog: [`zero_sized_hashmap_values`]: fix ICE in types with escaping
lifetimes

r? Jarcho

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

- [Beta
nomination](https://github.com/rust-lang/rust-clippy/pull/15434#issuecomment-3164866684)
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-08-09 14:09:43 +00:00
Ada Alakbarova d5f2b66bd8 expect_fun_call: move helper functions out of the main one
allows removing the `#[allow(clippy::too_many_lines)]`
2025-08-09 11:50:00 +02:00
Samuel Tardieu 388d3f3374 use a let-chain in needless_bool (#15444)
This is a small thing I noticed while looking into
https://github.com/rust-lang/rust-clippy/issues/8014. Since I ultimately
decided not to change the code as a response to the issue, I'm now left
with this one commit, and I feel a bit unsure about making a PR just for
that. This is a problem I have relatively often, so I'd like to know
whether I should to batch these small changes somehow, or whether these
small PRs are fine after all

changelog: none
2025-08-08 21:56:02 +00:00
Samuel Moelius 7057cd8f4f Correct needless_borrow_for_generic_args doc comment 2025-08-08 11:06:39 -04:00
Ada Alakbarova 82c1ce77ed misc: use let-chains 2025-08-08 16:56:39 +02:00
Samuel Tardieu 22088843b4 move crosspointer_transmute from complexity to suspicious (#15403)
changelog: [`crosspointer_transmute`]: move from `complexity` to
`suspicious`

this looks to me like an obvious miscategorisation -- and there was
already [a proposal to move the
lint](https://github.com/rust-lang/rust-clippy/issues/6626#issuecomment-1279775089)
2025-08-08 11:14:15 +00:00
Samuel Tardieu d654c267f8 eta_reduction: don't refer to ADT constructors as "function"s (#15436)
fixes https://github.com/rust-lang/rust-clippy/issues/8817

changelog: [`eta_reduction`]: don't refer to ADT constructors as
"function"s
2025-08-08 09:16:31 +00:00
Ada Alakbarova ac9361e18a eta_reduction: don't refer to ADT constructors as "function"s 2025-08-08 11:00:49 +02:00
Chengxu Bian c945393f67 fix inf loop 2025-08-07 22:17:37 -04:00
Ada Alakbarova 7aa75635c8 move crosspointer_transmute from complexity to suspicious 2025-08-07 23:44:33 +02:00
Alejandra González 32a216ecab Reuse previous Vec allocation in loop (#15428)
Minor optimization to avoid deallocating/reallocating a new `Vec` in the
top `check_doc` loop.

changelog: none

r? blyxyas
2025-08-07 18:21:20 +00:00
Samuel Tardieu c752fb2802 Do not attempt to compute size of a type with escaping lifetimes
A type with escaping bound vars cannot be wrapped in a dummy binder
during size computation.
2025-08-07 18:29:10 +02:00
Philipp Krones 334fb906ae Rustup (#15431)
r? @ghost

changelog: none
2025-08-07 14:53:47 +00:00
Philipp Krones d5f9f7576c Bump Clippy version -> 0.1.91 2025-08-07 16:48:16 +02:00
Philipp Krones 2893dc8019 Bump nightly version -> 2025-08-07 2025-08-07 16:47:57 +02:00
Philipp Krones f2b7e9ff52 Merge remote-tracking branch 'upstream/master' into rustup 2025-08-07 16:47:42 +02:00
Samuel Tardieu faba846a09 Fix typo in lint issue template (#15427)
Small typo I found while looking at recent lint requests/issues.

changelog: none
2025-08-07 08:24:01 +00:00
Samuel Tardieu cece1b95de Reuse previous Vec allocation in loop 2025-08-07 10:12:07 +02:00
y21 a5af84c399 Fix "comparision" typo in new lint template 2025-08-07 10:09:15 +02:00
Alejandra González 4cb43f4c41 Optimize needless_bool lint (#15423)
Two optimizations have been done when checking for the context in which
to apply the lint:

- Checking for the mere presence of comments does not require building a
`String` with the comment to then check if it is empty and discard it.
- Checking for the presence of comment can be done after we have checked
that we do have a `if` construct that we intend to lint instead of for
every expression.

changelog: none

r? blyxyas
2025-08-06 17:59:23 +00:00
Samuel Tardieu 8602faa6ff Optimize needless_bool lint
Two optimizations have been done when checking for the context in which
to apply the lint:

- Checking for the mere presence of comments does not require building a
  `String` with the comment to then check if it is empty and discard it.
- Checking for the presence of comment can be done after we have checked
  that we do have a `if` construct that we intend to lint instead of for
  every expression.
2025-08-06 19:49:22 +02:00
Alejandra González a4d43215b8 Optimize incompatible_msrv lint (#15422)
This limits repeated lookups in pre-checks (to determine if a MSRV
should be checked), especially when those require locking up an
interner:

- The `core` crate is looked up once when creating the lint, instead of
comparing the crate name with `sym::core` at every check.
- `span.ctxt().outer_expn_data()` is lookup up only once.

changelog: none
r? blyxyas
2025-08-06 16:25:34 +00:00
Philipp Krones 925710d73e Remove CSS bootstrap dependency (#15251)
Follow-up of https://github.com/rust-lang/rust-clippy/pull/15208.

This PR removes the CSS `bootstrap` dependency which contains 1504 CSS
rules and weights 16.1 kB minified. Considering we used less than 50 of
these rules, it's quite a waste.

So this time, there are minor UI changes:
* The "expand/collapse all" buttons icon changed. It now uses the one
from font-awesome. It's quite close but not exactly the same.
* The layout is slightly different (you need to switch between two tabs
to actually see the difference).

Before this PR:

<img width="719" height="515" alt="image"
src="https://github.com/user-attachments/assets/1f067046-4ee9-49ee-bf38-50a8bf9888f2"
/>

With this PR:

<img width="719" height="515" alt="image"
src="https://github.com/user-attachments/assets/80331c98-1a1e-418f-b481-5b3f5c276926"
/>

With this, we will be able to go even further on reducing the page size
next. =D

This time, the DOM size itself reduced a bit but the difference is too
small to be noteworthy.

r? @samueltardieu

changelog: Remove CSS bootstrap dependency
2025-08-06 16:02:08 +00:00
Samuel Tardieu 26911aa32c Optimize incompatible_msrv lint
This limits repeated lookups in pre-checks (to determine if a MSRV
should be checked), especially when those require locking up
an interner:

- The `core` crate is looked up once when creating the lint, instead of
  comparing the crate name with `sym::core` at every check.
- `span.ctxt().outer_expn_data()` is lookup up only once.
2025-08-06 16:30:31 +02:00
llogiq d98d7c0ee8 Fix suggestion for collapsible_if and collapsible_else_if when the inner if is enclosed in parentheses (#15304)
changelog: [`collapsible_else_if`]: fix suggestion when inner `if` as
wrapped in parentheses
changelog: [`collapsible_if`]: fix suggestion when inner `if` as wrapped
in parentheses

fixes https://github.com/rust-lang/rust-clippy/issues/15303

I'm sure this is a bit dirty, but don't currently see a better way.
2025-08-06 12:45:27 +00:00
Guillaume Gomez 102e39fa51 Remove CSS bootstrap dependency 2025-08-06 11:46:53 +02:00
Guillaume Gomez 04e794a0b9 Fix CSS indent 2025-08-06 11:30:09 +02:00
Philipp Krones 7673826138 expand the issue template for new lints (#15336)
When I first tried contributing to clippy,
I encountered the problem that a lot of lint suggestions overlapped with
existing lints, so I would spend a bunch of time implementing something
only to figure out it wasn't actually needed.

The "comparison with existing lints" field should hopefully reduce this
somewhat, while not incresing the burden of
requesting a new lint too much due to not being mandatory.

changelog: none
2025-08-06 09:03:10 +00:00
Alejandra González 03ae8b0464 Do not lint for wildcard_imports in external macro (#15413)
Fixes rust-lang/rust-clippy#15412

changelog: [`wildcard_imports`]: do not lint code coming from an
external macro
2025-08-05 22:32:08 +00:00
Zihan 7a113811fa fix &str type check in from_str_radix_10
changelog: none

Signed-off-by: Zihan <zihanli0822@gmail.com>
2025-08-05 09:50:17 -04:00
Samuel Tardieu 8396d73798 Fix unnecessary_sort_by lint method consistency in message and suggestion (#15416)
The `unnecessary_sort_by` lint displays different method names in
message and suggestion, which is a bit confusing.

Also got a question about `UNNECESSARY_SORT_BY` lint definition. Should
we extend its message to also cover *_unstable_* methods?

changelog: [`unnecessary-sort-by`]: sort method consistency in message
and suggestion
2025-08-05 12:50:25 +00:00
Huterenok 6249f33ca1 fix: unnecessary_sort_by lint method consistency in message and suggestion 2025-08-05 15:23:10 +03:00
Philipp Krones 4d1962c282 Move cognitive_complexity lint from nursery to restriction (#15415)
changelog: [`cognitive_complexity`]: move the lint from `nursery` to the
`restriction`

r? @flip1995
2025-08-05 12:20:27 +00:00
Samuel Tardieu cdee4f8e1d Move cognitive_complexity lint from nursery to restriction 2025-08-05 13:52:58 +02:00
Samuel Tardieu b98252f6ca Generate lint count in template (#15414)
Removes the pop-in of the element on page load

changelog: none
2025-08-05 11:49:09 +00:00
Alex Macleod 0ea413fe6b Generate lint count in template 2025-08-05 11:40:05 +00:00