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 /library/std/src/sys | |
| 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 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/windows/net.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/windows/rand.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/sys/windows/net.rs b/library/std/src/sys/windows/net.rs index 5de12313784..d1e72cd5443 100644 --- a/library/std/src/sys/windows/net.rs +++ b/library/std/src/sys/windows/net.rs @@ -2,13 +2,13 @@ use crate::cmp; use crate::io::{self, IoSlice, IoSliceMut, Read}; -use crate::lazy::SyncOnceCell; use crate::mem; use crate::net::{Shutdown, SocketAddr}; use crate::os::windows::io::{ AsRawSocket, AsSocket, BorrowedSocket, FromRawSocket, IntoRawSocket, OwnedSocket, RawSocket, }; use crate::ptr; +use crate::sync::OnceLock; use crate::sys; use crate::sys::c; use crate::sys_common::net; @@ -29,7 +29,7 @@ pub mod netc { pub struct Socket(OwnedSocket); -static WSA_CLEANUP: SyncOnceCell<unsafe extern "system" fn() -> i32> = SyncOnceCell::new(); +static WSA_CLEANUP: OnceLock<unsafe extern "system" fn() -> i32> = OnceLock::new(); /// Checks whether the Windows socket interface has been started already, and /// if not, starts it. diff --git a/library/std/src/sys/windows/rand.rs b/library/std/src/sys/windows/rand.rs index 22e024d8552..57248e3651b 100644 --- a/library/std/src/sys/windows/rand.rs +++ b/library/std/src/sys/windows/rand.rs @@ -1,6 +1,6 @@ use crate::io; -use crate::lazy; use crate::mem; +use crate::sync; use crate::sys::c; /// The kinds of HashMap RNG that may be available @@ -28,7 +28,7 @@ fn get_hashmap_rng() -> HashMapRng { // Assume that if the preferred RNG is broken the first time we use it, it likely means // that: the DLL has failed to load, there is no point to calling it over-and-over again, // and we should cache the result - static VALUE: lazy::SyncOnceCell<HashMapRng> = lazy::SyncOnceCell::new(); + static VALUE: sync::OnceLock<HashMapRng> = sync::OnceLock::new(); *VALUE.get_or_init(choose_hashmap_rng) } |
