Open
Conversation
After performance concers on the `nonminimal_bool` lint, we performed a crater run (rust-lang/rust issue number 153883). This crater run revealed that in 19120 suggestions taken from 1.3 million crates, only about 36% had resulted in multi-terminal suggestions (suggestions that were not only a single boolean). This suggests that most cases of this lint firing, the expression that triggered was pretty simple. And thus, we should not take such a huge toll for a lint that isn't that useful. changelog:[`nonminimal_bool`]: Move to `pedantic`. changelog:[`overly_complex_bool_expr`]: Move to `pedantic`.
In some cases, removing a cast that looks unnecessary can still change type inference, even when the cast is to the expected same type. The lint now handles casts that flow through intermediate expressions (e.g. calls, blocks, let bindings, loops...). It also treats placeholder generics (e.g. `::<_>`) as inference sensitive. Added regression tests with similar behavior as the original bug, some edge cases and tests to check if false negative cases weren't created. Closes rust-lang#16449
also removes E0452 and splits `tests/rustdoc-ui/lints/renamed-lint-still-applies` into 2 tests this is because of delayed warn lint being lost on compiler aborting on error
Updates cargo_metadata to 0.23 and fixes all the resultant issues. changelog: none
Closes rust-lang/rust-clippy#16751 changelog: [`question_mark`] fix FN for manual unwrap with `if let` or `match` changelog: [`question_mark`] fix FN when the match scrutinee is behind reference changelog: [`question_mark`] fix FN when match binding is behind `ref` or `mut`
…iser Start using pattern types in libcore cc rust-lang#135996 Replaces the innards of `NonNull` with `*const T is !null`. This does affect LLVM's optimizations, as now reading the field preserves the metadata that the field is not null, and transmuting to another type (e.g. just a raw pointer), will also preserve that information for optimizations. This can cause LLVM opts to do more work, but it's not guaranteed to produce better machine code. Once we also remove all uses of rustc_layout_scalar_range_start from rustc itself, we can remove the support for that attribute entirely and handle all such needs via pattern types
…nszelmann Post-attribute ports cleanup pt. 1 (again) This is a re-implementation of most (but not all) of rust-lang#154808 The code is the same as in that PR, other than a few changes, I'll leave comments where I changed things. I did re-implement most of the commits rather than cherry-picking, so it's probably good to check the entire diff regardless r? @jdonszelmann
Fixes rust-lang/rust-clippy#16849 changelog: [`manual_noop_waker`]: Add MSRV check
…16752) Closes rust-lang/rust-clippy#16747 changelog: [`expect_fun_call`] fix wrong suggestions for string slicing
Closes rust-lang/rust-clippy#16759 changelog: [`byte_char_slices`] enhance to cover arrays
… < to avoid parse error (rust-lang#16848) Fix int_plus_one suggestion causing parse error when LHS is an `AssocOp::Cast` When int_plus_one rewrites an expression like `x as usize + 1 <= y`, it suggests `x as usize < y`. This doesn't compile because the parser interprets `usize<y>` as the start of generic arguments rather than a lt comparison. The fix parenthesizes the LHS if it's an `AssocOp::Cast` and the replacement operator is `<`: `(x as usize) < y`. --- changelog: [int_plus_one]: Parenthesize `AssocOp::Cast` in suggestion when replacement operator is < to avoid parse error
Violets are red, Roses are blue, This month brings rain, and sunshine peeks through. ---- Alexa from @bestman8 <img width="1080" height="1616" alt="image" src="https://github.com/user-attachments/assets/eb86a6d2-427c-441c-ad03-1c0ace63128d" /> <br/> <br/> and <br/> <br/> Ichigo from @oupson <img width="1637" height="2214" alt="image" src="https://github.com/user-attachments/assets/c8610a1b-6bce-453d-aefb-0c906ca6940c" /> are the winners at rust-lang/rust-clippy#16653 P.S. Since there was no voting, picked the one with more hearts ---- Cats for the next release can be nominated in the comments🙏 changelog: none r? flip1995
changelog: [`let_and_return_on`]: do not trigger on `let else` construct Fixes rust-lang/rust-clippy#16820
r? @ghost changelog: none
This comment has been minimized.
This comment has been minimized.
Collaborator
|
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. |
Collaborator
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.lockupdate due to Clippy version bump and cargo_metadata dep bump in Clippy.