Skip to content

Suggest if let when a failed if block could be parsed as one #44990

Closed
@estebank

Description

@estebank

When writing if Some(x) = foo {}, attempt to parse as if let Some(x) = foo {} for better diagnostic output and if successful provide a suggestion to add the let.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.F-let_chains`#![feature(let_chains)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions