rust-lang-nursery / lazy-static.rs

A small macro for defining lazy evaluated static variables in Rust.
Apache License 2.0
1.92k stars 111 forks source link

Switch lazy_static over to mutable statics instead of UnsafeCell on nightly #55

Closed Kimundi closed 6 years ago

Kimundi commented 7 years ago

https://github.com/rust-lang/rfcs/pull/1440 got merged, so we can now get rid of the UnsafeCell in favor of directly having a drop type in a mutable static.

However, since the current UnsafeCell impl got also legitimized by the RFC, the current plan is to not merge this PR until either the drop_types_in_const feature gets stabilized, or is at least old enough to not require the most current version of the compiler.

Kimundi commented 6 years ago

Alright, I'm giving this another spin. If anyone has any comments to this PR feel free to post them. :)

This also addresses @joshlf's concern in #84 about the spin dependency, and cleans up a few of the obsolete feature gate cfgs

Kimundi commented 6 years ago

Alright, thanks!