Skip to content

Properly warn when implicitly copying into closures #2506

@msullivan

Description

@msullivan

This code doesn't produce any warnings, but it should:

fn main() {
    let x = {mut f: 3};

    let f = fn@() {
        x.f = 4;
    };
    f();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions