diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-06-19 00:17:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-19 00:17:13 +0200 |
| commit | f351f347b8ab6520f749b0ec10aa33b3ee480614 (patch) | |
| tree | 6a6d0e3bd9f71265e01b00efbae252b00ddfd6c5 /compiler/rustc_data_structures/src | |
| parent | e6d28d2ea22f7a4985a1e5212aab58535a64ba15 (diff) | |
| parent | c1a2db3372a4d6896744919284f3287650a38ab7 (diff) | |
| download | rust-f351f347b8ab6520f749b0ec10aa33b3ee480614.tar.gz rust-f351f347b8ab6520f749b0ec10aa33b3ee480614.zip | |
Rollup merge of #98165 - WaffleLapkin:once_things_renamings, r=m-ou-se
once cell renamings
This PR does the renamings proposed in https://github.com/rust-lang/rust/issues/74465#issuecomment-1153703128
- Move/rename `lazy::{OnceCell, Lazy}` to `cell::{OnceCell, LazyCell}`
- Move/rename `lazy::{SyncOnceCell, SyncLazy}` to `sync::{OnceLock, LazyLock}`
(I used `Lazy...` instead of `...Lazy` as it seems to be more consistent, easier to pronounce, etc)
```@rustbot``` label +T-libs-api -T-libs
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/jobserver.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_data_structures/src/sync.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_data_structures/src/jobserver.rs b/compiler/rustc_data_structures/src/jobserver.rs index 41605afb44e..09baa3095a4 100644 --- a/compiler/rustc_data_structures/src/jobserver.rs +++ b/compiler/rustc_data_structures/src/jobserver.rs @@ -1,5 +1,5 @@ pub use jobserver_crate::Client; -use std::lazy::SyncLazy; +use std::sync::LazyLock; // We can only call `from_env` once per process @@ -18,7 +18,7 @@ use std::lazy::SyncLazy; // Also note that we stick this in a global because there could be // multiple rustc instances in this process, and the jobserver is // per-process. -static GLOBAL_CLIENT: SyncLazy<Client> = SyncLazy::new(|| unsafe { +static GLOBAL_CLIENT: LazyLock<Client> = LazyLock::new(|| unsafe { Client::from_env().unwrap_or_else(|| { let client = Client::new(32).expect("failed to create jobserver"); // Acquire a token for the main thread which we can release later diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs index f99ca53ab25..feb82cb0938 100644 --- a/compiler/rustc_data_structures/src/sync.rs +++ b/compiler/rustc_data_structures/src/sync.rs @@ -173,7 +173,7 @@ cfg_if! { pub use std::cell::RefMut as LockGuard; pub use std::cell::RefMut as MappedLockGuard; - pub use std::lazy::OnceCell; + pub use std::cell::OnceCell; use std::cell::RefCell as InnerRwLock; use std::cell::RefCell as InnerLock; @@ -258,7 +258,7 @@ cfg_if! { pub use parking_lot::MutexGuard as LockGuard; pub use parking_lot::MappedMutexGuard as MappedLockGuard; - pub use std::lazy::SyncOnceCell as OnceCell; + pub use std::sync::OnceLock as OnceCell; pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32, AtomicU64}; |
