mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-05 11:33:04 +00:00
std:🧵:LocalKey: Document limitation with initializers
This commit is contained in:
parent
d93036a043
commit
ddb072b8d7
@ -31,6 +31,10 @@ use mem;
|
|||||||
/// within a thread, and values that implement [`Drop`] get destructed when a
|
/// within a thread, and values that implement [`Drop`] get destructed when a
|
||||||
/// thread exits. Some caveats apply, which are explained below.
|
/// thread exits. Some caveats apply, which are explained below.
|
||||||
///
|
///
|
||||||
|
/// A `LocalKey`'s initializer cannot recursively depend on itself, and using
|
||||||
|
/// a `LocalKey` in this way will cause the initializer to infinitely recurse
|
||||||
|
/// on the first call to `with`.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
Reference in New Issue
Block a user