2 ms·
That is correct. Kinda. Refcell can not work because Rust considers globals to be shared by multiple threads so requires thread safety. And that’s where a numb
by masklinn 11mo ago
That is correct. Kinda. Refcell can not work because Rust considers globals to be shared by multiple threads so requires thread safety.
And that’s where a number of people blow a gasket.
- masklinn 11mo agoA second component is that statics require const initializers, so for most of rust’s history if you wanted a non-trivial global it was either a lot of faffing about or using third party packages (lazy_static, once_cell). Since 1.80 the vast majority of uses are a LazyLock away.