Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for lazily initialized statics #14260

Closed
SimonSapin opened this issue May 17, 2014 · 1 comment
Closed

Add support for lazily initialized statics #14260

SimonSapin opened this issue May 17, 2014 · 1 comment

Comments

@SimonSapin
Copy link
Contributor

@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.)

@SimonSapin
Copy link
Contributor Author

This is now a stand-alone library that is very easy to use with Cargo: https://github.com/Kimundi/lazy-static.rs

lnicola pushed a commit to lnicola/rust that referenced this issue Mar 13, 2023
fix: Adjust `replace_match_with_if_let` applicability range

It currently trigger in the entirety of match which is less than ideal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants