Skip to content

no warning for implicit copies into closures #2499

Closed
@nikomatsakis

Description

@nikomatsakis

In this program:

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

    let y = [x];
    let z = y[0];

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

I get a warning for let y = [x] and a warning for let z = y[0], but no warning for the copy of x into the fn@

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions