Skip to content

Commit

Permalink
Unrolled build for rust-lang#128457
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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 rust-lang#121641) docs.

Fixes rust-lang#128429
  • Loading branch information
rust-timer authored Aug 1, 2024
2 parents 71b2116 + 83fb140 commit c517c4b
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 @@ -309,9 +309,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 @@ -401,6 +399,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 c517c4b

Please sign in to comment.