diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-06-16 19:39:39 +0400 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-06-16 19:54:42 +0400 |
| commit | c1a2db3372a4d6896744919284f3287650a38ab7 (patch) | |
| tree | 636b2ff560a6dc628c5cec1440db82210b73dee5 /compiler/rustc_data_structures/src/jobserver.rs | |
| parent | 7c360dc117d554a11f7193505da0835c4b890c6f (diff) | |
| download | rust-c1a2db3372a4d6896744919284f3287650a38ab7.tar.gz rust-c1a2db3372a4d6896744919284f3287650a38ab7.zip | |
Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`
Diffstat (limited to 'compiler/rustc_data_structures/src/jobserver.rs')
| -rw-r--r-- | compiler/rustc_data_structures/src/jobserver.rs | 4 |
1 files changed, 2 insertions, 2 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 |
