diff options
| author | bors <bors@rust-lang.org> | 2022-11-19 06:40:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-19 06:40:38 +0000 |
| commit | 2f8d8040166a730d0da7bba0f2864f0ef7ff6364 (patch) | |
| tree | b3c1cb60370e9195576083b367a68464deebf57d /library/core/src | |
| parent | becc24a23aed2639db3b78acd93ec6d553898583 (diff) | |
| parent | 3cf3a65a719e29bc5aac8a3a3be8a21f3162acf2 (diff) | |
| download | rust-2f8d8040166a730d0da7bba0f2864f0ef7ff6364.tar.gz rust-2f8d8040166a730d0da7bba0f2864f0ef7ff6364.zip | |
Auto merge of #104600 - Dylan-DPC:rollup-glw1e8b, r=Dylan-DPC
Rollup of 8 pull requests
Successful merges:
- #104001 (Improve generating Custom entry function)
- #104411 (nll: correctly deal with bivariance)
- #104528 (Properly link `{Once,Lazy}{Cell,Lock}` in docs)
- #104553 (Improve accuracy of asinh and acosh)
- #104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)
- #104566 (couple of clippy::perf fixes)
- #104575 (deduplicate tests)
- #104580 (diagnostics: only show one suggestion for method -> assoc fn)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/cell/lazy.rs | 4 | ||||
| -rw-r--r-- | library/core/src/cell/once.rs | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/library/core/src/cell/lazy.rs b/library/core/src/cell/lazy.rs index 7844be5f783..b355d94ce49 100644 --- a/library/core/src/cell/lazy.rs +++ b/library/core/src/cell/lazy.rs @@ -4,6 +4,10 @@ use crate::ops::Deref; /// A value which is initialized on the first access. /// +/// For a thread-safe version of this struct, see [`std::sync::LazyLock`]. +/// +/// [`std::sync::LazyLock`]: ../../std/sync/struct.LazyLock.html +/// /// # Examples /// /// ``` diff --git a/library/core/src/cell/once.rs b/library/core/src/cell/once.rs index 3c39394dd8c..8c01643c7ac 100644 --- a/library/core/src/cell/once.rs +++ b/library/core/src/cell/once.rs @@ -4,8 +4,14 @@ use crate::mem; /// A cell which can be written to only once. /// -/// Unlike `RefCell`, a `OnceCell` only provides shared `&T` references to its value. -/// Unlike `Cell`, a `OnceCell` doesn't require copying or replacing the value to access it. +/// Unlike [`RefCell`], a `OnceCell` only provides shared `&T` references to its value. +/// Unlike [`Cell`], a `OnceCell` doesn't require copying or replacing the value to access it. +/// +/// For a thread-safe version of this struct, see [`std::sync::OnceLock`]. +/// +/// [`RefCell`]: crate::cell::RefCell +/// [`Cell`]: crate::cell::Cell +/// [`std::sync::OnceLock`]: ../../std/sync/struct.OnceLock.html /// /// # Examples /// |
