Skip to content

Bindings does not simplify programming #45427

Closed
@3442853561

Description

@3442853561
fn main() {
    let foo = "1 + (2 + 3)";
    for ch in foo.chars() {
        match ch {
            e @ '(' | e @ '[' | e @ '{' => match e {
                '(' => {}
                '[' => {}
                '{' => {}
                // As we all know, there is missing a _
                // However I think the compiler should be smarter
                // Because there is a binding
            },
            _ => {}
        }
    }
}

As we all know, there is missing a _
However I think the compiler should be smarter
Because there is a binding here
There may be code that will never be executed

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions