From 4d93f6056824c338751f19356d33bb61ce818749 Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Thu, 19 Sep 2024 00:15:03 -0400 Subject: use generic Atomic type where possible in core/alloc/std only for now, and ignoring test files Co-authored-by: Pavel Grigorenko --- library/std/src/sys/env/sgx.rs | 4 ++-- library/std/src/sys/env/xous.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'library/std/src/sys/env') diff --git a/library/std/src/sys/env/sgx.rs b/library/std/src/sys/env/sgx.rs index 85be9cd6ad4..09090ec7cf0 100644 --- a/library/std/src/sys/env/sgx.rs +++ b/library/std/src/sys/env/sgx.rs @@ -4,13 +4,13 @@ pub use super::common::Env; use crate::collections::HashMap; use crate::ffi::{OsStr, OsString}; use crate::io; -use crate::sync::atomic::{AtomicUsize, Ordering}; +use crate::sync::atomic::{Atomic, AtomicUsize, Ordering}; use crate::sync::{Mutex, Once}; // 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_internals3std3sys3pal3sgx2os3ENVE")] -static ENV: AtomicUsize = AtomicUsize::new(0); +static ENV: Atomic = 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_internals3std3sys3pal3sgx2os8ENV_INITE")] diff --git a/library/std/src/sys/env/xous.rs b/library/std/src/sys/env/xous.rs index 232a3dafb0b..8f65f30d35f 100644 --- a/library/std/src/sys/env/xous.rs +++ b/library/std/src/sys/env/xous.rs @@ -2,11 +2,11 @@ pub use super::common::Env; use crate::collections::HashMap; use crate::ffi::{OsStr, OsString}; use crate::io; -use crate::sync::atomic::{AtomicUsize, Ordering}; +use crate::sync::atomic::{Atomic, AtomicUsize, Ordering}; use crate::sync::{Mutex, Once}; use crate::sys::pal::os::{get_application_parameters, params}; -static ENV: AtomicUsize = AtomicUsize::new(0); +static ENV: Atomic = AtomicUsize::new(0); static ENV_INIT: Once = Once::new(); type EnvStore = Mutex>; -- cgit 1.4.1-3-g733a5