Skip to content

Commit

Permalink
Rollup merge of rust-lang#65997 - spastorino:fix-init_locking-rustdoc…
Browse files Browse the repository at this point in the history
…, r=Mark-Simulacrum

Fix outdated rustdoc of Once::init_locking function

r? @Mark-Simulacrum

related to rust-lang#65979
  • Loading branch information
tmandry authored Oct 31, 2019
2 parents 0682fc0 + 18391b6 commit 88ceb95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc_data_structures/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,10 @@ impl<T> Once<T> {
assert!(self.try_set(value).is_none());
}

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

0 comments on commit 88ceb95

Please sign in to comment.