about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-11-01 11:20:25 -0700
committerGitHub <noreply@github.com>2019-11-01 11:20:25 -0700
commit665d6479c48daf863625f20f0ddcc98007d67eb8 (patch)
tree48846f412a03b1b8061dfd9b6dd0092f51c9d18b
parent1ea66850af013e03295c1ad5e46802dfea4a53bd (diff)
parent18391b62f3a919f39e14f385b95cd312b1e82b62 (diff)
downloadrust-665d6479c48daf863625f20f0ddcc98007d67eb8.tar.gz
rust-665d6479c48daf863625f20f0ddcc98007d67eb8.zip
Rollup merge of #65997 - spastorino:fix-init_locking-rustdoc, r=Mark-Simulacrum
Fix outdated rustdoc of Once::init_locking function

r? @Mark-Simulacrum

related to https://github.com/rust-lang/rust/pull/65979
-rw-r--r--src/librustc_data_structures/sync.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs
index d111471f53d..6a19f52897e 100644
--- a/src/librustc_data_structures/sync.rs
+++ b/src/librustc_data_structures/sync.rs
@@ -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 {
         {