From 18391b62f3a919f39e14f385b95cd312b1e82b62 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 31 Oct 2019 10:06:14 -0300 Subject: [PATCH] Fix outdated rustdoc of Once::init_locking function --- src/librustc_data_structures/sync.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs index d111471f53d7d..6a19f52897e5d 100644 --- a/src/librustc_data_structures/sync.rs +++ b/src/librustc_data_structures/sync.rs @@ -492,10 +492,10 @@ impl Once { 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 T>(&self, f: F) -> &T { {