diff options
| author | Askar Safin <safinaskar@mail.ru> | 2025-02-11 08:57:36 +0300 |
|---|---|---|
| committer | Askar Safin <safinaskar@mail.ru> | 2025-02-11 08:57:36 +0300 |
| commit | 4a2c7f48b52fe9ecb34d3e406b12a99ba8de4042 (patch) | |
| tree | 88ec90f1c763cda49b2279f9a203e2dc002783cb | |
| parent | 8f684c9db7092d8a0c924ba63b967db021ab9860 (diff) | |
| download | rust-4a2c7f48b52fe9ecb34d3e406b12a99ba8de4042.tar.gz rust-4a2c7f48b52fe9ecb34d3e406b12a99ba8de4042.zip | |
compiler/rustc_data_structures/src/sync.rs: remove atomics, but not AtomicU64!
| -rw-r--r-- | compiler/rustc_data_structures/src/sync.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_data_structures/src/sync/freeze.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/graph.rs | 4 | ||||
| -rw-r--r-- | src/doc/rustc-dev-guide/src/parallel-rustc.md | 1 |
4 files changed, 4 insertions, 11 deletions
diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs index 37f2e1f096e..e93a0891f0a 100644 --- a/compiler/rustc_data_structures/src/sync.rs +++ b/compiler/rustc_data_structures/src/sync.rs @@ -20,11 +20,6 @@ //! | ----------------------- | ------------------- | ------------------------------- | //! | `LRef<'a, T>` [^2] | `&'a mut T` | `&'a T` | //! | | | | -//! | `AtomicBool` | `Cell<bool>` | `atomic::AtomicBool` | -//! | `AtomicU32` | `Cell<u32>` | `atomic::AtomicU32` | -//! | `AtomicU64` | `Cell<u64>` | `atomic::AtomicU64` | -//! | `AtomicUsize` | `Cell<usize>` | `atomic::AtomicUsize` | -//! | | | | //! | `Lock<T>` | `RefCell<T>` | `RefCell<T>` or | //! | | | `parking_lot::Mutex<T>` | //! | `RwLock<T>` | `RefCell<T>` | `parking_lot::RwLock<T>` | @@ -107,7 +102,6 @@ pub use std::sync::OnceLock; // Use portable AtomicU64 for targets without native 64-bit atomics #[cfg(target_has_atomic = "64")] pub use std::sync::atomic::AtomicU64; -pub use std::sync::atomic::{AtomicBool, AtomicU32, AtomicUsize}; pub use mode::{is_dyn_thread_safe, set_dyn_thread_safe_mode}; pub use parking_lot::{ diff --git a/compiler/rustc_data_structures/src/sync/freeze.rs b/compiler/rustc_data_structures/src/sync/freeze.rs index 5236c9fe156..9720b22ea7d 100644 --- a/compiler/rustc_data_structures/src/sync/freeze.rs +++ b/compiler/rustc_data_structures/src/sync/freeze.rs @@ -3,9 +3,9 @@ use std::intrinsics::likely; use std::marker::PhantomData; use std::ops::{Deref, DerefMut}; use std::ptr::NonNull; -use std::sync::atomic::Ordering; +use std::sync::atomic::{AtomicBool, Ordering}; -use crate::sync::{AtomicBool, DynSend, DynSync, ReadGuard, RwLock, WriteGuard}; +use crate::sync::{DynSend, DynSync, ReadGuard, RwLock, WriteGuard}; /// A type which allows mutation using a lock until /// the value is frozen and can be accessed lock-free. diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 7988afd3e13..5e6bee1dbd5 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -4,14 +4,14 @@ use std::fmt::Debug; use std::hash::Hash; use std::marker::PhantomData; use std::sync::Arc; -use std::sync::atomic::Ordering; +use std::sync::atomic::{AtomicU32, Ordering}; use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::profiling::{QueryInvocationId, SelfProfilerRef}; use rustc_data_structures::sharded::{self, Sharded}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; -use rustc_data_structures::sync::{AtomicU32, AtomicU64, Lock}; +use rustc_data_structures::sync::{AtomicU64, Lock}; use rustc_data_structures::unord::UnordMap; use rustc_index::IndexVec; use rustc_macros::{Decodable, Encodable}; diff --git a/src/doc/rustc-dev-guide/src/parallel-rustc.md b/src/doc/rustc-dev-guide/src/parallel-rustc.md index 4fb91da682b..deddf77e347 100644 --- a/src/doc/rustc-dev-guide/src/parallel-rustc.md +++ b/src/doc/rustc-dev-guide/src/parallel-rustc.md @@ -46,7 +46,6 @@ are implemented differently depending on whether `parallel-compiler` is true. | data structure | parallel | non-parallel | | -------------------------------- | --------------------------------------------------- | ------------ | -| Atomic{Bool}/{Usize}/{U32}/{U64} | std::sync::atomic::Atomic{Bool}/{Usize}/{U32}/{U64} | (std::cell::Cell<bool/usize/u32/u64>) | | OnceCell | std::sync::OnceLock | std::cell::OnceCell | | Lock\<T> | (parking_lot::Mutex\<T>) | (std::cell::RefCell) | | RwLock\<T> | (parking_lot::RwLock\<T>) | (std::cell::RefCell) | |
