Skip to content

Stabilizing statically intialized UnsafeCell? #25634

Closed
@aldanor

Description

@aldanor

Seeing as the cell types have been somewhat recently stabilized, is static cell initialization supposed to be stabilized too at some point?

pub const FOO: Foo = Foo {
    counter: UnsafeCell { value: 0 },
};

currently triggers "error: use of unstable library feature 'core'" lint, however there's really no other way to work around this as far as I know.

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