Skip to content

Lower the restrictions on if let #2186

Closed
@ghost

Description

Sometimes, a construct like the following one is used.

let a = {
    let b = ...;
    // ...
};

I think it would look prettier with if let (it's also idiomatic in many lisps)

let a = if let b = ... {
    // ...
};

But rust can likely fail with either https://doc.rust-lang.org/error-index.html#E0317 or https://doc.rust-lang.org/error-index.html#E0162 if in the place of ... we have a known value

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions