about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorJoshua Liebow-Feeser <hello@joshlf.com>2017-09-07 12:57:08 -0700
committerJoshua Liebow-Feeser <hello@joshlf.com>2017-09-07 12:57:08 -0700
commitddb072b8d77dbb4708ffa89b361375d761debc9f (patch)
tree938674536423e0850adbef180ed5a2293f24373c /src/libstd
parentd93036a043dbd19f394ad320313bdbe81644f121 (diff)
downloadrust-ddb072b8d77dbb4708ffa89b361375d761debc9f.tar.gz
rust-ddb072b8d77dbb4708ffa89b361375d761debc9f.zip
std::thread::LocalKey: Document limitation with initializers
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/thread/local.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 4ee8132f55c..a53c76a333a 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -31,6 +31,10 @@ use mem;
 /// within a thread, and values that implement [`Drop`] get destructed when a
 /// 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
 ///
 /// ```