Closed
Description
It's not clear why std::io::lazy
doesn't use Once
, as that was available at the time when it was introduced.
#53108 marked Lazy::new
as unsafe
because of the lack of reentrance safety in the mutex being used, but Once
specifically doesn't have reentrancy issues.
lazy_static
version: https://github.com/rust-lang-nursery/lazy-static.rs/blob/13159c2b615903d93b4cd4f98d17fdfe70392a3a/src/inline_lazy.rs
However, we need to change it per rust-lang-nursery/lazy-static.rs#117, otherwise it's unsound.