Skip to content

Add support for lazily initialized statics #14260

@SimonSapin

Description

@SimonSapin

@Kimundi published a macro for "lazily initialized statics":

https://gist.github.com/Kimundi/8782487
http://www.reddit.com/r/rust/comments/1wvxcn/lazily_initialized_statics/

Besides the "lazy" aspect, it is useful to have statics (globals) whose value is not a "constant expression". The latest revision only compiles with Share types, which I believe makes it memory-safe.

I’d like this to be added to libstd or libsync. (It depends on sync::one::Once.)

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