about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorStjepan Glavina <stjepang@gmail.com>2017-10-17 11:02:25 +0200
committerStjepan Glavina <stjepang@gmail.com>2017-10-17 11:02:25 +0200
commita50fe312dc9fec9f9fc3576bc244ef2517ac8f4a (patch)
tree7e59fdcb9b6047f261b03767bd6dee712edad996 /src/libstd
parent2d75213709ab78d0db9051d9e0b550192e1aa15a (diff)
downloadrust-a50fe312dc9fec9f9fc3576bc244ef2517ac8f4a.tar.gz
rust-a50fe312dc9fec9f9fc3576bc244ef2517ac8f4a.zip
Docs: a LocalKey might start in the Valid state
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/thread/local.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index a53c76a333a..cb18eed8ee5 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -325,7 +325,10 @@ impl<T: 'static> LocalKey<T> {
     ///
     /// Once the initialization expression succeeds, the key transitions to the
     /// `Valid` state which will guarantee that future calls to [`with`] will
-    /// succeed within the thread.
+    /// succeed within the thread. Some keys might skip the `Uninitialized`
+    /// state altogether and start in the `Valid` state as an optimization
+    /// (e.g. keys initialized with a constant expression), but no guarantees
+    /// are made.
     ///
     /// When a thread exits, each key will be destroyed in turn, and as keys are
     /// destroyed they will enter the `Destroyed` state just before the