Skip to content

Commit 77ff080

Browse files
committed
avoid tearing of thread_locals
1 parent d459f2c commit 77ff080

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

text/0000-standard-lazy-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ use std::cell::{RefCell, Lazy};
189189
pub static FOO: Lazy<RefCell<u32>> = Lazy::new(|| RefCell::new(1));
190190
```
191191

192+
However, `#[thread_local]` attribute is pretty far from stabilization at the moment, and due to the required special handling of destructors, it's unclear if just using `cell::Lazy` will work out.
193+
192194
Unlike `lazy_static!`, `Lazy` can be used used for locals:
193195

194196
```rust
@@ -203,8 +205,6 @@ fn main() {
203205
}
204206
```
205207

206-
However, `#[thread_local]` attribute is pretty far from stabilization at the moment, and due to the required special handling of destructors, it's unclear if just using `cell::Lazy` will work out.
207-
208208
# Reference-level explanation
209209
[reference-level-explanation]: #reference-level-explanation
210210

0 commit comments

Comments
 (0)