about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-07-20 19:29:00 +0200
committerGitHub <noreply@github.com>2024-07-20 19:29:00 +0200
commit8fe93c9bec235cccd22c422b2cfd61a091ff9661 (patch)
treef791c8ddd89d6e715993b36f96165a8676f4a80c
parent17aaba70d9c81b5f4c647a446eb995b8b9275bbb (diff)
parentaf735f3bd3aca37a7ba289ac9518492c39726e00 (diff)
downloadrust-8fe93c9bec235cccd22c422b2cfd61a091ff9661.tar.gz
rust-8fe93c9bec235cccd22c422b2cfd61a091ff9661.zip
Rollup merge of #128005 - ChrisDenton:msvc-include, r=joboet
Remove _tls_used hack

All the MSVC targets use `target_thread_locals` (see the [base spec](https://github.com/rust-lang/rust/blob/1afc5fd042f7583b9668dd62be98325487483d1c/compiler/rustc_target/src/spec/base/windows_msvc.rs#L34)) so this hack is no longer needed. The compiler will ensure that thread locals work properly.
-rw-r--r--library/std/src/sys/thread_local/guard/windows.rs13
1 files changed, 0 insertions, 13 deletions
diff --git a/library/std/src/sys/thread_local/guard/windows.rs b/library/std/src/sys/thread_local/guard/windows.rs
index f6cd457046f..e08ac44e1af 100644
--- a/library/std/src/sys/thread_local/guard/windows.rs
+++ b/library/std/src/sys/thread_local/guard/windows.rs
@@ -78,19 +78,6 @@ pub fn enable() {
 pub static CALLBACK: unsafe extern "system" fn(*mut c_void, u32, *mut c_void) = tls_callback;
 
 unsafe extern "system" fn tls_callback(_h: *mut c_void, dw_reason: u32, _pv: *mut c_void) {
-    // See comments above for what this is doing. Note that we don't need this
-    // trickery on GNU windows, just on MSVC.
-    #[cfg(all(target_env = "msvc", not(target_thread_local)))]
-    {
-        extern "C" {
-            static _tls_used: u8;
-        }
-
-        unsafe {
-            ptr::from_ref(&_tls_used).read_volatile();
-        }
-    }
-
     if dw_reason == c::DLL_THREAD_DETACH || dw_reason == c::DLL_PROCESS_DETACH {
         #[cfg(target_thread_local)]
         unsafe {