diff options
| author | Chris Denton <chris@chrisdenton.dev> | 2024-02-24 14:09:22 -0300 |
|---|---|---|
| committer | Chris Denton <chris@chrisdenton.dev> | 2024-02-26 11:35:38 -0300 |
| commit | ad4c4f4654bf78bb51638e58a9c418afcdd6ee15 (patch) | |
| tree | bca6c88b57b7b1cebe13bea0ad0bb7f6c4b1c261 | |
| parent | 2fc091f510ce3b41de0c3c076b587badb687c458 (diff) | |
| download | rust-ad4c4f4654bf78bb51638e58a9c418afcdd6ee15.tar.gz rust-ad4c4f4654bf78bb51638e58a9c418afcdd6ee15.zip | |
Remove _tls_used trickery unless needed
| -rw-r--r-- | library/std/src/sys/pal/windows/thread_local_key.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/library/std/src/sys/pal/windows/thread_local_key.rs b/library/std/src/sys/pal/windows/thread_local_key.rs index 81741cc5f78..1d9cb316a45 100644 --- a/library/std/src/sys/pal/windows/thread_local_key.rs +++ b/library/std/src/sys/pal/windows/thread_local_key.rs @@ -295,16 +295,13 @@ unsafe extern "system" fn on_tls_callback(_h: c::LPVOID, dwReason: c::DWORD, _pv // See comments above for what this is doing. Note that we don't need this // trickery on GNU windows, just on MSVC. - reference_tls_used(); - #[cfg(target_env = "msvc")] - unsafe fn reference_tls_used() { + #[cfg(all(target_env = "msvc", not(target_thread_local)))] + { extern "C" { static _tls_used: u8; } crate::intrinsics::volatile_load(&_tls_used); } - #[cfg(not(target_env = "msvc"))] - unsafe fn reference_tls_used() {} } #[cfg(not(target_thread_local))] |
