Skip to content

&mut T during the evaluation of a const/static initializer #16

@oli-obk

Description

@oli-obk

While is very important to not have static or const items of such types, during the evaluation of a static or const item we might want to work with intermediate values of this type.

E.g.

const FOO: usize = {
    let mut x = [5, 6, 7];
    x.swap(0, 1);
    x[0] // should be `6`
};

seems totally reasonable.

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