From 94de821002f3378a59c2bf812ce73756f3ed0512 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 3 Aug 2018 14:18:06 +0300 Subject: [PATCH 1/2] Specify reentrancy gurantees of `Once::call_once` --- src/libstd/sync/once.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 10282ecb65883..113fbbf1f616a 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -178,6 +178,10 @@ impl Once { /// happens-before relation between the closure and code executing after the /// return). /// + /// If the given closure recusively invokes `call_once` on the same `Once` + /// instance the exact behavior is not specified, allowed outcomes are + /// a panic or a deadlock. + /// /// # Examples /// /// ``` From a2f9aaf7a35e673c3b8f0825a07505b0294aa24f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 3 Aug 2018 16:50:30 +0300 Subject: [PATCH 2/2] Fix trailnig WS --- src/libstd/sync/once.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 113fbbf1f616a..3abc260b45868 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -178,7 +178,7 @@ impl Once { /// happens-before relation between the closure and code executing after the /// return). /// - /// If the given closure recusively invokes `call_once` on the same `Once` + /// If the given closure recusively invokes `call_once` on the same `Once` /// instance the exact behavior is not specified, allowed outcomes are /// a panic or a deadlock. ///