Skip to content

Commit

Permalink
Rollup merge of #128457 - juntyr:once-lock-docs, r=tgross35
Browse files Browse the repository at this point in the history
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
  • Loading branch information
matthiaskrgr authored Jul 31, 2024
2 parents b22c48e + 83fb140 commit 7060a2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/std/src/sync/once_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7060a2f

Please sign in to comment.