DON'T MERGE[ci skip]: demonstrate if_let_rescope auto migration#4192
Closed
rami3l wants to merge 2 commits intorust-lang:masterfrom
Closed
DON'T MERGE[ci skip]: demonstrate if_let_rescope auto migration#4192rami3l wants to merge 2 commits intorust-lang:masterfrom
if_let_rescope auto migration#4192rami3l wants to merge 2 commits intorust-lang:masterfrom
Conversation
Following <https://users.rust-lang.org/t/rust-2024-compatibility-lint-and-the-if-let-temporary-scope/125969/5>, I have manually audited all `if_let_rescope` cases and found out that certain existing cases can be rewritten to make it clearer semantically. So these migrations have been made in advance so that the only cases of `if-let` remaining are false positives of this lint. The crux of determining false positives here is that, according to <rust-lang/rust#133167>, `if let Some()` and other similar cases where the `else` drop is not significant are not affected by the Edition change.
1 task
85c63ce to
d84e07a
Compare
d84e07a to
41f0298
Compare
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.
Complements #4191 to show the
if-letmigrations that I didn't do.For the sake of simplicity, the first commit of #4191 has also been cherry-picked into this branch. After that, a
cargo clippy --fixis performed after adjusting theCargo.tomlto activate theif_let_rescopelint.Notably, according to rust-lang/rust#133167 (comment),
if let Some()and other similar cases where theelsedrop is not significant are not affected by the Edition change.Please feel free to point out if I have missed a significant drop somewhere in #4191.
You can get a clearer version of the PR diff via semanticdiff.