Skip to content

Commit 474a8bd

Browse files
committed
clarify that thread_local might not work out
1 parent cc9aee8 commit 474a8bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

text/0000-standard-lazy-types.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static GLOBAL_DATA: Lazy<Mutex<HashMap<i32, String>>> = Lazy::new(|| {
180180
});
181181
```
182182

183-
Moreover, once `#[thread_local]` attribute is stable (which is not on the road to stabilization yet), `Lazy` will supplant `std::thread_local!` as well:
183+
Moreover, once `#[thread_local]` attribute is stable, `Lazy` might supplant `std::thread_local!` as well:
184184

185185
```rust
186186
use std::cell::{RefCell, Lazy};
@@ -203,6 +203,8 @@ fn main() {
203203
}
204204
```
205205

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+
206208
# Reference-level explanation
207209
[reference-level-explanation]: #reference-level-explanation
208210

0 commit comments

Comments
 (0)