about summary refs log tree commit diff
path: root/src/libstd/thread/local.rs
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-12-06 09:25:29 +0100
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-12-06 09:25:29 +0100
commitacdf83f2288e1b80259dafeca4a0cee9a42973c3 (patch)
treeef7ffe46fee2f0b9f331a206af4a71d23fabe0a1 /src/libstd/thread/local.rs
parentd4c442d65c150b99d18202a5cce4a2cbdbd4dc83 (diff)
downloadrust-acdf83f2288e1b80259dafeca4a0cee9a42973c3.tar.gz
rust-acdf83f2288e1b80259dafeca4a0cee9a42973c3.zip
Update miri to rustc changes
Diffstat (limited to 'src/libstd/thread/local.rs')
-rw-r--r--src/libstd/thread/local.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index a53c76a333a..fcbca38a98f 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -190,11 +190,6 @@ macro_rules! __thread_local_inner {
         }
     };
     ($(#[$attr:meta])* $vis:vis $name:ident, $t:ty, $init:expr) => {
-        #[cfg(stage0)]
-        $(#[$attr])* $vis static $name: $crate::thread::LocalKey<$t> =
-            __thread_local_inner!(@key $(#[$attr])* $vis $name, $t, $init);
-
-        #[cfg(not(stage0))]
         $(#[$attr])* $vis const $name: $crate::thread::LocalKey<$t> =
             __thread_local_inner!(@key $(#[$attr])* $vis $name, $t, $init);
     }
@@ -325,7 +320,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