about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-07 00:00:23 +0200
committerGitHub <noreply@github.com>2023-04-07 00:00:23 +0200
commitb7e69732878c5e2118d237b0a9b338cd192f1142 (patch)
tree07b75ceb25e88b31bb7368fbeb4ef0a764be13b7 /library/std/src
parentde74dab880447f5227030b261dbd0f2bc4f32dba (diff)
parent6c941362c9814bc5d2c9c436830543ce37e694b6 (diff)
downloadrust-b7e69732878c5e2118d237b0a9b338cd192f1142.tar.gz
rust-b7e69732878c5e2118d237b0a9b338cd192f1142.zip
Rollup merge of #109806 - Zoxc:gnu-tls, r=pnkfelix
Workaround #109797 on windows-gnu

The addition of `#[inline]` here in https://github.com/rust-lang/rust/pull/108089 caused an unrelated linking issue (https://github.com/rust-lang/rust/issues/109797). This PR removes this attribute again on Windows to avoid regressions.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys/common/thread_local/os_local.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/std/src/sys/common/thread_local/os_local.rs b/library/std/src/sys/common/thread_local/os_local.rs
index ce74ad3486e..1442a397e76 100644
--- a/library/std/src/sys/common/thread_local/os_local.rs
+++ b/library/std/src/sys/common/thread_local/os_local.rs
@@ -49,7 +49,9 @@ macro_rules! __thread_local_inner {
             #[inline]
             fn __init() -> $t { $init }
 
-            #[cfg_attr(not(bootstrap), inline)]
+            // `#[inline] does not work on windows-gnu due to linking errors around dllimports.
+            // See https://github.com/rust-lang/rust/issues/109797.
+            #[cfg_attr(not(windows), inline)]
             unsafe fn __getit(
                 init: $crate::option::Option<&mut $crate::option::Option<$t>>,
             ) -> $crate::option::Option<&'static $t> {