Fix clippy::collapsible_match with let expressions#88163
Fix clippy::collapsible_match with let expressions#88163bors merged 1 commit intorust-lang:masterfrom
Conversation
|
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
|
(rust-highfive has picked a reviewer for you, use r? to override) |
|
r? @Manishearth |
|
Sure, I can take a look. 👍 |
There was a problem hiding this comment.
Only a small NIT when it comes to the lint message. I would be okay with merging this and fixing it after the sync if you want this to land ASAP. However, I would prefer to get this fixed before the sync (Also because I'm not sure if we'll have a sync before next week).
I needed some time to get used to the new syntax and structure with the let expression, and now I like it. Great work!
Another sidenote: The commit is not linked to your GH account (The email probably isn't set). This is not a dealbreaker, just FYI in case that is not intended 🙃
03114cc to
de608cf
Compare
xFrednet
left a comment
There was a problem hiding this comment.
LGTM
Just one last question
There was a problem hiding this comment.
Rust allows unused-lints in normal compiler UI tests. Are they now also disabled in Clippy's UI tests? (When running them locally via cargo test or inside the Clippy CI)
There was a problem hiding this comment.
Well, looks like @rust-log-analyzer answered the question for us ^^. We could add something like that in the future to Clippy as well ^^
There was a problem hiding this comment.
Rust allows
unused-lints in normal compiler UI tests.
Didn't know that. Sounds good for Clippy.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
should be in utils IMO, but we can do that refactor once this is synced back
|
@bors delegate=camsteffen |
|
✌️ @camsteffen can now approve this pull request |
|
r=me when tests pass |
de608cf to
ada9282
Compare
|
@bors r=Manishearth |
|
📌 Commit ada9282 has been approved by |
…=Manishearth Fix clippy::collapsible_match with let expressions This fixes rust-lang/rust-clippy#7575 which is a regression from rust-lang#80357. I am fixing the bug here instead of in the clippy repo (if that's okay) because a) the regression has not been synced yet and b) I would like to land the fix on nightly asap. The fix is basically to re-generalize `match` and `if let` for the lint implementation (they were split because `if let` no longer desugars to `match` in the HIR). Also fixes rust-lang/rust-clippy#7586 cc `@rust-lang/clippy` `@xFrednet` do you want to review this?
|
☀️ Test successful - checks-actions |
…anishearth Fix clippy::collapsible_match with let expressions This fixes rust-lang/rust-clippy#7575 which is a regression from rust-lang#80357. I am fixing the bug here instead of in the clippy repo (if that's okay) because a) the regression has not been synced yet and b) I would like to land the fix on nightly asap. The fix is basically to re-generalize `match` and `if let` for the lint implementation (they were split because `if let` no longer desugars to `match` in the HIR). Also fixes rust-lang/rust-clippy#7586 and fixes rust-lang/rust-clippy#7591 cc `@rust-lang/clippy` `@xFrednet` do you want to review this?
…earth Add expansion to while desugar spans In the same vein as rust-lang#88163, this reverts a change in Clippy behavior as a result of rust-lang#80357 (and reverts some `#[allow]`s): This changes `clippy::blocks_in_if_conditions` to not fire on `while` loops. Though we might actually want Clippy to lint those cases, we should introduce the change purposefully, with tests, and possibly under a different lint name. The actual change here is to add a desugaring expansion to the spans when lowering a `while` loop. r? `@Manishearth`
…earth Add expansion to while desugar spans In the same vein as rust-lang#88163, this reverts a change in Clippy behavior as a result of rust-lang#80357 (and reverts some `#[allow]`s): This changes `clippy::blocks_in_if_conditions` to not fire on `while` loops. Though we might actually want Clippy to lint those cases, we should introduce the change purposefully, with tests, and possibly under a different lint name. The actual change here is to add a desugaring expansion to the spans when lowering a `while` loop. r? `@Manishearth`
This fixes rust-lang/rust-clippy#7575 which is a regression from #80357. I am fixing the bug here instead of in the clippy repo (if that's okay) because a) the regression has not been synced yet and b) I would like to land the fix on nightly asap.
The fix is basically to re-generalize
matchandif letfor the lint implementation (they were split becauseif letno longer desugars tomatchin the HIR).Also fixes rust-lang/rust-clippy#7586 and fixes rust-lang/rust-clippy#7591
cc @rust-lang/clippy
@xFrednet do you want to review this?