mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
Initialize thread local with const{}.
This commit is contained in:
parent
319a9b0f71
commit
43651aa34f
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user