Skip to content

Commit 665d647

Browse files
authored
Rollup merge of rust-lang#65997 - spastorino:fix-init_locking-rustdoc, r=Mark-Simulacrum
Fix outdated rustdoc of Once::init_locking function r? @Mark-Simulacrum related to rust-lang#65979
2 parents 1ea6685 + 18391b6 commit 665d647

File tree

1 file changed

+4
-4
lines changed
  • src/librustc_data_structures

1 file changed

+4
-4
lines changed

src/librustc_data_structures/sync.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ impl<T> Once<T> {
492492
assert!(self.try_set(value).is_none());
493493
}
494494

495-
/// Tries to initialize the inner value by calling the closure while ensuring that no-one else
496-
/// can access the value in the mean time by holding a lock for the duration of the closure.
497-
/// If the value was already initialized the closure is not called and `false` is returned,
498-
/// otherwise if the value from the closure initializes the inner value, `true` is returned
495+
/// Initializes the inner value if it wasn't already done by calling the provided closure. It
496+
/// ensures that no-one else can access the value in the mean time by holding a lock for the
497+
/// duration of the closure.
498+
/// A reference to the inner value is returned.
499499
#[inline]
500500
pub fn init_locking<F: FnOnce() -> T>(&self, f: F) -> &T {
501501
{

0 commit comments

Comments
 (0)