about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-01 02:26:32 +0000
committerbors <bors@rust-lang.org>2024-08-01 02:26:32 +0000
commite485266c673a1bdd7f112700b7a3ec4235816e7d (patch)
treef73fe55c545c5bff8e23bc212469a51c9ca333ff /library/std/src
parent71b211609605590423a68ba3f503e53404d4fdb4 (diff)
parent7060a2f356ecb3bbe53950999ce08ab76e36b4bb (diff)
downloadrust-e485266c673a1bdd7f112700b7a3ec4235816e7d.tar.gz
rust-e485266c673a1bdd7f112700b7a3ec4235816e7d.zip
Auto merge of #128461 - matthiaskrgr:rollup-3dpp11g, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #123813 (Add `REDUNDANT_IMPORTS` lint for new redundant import detection)
 - #126697 ([RFC] mbe: consider the `_` in 2024 an expression)
 - #127159 (match lowering: Hide `Candidate` from outside the lowering algorithm)
 - #128244 (Peel off explicit (or implicit) deref before suggesting clone on move error in borrowck, remove some hacks)
 - #128431 (Add myself as VxWorks target maintainer for reference)
 - #128438 (Add special-case for [T, 0] in dropck_outlives)
 - #128457 (Fix docs for OnceLock::get_mut_or_init)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sync/once_lock.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sync/once_lock.rs b/library/std/src/sync/once_lock.rs
index efc1f415edf..56cf877ddc6 100644
--- a/library/std/src/sync/once_lock.rs
+++ b/library/std/src/sync/once_lock.rs
@@ -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
     ///
@@ -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