We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d75213 commit a50fe31Copy full SHA for a50fe31
src/libstd/thread/local.rs
@@ -325,7 +325,10 @@ impl<T: 'static> LocalKey<T> {
325
///
326
/// Once the initialization expression succeeds, the key transitions to the
327
/// `Valid` state which will guarantee that future calls to [`with`] will
328
- /// succeed within the thread.
+ /// succeed within the thread. Some keys might skip the `Uninitialized`
329
+ /// state altogether and start in the `Valid` state as an optimization
330
+ /// (e.g. keys initialized with a constant expression), but no guarantees
331
+ /// are made.
332
333
/// When a thread exits, each key will be destroyed in turn, and as keys are
334
/// destroyed they will enter the `Destroyed` state just before the
0 commit comments