Skip to content

Commit c898d12

Browse files
authored
Unrolled build for rust-lang#140783
Rollup merge of rust-lang#140783 - veluca93:oncelock-docs, r=jhpratt Update documentation of OnceLock::get_or_init. Explicitly point out that if the function panics the init function might be called multiple times.
2 parents b105556 + ae25c39 commit c898d12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sync/once_lock.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl<T> OnceLock<T> {
279279
///
280280
/// Many threads may call `get_or_init` concurrently with different
281281
/// initializing functions, but it is guaranteed that only one function
282-
/// will be executed.
282+
/// will be executed if the function doesn't panic.
283283
///
284284
/// # Panics
285285
///

0 commit comments

Comments
 (0)