Skip to content

Unboxed closures can mutate captures of immutable variables #18335

@bkoropoff

Description

@bkoropoff

Example that shouldn't compile:

#![feature(unboxed_closures)]

fn main() {
    let x = 0u;
    move |&mut:| x = 1;
}

Note that this currently ICEs due to #18238, but it's still a problem once that is fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions