about summary refs log tree commit diff
path: root/library/std/src/sys/pal
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-04-21 19:28:16 +0000
committerbors <bors@rust-lang.org>2025-04-21 19:28:16 +0000
commitd6c1e454aa8af5e7e59fbf5c4e7d3128d2f99582 (patch)
treee12c3de53a1d961026e0de6bd56a3662aa88723e /library/std/src/sys/pal
parent8f2819b0e3428d0aee05fa60e91e0211c2aea053 (diff)
parent1cb9a0d450c935cda211bb970446d7e8cf504311 (diff)
Auto merge of #140127 - ChrisDenton:rollup-2kye32h, r=ChrisDenton
Rollup of 11 pull requests

Successful merges:

 - #134213 (Stabilize `naked_functions`)
 - #139711 (Hermit: Unify `std::env::args` with Unix)
 - #139795 (Clarify why SGX code specifies linkage/symbol names for certain statics)
 - #140036 (Advent of `tests/ui` (misc cleanups and improvements) [4/N])
 - #140047 (remove a couple clones)
 - #140052 (Fix error when an intra doc link is trying to resolve an empty associated item)
 - #140074 (rustdoc-json: Improve test for auto-trait impls)
 - #140076 (jsondocck: Require command is at start of line)
 - #140107 (rustc-dev-guide subtree update)
 - #140111 (cleanup redundant pattern instances)
 - #140118 ({B,C}Str: minor cleanup)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys/pal')
-rw-r--r--library/std/src/sys/pal/sgx/abi/tls/mod.rs6
-rw-r--r--library/std/src/sys/pal/sgx/os.rs6
-rw-r--r--library/std/src/sys/pal/sgx/thread.rs3
3 files changed, 10 insertions, 5 deletions
diff --git a/library/std/src/sys/pal/sgx/abi/tls/mod.rs b/library/std/src/sys/pal/sgx/abi/tls/mod.rs
index 8e2b271f1c9..f082d94614b 100644
--- a/library/std/src/sys/pal/sgx/abi/tls/mod.rs
+++ b/library/std/src/sys/pal/sgx/abi/tls/mod.rs
@@ -11,15 +11,17 @@ const USIZE_BITS: usize = 64;
 const TLS_KEYS: usize = 128; // Same as POSIX minimum
 const TLS_KEYS_BITSET_SIZE: usize = (TLS_KEYS + (USIZE_BITS - 1)) / USIZE_BITS;
 
+// Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
 #[cfg_attr(test, linkage = "available_externally")]
-#[unsafe(export_name = "_ZN16__rust_internals3std3sys3sgx3abi3tls14TLS_KEY_IN_USEE")]
+#[unsafe(export_name = "_ZN16__rust_internals3std3sys3pal3sgx3abi3tls14TLS_KEY_IN_USEE")]
 static TLS_KEY_IN_USE: SyncBitset = SYNC_BITSET_INIT;
 macro_rules! dup {
     ((* $($exp:tt)*) $($val:tt)*) => (dup!( ($($exp)*) $($val)* $($val)* ));
     (() $($val:tt)*) => ([$($val),*])
 }
+// Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
 #[cfg_attr(test, linkage = "available_externally")]
-#[unsafe(export_name = "_ZN16__rust_internals3std3sys3sgx3abi3tls14TLS_DESTRUCTORE")]
+#[unsafe(export_name = "_ZN16__rust_internals3std3sys3pal3sgx3abi3tls14TLS_DESTRUCTORE")]
 static TLS_DESTRUCTOR: [AtomicUsize; TLS_KEYS] = dup!((* * * * * * *) (AtomicUsize::new(0)));
 
 unsafe extern "C" {
diff --git a/library/std/src/sys/pal/sgx/os.rs b/library/std/src/sys/pal/sgx/os.rs
index b1ec2afd764..010634cf310 100644
--- a/library/std/src/sys/pal/sgx/os.rs
+++ b/library/std/src/sys/pal/sgx/os.rs
@@ -73,11 +73,13 @@ pub fn current_exe() -> io::Result<PathBuf> {
     unsupported()
 }
 
+// Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
 #[cfg_attr(test, linkage = "available_externally")]
-#[unsafe(export_name = "_ZN16__rust_internals3std3sys3sgx2os3ENVE")]
+#[unsafe(export_name = "_ZN16__rust_internals3std3sys3pal3sgx2os3ENVE")]
 static ENV: AtomicUsize = AtomicUsize::new(0);
+// Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
 #[cfg_attr(test, linkage = "available_externally")]
-#[unsafe(export_name = "_ZN16__rust_internals3std3sys3sgx2os8ENV_INITE")]
+#[unsafe(export_name = "_ZN16__rust_internals3std3sys3pal3sgx2os8ENV_INITE")]
 static ENV_INIT: Once = Once::new();
 type EnvStore = Mutex<HashMap<OsString, OsString>>;
 
diff --git a/library/std/src/sys/pal/sgx/thread.rs b/library/std/src/sys/pal/sgx/thread.rs
index b6932df431f..219ef1b7a98 100644
--- a/library/std/src/sys/pal/sgx/thread.rs
+++ b/library/std/src/sys/pal/sgx/thread.rs
@@ -45,8 +45,9 @@ mod task_queue {
         }
     }
 
+    // Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
     #[cfg_attr(test, linkage = "available_externally")]
-    #[unsafe(export_name = "_ZN16__rust_internals3std3sys3sgx6thread10TASK_QUEUEE")]
+    #[unsafe(export_name = "_ZN16__rust_internals3std3sys3pal3sgx6thread10TASK_QUEUEE")]
     static TASK_QUEUE: Mutex<Vec<Task>> = Mutex::new(Vec::new());
 
     pub(super) fn lock() -> MutexGuard<'static, Vec<Task>> {