Skip to content

Compiler error for if/let chaining when not using it inside a map closure syntax error #116608

Closed
@tlockhart1996

Description

@tlockhart1996

Code

fn main() {
    vec![].into_iter().map({ |x| 
        let y = x;
        y
    })
}

Current output

error[E0658]: `let` expressions in this position are unstable

Desired output

Something related to 
`map({ |x|` is a syntax error and should be `map(|x| {`

Rationale and extra context

N/A

Other cases

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler 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