Skip to content

FP invalid left-hand side of assignment function and enclosed var in closure same name #22988

Description

@matthiaskrgr

this only repros when the fn and the var which is then used in the closure have the same name

fn i() {
    let mut i = 0;
    (|| i += 1 )();
}
fn main() {}

^ this compiled but not for ra diagnostics:

at crate ra, file /tmp/ra/src/main.rs: Error RustcHardError("E0067") from LineCol { line: 2, col: 8 } to LineCol { line: 2, col: 9 }: invalid left-hand side of assignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions