mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Rollup merge of #128457 - juntyr:once-lock-docs, r=tgross35
Fix docs for OnceLock::get_mut_or_init Removes an incorrect statment about concurrency from the `OnceLock::get_mut_or_init` (tracked in #121641) docs. Fixes #128429
This commit is contained in:
commit
7060a2f356
@ -281,9 +281,7 @@ impl<T> OnceLock<T> {
|
||||
/// Gets the mutable reference of the contents of the cell, initializing
|
||||
/// it with `f` if the cell was empty.
|
||||
///
|
||||
/// Many threads may call `get_mut_or_init` concurrently with different
|
||||
/// initializing functions, but it is guaranteed that only one function
|
||||
/// will be executed.
|
||||
/// This method never blocks.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
@ -373,6 +371,8 @@ impl<T> OnceLock<T> {
|
||||
/// it with `f` if the cell was empty. If the cell was empty and `f` failed,
|
||||
/// an error is returned.
|
||||
///
|
||||
/// This method never blocks.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// If `f` panics, the panic is propagated to the caller, and
|
||||
|
Loading…
Reference in New Issue
Block a user