Skip to content

Commit c517c4b

Browse files
authored
Unrolled build for rust-lang#128457
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
2 parents 71b2116 + 83fb140 commit c517c4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/sync/once_lock.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,7 @@ impl<T> OnceLock<T> {
309309
/// Gets the mutable reference of the contents of the cell, initializing
310310
/// it with `f` if the cell was empty.
311311
///
312-
/// Many threads may call `get_mut_or_init` concurrently with different
313-
/// initializing functions, but it is guaranteed that only one function
314-
/// will be executed.
312+
/// This method never blocks.
315313
///
316314
/// # Panics
317315
///
@@ -401,6 +399,8 @@ impl<T> OnceLock<T> {
401399
/// it with `f` if the cell was empty. If the cell was empty and `f` failed,
402400
/// an error is returned.
403401
///
402+
/// This method never blocks.
403+
///
404404
/// # Panics
405405
///
406406
/// If `f` panics, the panic is propagated to the caller, and

0 commit comments

Comments
 (0)