Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
estebank:suggest-if-let
Sep 1, 2020
Merged

Suggest if let x = y when encountering if x = y#75931
bors merged 1 commit into
rust-lang:masterfrom
estebank:suggest-if-let

Conversation

@estebank

Copy link
Copy Markdown
Contributor

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

Fix#44990.

@estebank

Copy link
Copy Markdown
ContributorAuthor

r? @petrochenkov

@petrochenkovpetrochenkov added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 26, 2020
Comment threadsrc/librustc_resolve/late.rs Outdated
Comment threadsrc/librustc_resolve/late.rs Outdated
@jyn514jyn514 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.

Comment threadcompiler/rustc_resolve/src/late.rs Outdated
Comment threadcompiler/rustc_session/src/session.rs Outdated
Comment threadcompiler/rustc_session/src/session.rs Outdated
@petrochenkovpetrochenkov 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.
Fixrust-lang#44990.
@estebankestebank 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
Copy Markdown
Contributor

@bors r+

@bors

bors commented Aug 31, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 07112ca has been approved by petrochenkov

@borsbors 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

bors commented Sep 1, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 07112ca with merge d824b23...

@bors

bors commented Sep 1, 2020

Copy link
Copy Markdown
Collaborator

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

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Sep 1, 2020
@bors
bors merged commit d824b23 into rust-lang:masterSep 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
@cuvipercuviper added this to the 1.48.0 milestone Nov 17, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: 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

@estebank@bors@petrochenkov@jyn514@lcnr@cuviper