Skip to content
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

fix: allow more kinds of if let patterns in guarded return assist #15698

Merged

Conversation

rmehri01
Copy link
Contributor

@rmehri01 rmehri01 commented Oct 1, 2023

Removes the checks that require the pattern to be a tuple struct with exactly 1 field that is unqualified and has an identifier pattern in it. I'm not sure if there should be more checks in place but they seem unnecessary now?

Closes #15695

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 1, 2023
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are indeed unnecessary now that we are emitting let ... else ... here, good catch

@Veykril
Copy link
Member

Veykril commented Oct 2, 2023

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Oct 2, 2023

📌 Commit 146a7cc has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Oct 2, 2023

⌛ Testing commit 146a7cc with merge 4c9d2c7...

@bors
Copy link
Collaborator

bors commented Oct 2, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 4c9d2c7 to master...

@bors bors merged commit 4c9d2c7 into rust-lang:master Oct 2, 2023
10 checks passed
@rmehri01 rmehri01 deleted the 15695_make_guarded_return_more_lenient branch October 2, 2023 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert to guarded return does not work with many kinds of if let
4 participants