-
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
Clippy subtree update #139983
Conversation
changelog: none
… deprecated configurations (rust-lang#14280) This PR does two things: - It renames `inconsistent_struct_constructor`'s configuration from `lint-inconsistent-struct-field-initializers` to `check-inconsistent-struct-field-initializers`. (I should have suggested `check-...` in [rust-lang#13737](rust-lang/rust-clippy#13737 (comment)).) - It causes Clippy to no longer suggest deprecated configurations. (Previously, Clippy would suggest `cyclomatic-complexity-threshold`, for example.) r? @y21 changelog: Rename `lint-inconsistent-struct-field-initializers` to `check-inconsistent-struct-field-initializers` changelog: No longer suggest deprecated configurations
Fix rust-lang#14465 changelog: none
…ension_comparions`
This lint was downgraded to `pedantic` in part because rust-analyzer was not fully supporting it at the time per rust-lang#10087. The support has been added over [a year ago](rust-lang/rust-analyzer#11260), so seems like this should be back to style. Another source of the initial frustration was fixed since then as well - this lint does not trigger by default in case only some arguments can be inlined.
This lint was downgraded to `pedantic` in part because rust-analyzer was not fully supporting it at the time per rust-lang#10087. The support has been added over [a year ago](rust-lang/rust-analyzer#11260), so seems like this should be back to style. Another source of the initial frustration was fixed since then as well - this lint does not trigger by default in case only some arguments can be inlined.
…ension_comparions` (rust-lang#14358) close rust-lang#14357 changelog: [`case_sensitive_file_extension_comparisons`]: suggest `is_some_and` to suppress other lint warnings
"paren" is used throughout the Clippy codebase as an abbreviation for "parentheses". changelog: none
The `uninlined_format_args` was temporarily downgraded to `pedantic` in part because rust-analyzer was not fully supporting it at the time, per rust-lang#10087. The support has been added over [a year ago](rust-lang/rust-analyzer#11260), so seems like this should be back to style. Another source of the initial frustration was fixed since then as well - this lint does not trigger by default in case only some arguments can be inlined. changelog: [`uninlined_format_args`]: move back to `style`
Both lints share a lot of characteristics but were implemented in unrelated ways. This unifies them, saving around 100 SLOC in the process, and making one more test trigger the lint. Also, this removes useless blocks in suggestions.
…ng#14332) Both lints share a lot of characteristics but were implemented in unrelated ways. This unifies them, saving around 100 SLOC in the process, and making one more test trigger the lint. Also, this removes useless blocks in suggestions. Close rust-lang#12956 changelog: none
This lint does more harm than good: in its description, it proposes to rewrite `match` on `Vec<_>` indexes or slices by a version which cannot panic but masks the failure by choosing the default variant. The `clippy::indexing_slicing` restriction lint covers those cases more safely, by suggesting to use a non-panicking version to retrieve the value from the container, without suggesting to fallback to the default success variant in case of failure.
This PR enables the new ability to collapse `if` statements containing comments (without losing them) in Clippy sources, excluding tests and lintcheck, where the default behaviour (no collapsing in presence of comments) is preserved. To be applied after rust-lang#14231. When it is applied, rust-lang#14455 will be marked as ready for review, then rust-lang#14228 afterwards. changelog: none r? ghost
…licit cast (rust-lang#14389) Closes rust-lang#11059 changelog: `option_if_let_else`: fix wrong suggestion when coersion requires explicit cast
Signed-off-by: todaymoon <[email protected]>
*Please write a short comment explaining your change (or "none" for internal only changes)* remove redundant words in comment changelog: none
This extra condition prevents a problem when removing the '}' in: ```rust ( // There was an opening bracket after the parenthesis, which has been removed // This is a comment }) ``` Removing the whitespaces, including the linefeed, before the '}', would put the closing parenthesis at the end of the `// This is a comment` line, which would make it part of the comment as well. In this case, it is best to keep the span on the '}' alone.
…ust-lang#14480) This extra condition prevents a problem when removing the '}' in: ```rust ( // There was an opening bracket after the parenthesis, which has been removed // This is a comment }) ``` Removing the whitespaces, including the linefeed, before the '}', would put the closing parenthesis at the end of the `// This is a comment` line, which would make it part of the comment as well. In this case, it is best to keep the span on the '}' alone. changelog: none Note to reviewer: `manual_inspect` and `collapsible_if` were two lints exhibiting this problem in cooked up test cases, which have been included as non-regression tests.
Dereferencing string literals in suggestions is redundant. changelog: [`cmp_owned`]: more natural suggestions are provided for string literals now fixes rust-lang#8103
It looks like `ok_expect` already [checks](https://github.com/rust-lang/rust-clippy/blob/b27a2bbe26b5d4499ca71091e955e7bc7b8b1a4a/clippy_lints/src/methods/ok_expect.rs#L16) for the presence of the `Debug`. changelog: none
When lowering a destructuring assignment from AST to HIR, the compiler will reuse the same identifier name (namely `sym::lhs`) for all the fields. The desugaring must be checked for to avoid a false positive of the `shadow_unrelated` lint.
…4381) When lowering a destructuring assignment from AST to HIR, the compiler will reuse the same identifier name (namely `sym::lhs`) for all the fields. The desugaring must be checked for to avoid a false positive of the `shadow_unrelated` lint. Fix rust-lang#10279 Fix rust-lang#14377 changelog: [`shadow_unrelated`]: prevent false positive in destructuring assignments
…nishearth Clippy subtree update 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.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
Please let this be the last issue 😅 |
@bors r+ |
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 553600e (parent) -> df35ff6 (this PR) Test differencesNo test diffs found Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard df35ff6c354f1f1fbf430b84e7dea37dfe997f34 --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
Finished benchmarking commit (df35ff6): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -1.4%, secondary 1.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 0.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 775.751s -> 775.888s (0.02%) |
The perf improvements greatly outweigh the few regressions. @rustbot label: +perf-regression-triaged |
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.