-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
flip1995
wants to merge
116
commits into
rust-lang:master
Choose a base branch
from
flip1995:clippy-subtree-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Clippy subtree update #145056
+2,807
−1,031
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: none
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
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
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment was marked as off-topic.
This comment was marked as off-topic.
@bors r+ p=1 rollup=never thanks! |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
r? @Manishearth
Cargo.lock update due to clippy version bump