Skip to content

Clippy subtree update #145056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 116 commits into
base: master
Choose a base branch
from
Open

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Aug 7, 2025

r? @Manishearth

Cargo.lock update due to clippy version bump

smoelius and others added 30 commits May 19, 2025 19:29
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.
Co-authored-by: Philipp Krones <hello@philkrones.com>
changelog: [`ip_constant`]: fix suggestion when call is inside
parentheses like `(Ipv4Addr::new(127, 0, 0, 1))`

Very similar to the fix in
rust-lang/rust-clippy#15191
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Fix `duplicated_attributes` lint to detect prefixed attributes like
`clippy::lint_name`.
Fixes rust-lang/rust-clippy#14942

changelog: [`duplicated_attributes`]: detect duplicated prefixed
attributes
…lang#15355)

Closes rust-lang/rust-clippy#15349

changelog: [`empty_structs_with_brackets`] fix wrong suggestions on
generics
rust-lang#15345)

…rom a macro

changelog: [`unnecessary_map_or`]: don't add parens if the parent expr
comes from a macro

fixes rust-lang/rust-clippy#14714
)

Closes rust-lang/rust-clippy#15061

changelog: [`let_unit_value`] fix wrong suggestions for format macros
blyxyas and others added 18 commits August 5, 2025 22:32
Fixes rust-lang/rust-clippy#15412

changelog: [`wildcard_imports`]: do not lint code coming from an
external macro
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
…e inner `if` is enclosed in parentheses (rust-lang#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 rust-lang/rust-clippy#15303

I'm sure this is a bit dirty, but don't currently see a better way.
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.
Follow-up of rust-lang/rust-clippy#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
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
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.
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
Small typo I found while looking at recent lint requests/issues.

changelog: none
r? @ghost

changelog: none
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. labels Aug 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 7, 2025

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot

This comment was marked as off-topic.

@Manishearth
Copy link
Member

@bors r+ p=1 rollup=never

thanks!

@bors
Copy link
Collaborator

bors commented Aug 7, 2025

📌 Commit 770e6f1 has been approved by Manishearth

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2025
@bors
Copy link
Collaborator

bors commented Aug 7, 2025

⌛ Testing commit 770e6f1 with merge 2fd855f...

bors added a commit that referenced this pull request Aug 7, 2025
Clippy subtree update

r? `@Manishearth`

Cargo.lock update due to clippy version bump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.