Use let...else instead of match foo { ... _ => return }; and if let ... else return by estebank · Pull Request #148837 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation32 Commits3 Checks11 Files changed
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
Some changes occurred in compiler/rustc_codegen_cranelift
cc @bjorn3
Some changes occurred in compiler/rustc_codegen_ssa
HIR ty lowering was modified
cc @fmease
Some changes occurred in compiler/rustc_codegen_gcc
Some changes occurred to MIR optimizations
cc @rust-lang/wg-mir-opt
rustbot added A-attributes
Area: Attributes (`#[…]`, `#![…]`)
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
Operating system: Windows
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
Relevant to the library team, which will review and decide on the PR/issue.
The Rustc Trait System Refactor Initiative (-Znext-solver)
labels
r? @wesleywiser
rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
This comment has been minimized.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe skip this for now to avoid conflicts with #148481?
do we have a style check for this?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking time on this, looks good on compiler side, would this reasonable to split compiler and library parts? I'm not sure if I privileged enough to review the library part
There is some places that looks better with the if let guard feature to remove nesting
View changes since this review
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| // tidy-alphabetical-start |
| #![cfg_attr(bootstrap, feature(array_windows))] |
| #![deny(clippy::manual_let_else)] |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not add this lint anywhere yet, I think CI will never stop complain about it :D
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding them instructive :)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, so feel free to «r=me» once CI passed
Zalathar added a commit to Zalathar/rust that referenced this pull request
…bilee
Use let...else instead of match foo { ... _ => return }; and if let ... else return in std
Split off rust-lang#148837.
Zalathar added a commit to Zalathar/rust that referenced this pull request
…bilee
Use let...else instead of match foo { ... _ => return }; and if let ... else return in std
Split off rust-lang#148837.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…bilee
Use let...else instead of match foo { ... _ => return }; and if let ... else return in std
Split off rust-lang#148837.
rust-timer added a commit that referenced this pull request
Rollup merge of #149795 - estebank:let-else-std, r=workingjubilee
Use let...else instead of match foo { ... _ => return }; and if let ... else return in std
Split off #148837.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request
Use let...else instead of match foo { ... _ => return }; and if let ... else return in std
Split off rust-lang/rust#148837.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.
Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.
📌 Commit 97c7742 has been approved by Kivooeo
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
jhpratt added a commit to jhpratt/rust that referenced this pull request
Use let...else instead of match foo { ... _ => return }; and if let ... else return
bors added a commit that referenced this pull request
Rollup of 11 pull requests
Successful merges:
- #145278 (Update
rustc_codegen_gccrotate operation document) - #148825 (Add SystemTime::{MIN, MAX})
- #148837 (Use
let...elseinstead ofmatch foo { ... _ => return };andif let ... else return) - #149177 (Add proper suggestion for associated function with unknown field)
- #149843 (Inherit attributes in delegation)
- #149860 (Fix: Prevent macro-expanded extern crates from shadowing extern arguments)
- #149874 (Weak for Arc pointer is marked as DynSend/DynSync)
- #149903 (Remove unused code in
cfg_old) - #149911 (bootstrap: Don't pass an unused
--colorto compiletest) - #149916 (Add a sanity check in case of any duplicate nodes)
- #149924 (
declare_lint_passforINLINE_ALWAYS_MISMATCHING_TARGET_FEATURES)
r? @ghost
@rustbot modify labels: rollup
bors added a commit that referenced this pull request
Rollup of 10 pull requests
Successful merges:
- #145278 (Update
rustc_codegen_gccrotate operation document) - #148837 (Use
let...elseinstead ofmatch foo { ... _ => return };andif let ... else return) - #149177 (Add proper suggestion for associated function with unknown field)
- #149843 (Inherit attributes in delegation)
- #149860 (Fix: Prevent macro-expanded extern crates from shadowing extern arguments)
- #149874 (Weak for Arc pointer is marked as DynSend/DynSync)
- #149903 (Remove unused code in
cfg_old) - #149911 (bootstrap: Don't pass an unused
--colorto compiletest) - #149916 (Add a sanity check in case of any duplicate nodes)
- #149924 (
declare_lint_passforINLINE_ALWAYS_MISMATCHING_TARGET_FEATURES)
r? @ghost
@rustbot modify labels: rollup
rust-timer added a commit that referenced this pull request
Rollup merge of #148837 - estebank:let-else, r=Kivooeo
Use let...else instead of match foo { ... _ => return }; and if let ... else return
Labels
Area: Attributes (`#[…]`, `#![…]`)
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
Operating system: Windows
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.
Relevant to the library team, which will review and decide on the PR/issue.
The Rustc Trait System Refactor Initiative (-Znext-solver)