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

Suggest if let x = y when encountering if x = y #75931

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

estebank
Copy link
Contributor

Detect potential cases where if let was meant but let was left out.

Fix #44990.

@estebank
Copy link
Contributor Author

r? @petrochenkov

@petrochenkov petrochenkov added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 26, 2020
src/librustc_resolve/late.rs Outdated Show resolved Hide resolved
@jyn514 jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. labels Aug 28, 2020
@bors

This comment has been minimized.

compiler/rustc_resolve/src/late.rs Outdated Show resolved Hide resolved
compiler/rustc_session/src/session.rs Show resolved Hide resolved
compiler/rustc_session/src/session.rs Outdated Show resolved Hide resolved
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 30, 2020
Detect potential cases where `if let` was meant but `let` was left out.

Fix rust-lang#44990.
@estebank estebank added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 31, 2020
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 31, 2020

📌 Commit 07112ca has been approved by petrochenkov

@bors 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 Aug 31, 2020
@bors
Copy link
Contributor

bors commented Sep 1, 2020

⌛ Testing commit 07112ca with merge d824b23...

@bors
Copy link
Contributor

bors commented Sep 1, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: petrochenkov
Pushing d824b23 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 1, 2020
@bors bors merged commit d824b23 into rust-lang:master Sep 1, 2020
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 3, 2022
Suggest while let x = y when encountering while x = y

Extends rust-lang#75931 to also detect where the `let` might be missing from `while let` expressions.
@estebank estebank deleted the suggest-if-let branch November 9, 2023 05:16
@cuviper cuviper added this to the 1.48.0 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggest if let when a failed if block could be parsed as one
6 participants