@@ -162,7 +162,7 @@ macro_rules! thread_local {
162
162
macro_rules! __thread_local_inner {
163
163
// used to generate the `LocalKey` value for const-initialized thread locals
164
164
( @key $t: ty, const $init: expr) => { {
165
- #[ cfg_attr( not( target_env = "msvc" ) , inline) ] // see comments below
165
+ #[ cfg_attr( not( windows ) , inline) ] // see comments below
166
166
unsafe fn __getit( ) -> $crate:: option:: Option <& ' static $t> {
167
167
const _REQUIRE_UNSTABLE: ( ) = $crate:: thread:: require_unstable_const_init_thread_local( ) ;
168
168
@@ -262,28 +262,28 @@ macro_rules! __thread_local_inner {
262
262
fn __init( ) -> $t { $init }
263
263
264
264
// When reading this function you might ask "why is this inlined
265
- // everywhere other than MSVC ?", and that's a very reasonable
265
+ // everywhere other than Windows ?", and that's a very reasonable
266
266
// question to ask. The short story is that it segfaults rustc if
267
- // this function is inlined. The longer story is that MSVC looks to
268
- // not support `extern` references to thread locals across DLL
267
+ // this function is inlined. The longer story is that Windows looks
268
+ // to not support `extern` references to thread locals across DLL
269
269
// boundaries. This appears to at least not be supported in the ABI
270
270
// that LLVM implements.
271
271
//
272
- // Because of this we never inline on MVSC , but we do inline on
272
+ // Because of this we never inline on Windows , but we do inline on
273
273
// other platforms (where external references to thread locals
274
274
// across DLLs are supported). A better fix for this would be to
275
- // inline this function on MSVC , but only for "statically linked"
275
+ // inline this function on Windows , but only for "statically linked"
276
276
// components. For example if two separately compiled rlibs end up
277
277
// getting linked into a DLL then it's fine to inline this function
278
278
// across that boundary. It's only not fine to inline this function
279
- // across a DLL boundary. Unfortunately rustc doesn't currently have
280
- // this sort of logic available in an attribute, and it's not clear
281
- // that rustc is even equipped to answer this (it's more of a Cargo
282
- // question kinda). This means that, unfortunately, MSVC gets the
283
- // pessimistic path for now where it's never inlined.
279
+ // across a DLL boundary. Unfortunately rustc doesn't currently
280
+ // have this sort of logic available in an attribute, and it's not
281
+ // clear that rustc is even equipped to answer this (it's more of a
282
+ // Cargo question kinda). This means that, unfortunately, Windows
283
+ // gets the pessimistic path for now where it's never inlined.
284
284
//
285
- // The issue of "should enable on MSVC sometimes" is #84933
286
- #[ cfg_attr( not( target_env = "msvc" ) , inline) ]
285
+ // The issue of "should enable on Windows sometimes" is #84933
286
+ #[ cfg_attr( not( windows ) , inline) ]
287
287
unsafe fn __getit( ) -> $crate:: option:: Option <& ' static $t> {
288
288
#[ cfg( all( target_arch = "wasm32" , not( target_feature = "atomics" ) ) ) ]
289
289
static __KEY: $crate:: thread:: __StaticLocalKeyInner<$t> =
0 commit comments