about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2022-04-06 22:14:43 +0200
committerMara Bos <m-ou.se@m-ou.se>2022-04-12 08:44:39 +0200
commit43651aa34fd7762058aea6920d2e401561d97076 (patch)
treeedd0aaf1992d03fc73646347efb0430a5c5cad03
parent319a9b0f71d21409858297357bc047fb7a6ba27f (diff)
downloadrust-43651aa34fd7762058aea6920d2e401561d97076.tar.gz
rust-43651aa34fd7762058aea6920d2e401561d97076.zip
Initialize thread local with const{}.
-rw-r--r--library/std/src/sys/unix/locks/futex.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/unix/locks/futex.rs b/library/std/src/sys/unix/locks/futex.rs
index 1df7b532546..0c7fb098c5f 100644
--- a/library/std/src/sys/unix/locks/futex.rs
+++ b/library/std/src/sys/unix/locks/futex.rs
@@ -253,6 +253,6 @@ impl ReentrantMutex {
 /// This can be used as a non-null usize-sized ID.
 pub fn current_thread_unique_ptr() -> usize {
     // Use a non-drop type to make sure it's still available during thread destruction.
-    thread_local! { static X: u8 = 0 }
+    thread_local! { static X: u8 = const { 0 } }
     X.with(|x| <*const _>::addr(x))
 }