-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Clippy subtree update #139983
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
base: master
Are you sure you want to change the base?
Clippy subtree update #139983
Conversation
Fix missing comment annotations in the clippy book changelog: none
Replace the use of `Sugg::ast()` which prevented combining `if` together when they contained comments by span manipulation. A new configuration option `lint_commented_code`, which is `true` by default, opts out from this behavior.
…4438) rust-lang#2597 appears to be already resolved, so the applicability of `op_ref` can be set to `MachineApplicable`. close rust-lang#2597 changelog: [`op_ref`]: set the applicability to `MachineApplicable`
Fixes rust-lang/rust-clippy#14281 changelog: none
Related to rust-lang#14265 which was fixed automatically by the latest rustup. changelog: none *Edit: description, changelog, keep only tests*
Closes rust-lang#13066 (tests that are ignored with no reason message). changelog: Add `ignore_without_reason` lint
In rust-lang#14116 we added a benchmarking option for Lintcheck, this commit adds a new chapter to the book AND improves that option into a more usable state. It's recommended to review one commit at a time. - **Document how to benchmark with lintcheck --perf** - **Several improvements on lintcheck perf (desc.)** - Now lintcheck perf deletes target directory after benchmarking, benchmarking with a cache isn't very useful or telling of any precise outcome. - Support for benchmarking several times without having to do a cargo clean. - Compress perf.data changelog: none
Replace the use of `Sugg::ast()` which prevented combining `if` together when they contained comments by span manipulation. A new configuration option `lint_commented_code`, which is `true` by default, allows opting out from this behavior. If reviewed on GitHub, the second commit of this PR is best looked at side by side, with whitespace differences turned off. changelog: [`collapsible_if`]: lint more cases
…#14424) Closes rust-lang#14404 changelog: [`nonminimal_bool`]: fix macro definition wrongly showed in suggestions.
In the current GitHub Actions CI/CD setup, the `deploy` job is not triggered when a PR is enqueued in the merge queue but only when it is merged. Since concurrency is not configured for this job, deployments may fail for later PRs if multiple PRs are merged in quick succession. (e.g. the deployment for [this commit](rust-lang/rust-clippy@c418714) was successful, but the deployment for [this commit](rust-lang/rust-clippy@0a141ab) that was pushed to `main` immediately afterward failed. (edit: the latter deployment seems to be rerun)) changelog: none r? flip1995
Clarify example for unconditional_recursion changelog: none
"paren" is used throughout the Clippy codebase as an abbreviation for "parentheses".
`warn_on_all_wildcard_imports` should warn on all wildcard imports, including the reexported ones.
`warn_on_all_wildcard_imports` should warn on all wildcard imports, including the reexported ones. Fix rust-lang#13660 changelog: [`warn_on_all_wildcard_imports`]: when asked to warn on all wildcard imports, include the reexported ones
changelog: none r? ghost
Instead of looking for angle brackets in the source code, use the HIR and Ty interfaces to either copy the original type, or complete it with `_` placeholders if all type and const generic arguments are inferred. Fixes rust-lang/rust-clippy#14581 changelog: [`from_iter_instead_of_collect`]: show correct type in suggestion
- Do not replace macro results in then/else branches - Extract condition snippet from the right context - Make suggestion `MaybeIncorrect` if it would lead to losing comments changelog: [`bool_to_int_with_if`]: properly handle macros Fixes rust-lang/rust-clippy#14628
This will let people [add summary notes](https://forge.rust-lang.org/triagebot/note.html) to an issue, for example to add that an issue is best kept for first-timers. changelog: none I wanted to use it in rust-lang/rust-clippy#14617 (comment).
Limit the recursion depth, as each level of nesting adds another deeper projection.
) Limit the recursion depth, as each level of nesting adds another deeper projection. There might be a more complex way of handling the problem, but infinite recursions are bad, and don't allow Clippy to terminate properly. changelog: [`significant_drop_tightening`]: do not recurse forever when checking for attribute on type or its constituent Fixes rust-lang/rust-clippy#13544 @rustbot label +L-nursery
This lint detects inefficient or useless `{std,core}::mem::swap()` calls such as: ```rust // Should be `a = temp();` swap(&mut a, &mut temp()); // Should be `*b = temp();` swap(b, &mut temp()); // Should be `temp1(); temp2();` if we want to keep the side effects swap(&mut temp1(), &mut temp2()); ``` It also takes care of using a form appropriate for a `()` context if `swap()` is part of a larger expression (don't ask me why this wouldn't happen, I have no idea), by suggesting `{ x = y; }` (statement in block) or `{std,core}::mem::drop((temp1(), temp2())`. changelog: [`swap_with_temporary`]: new lint Close rust-lang#1968
rust-lang#14644) Closes rust-lang/rust-clippy#14578 changelog: [`unnecessary_lazy_evaluations`] fix wrong suggestions for async closure
…lang#14635) changelog: [`match_single_binding`]: allow macros in scrutinee and patterns Fixes rust-lang/rust-clippy#14634
The `BodyLifetimeChecker` which checks for the use of any non-anonymous non-static lifetime did not recurse into closures, missing lifetime uses. This would lead to a bogus elision suggestion. The `BodyLifetimeChecker` is not refined enough to avoid false positives, as any conforming lifetime, including one coming from the outer context, would be considered a hit. The number of false positives might increase now that we check closures as well, in case those closures define and use lifetimes themselves. changelog: [`needless_lifetimes`]: do not suggest removing a lifetime which is later used in a closure Fixes rust-lang/rust-clippy#14607
r? @ghost changelog: none
Some changes occurred in src/tools/clippy cc @rust-lang/clippy These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
@bors r+ p=2 rollup=never |
The job Click to see the possible cause of the failure (guessed by this bot)
|
Tidy issues @bors r-
Maybe need to rebless with |
☔ The latest upstream changes (presumably #139996) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @Manishearth
Cargo.lock update due to the Clippy version bump and because Clippy moved from rinja (unmaintained) to askama.
Last sync was skipped due to the askama issue and me not getting to fixing this in time.