Skip to content

Commit

Permalink
Initialize thread local with const{}.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Apr 7, 2022
1 parent 6888fb1 commit dc82718
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys/unix/locks/futex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

0 comments on commit dc82718

Please sign in to comment.