From 94de821002f3378a59c2bf812ce73756f3ed0512 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 3 Aug 2018 14:18:06 +0300 Subject: [PATCH] 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 /// /// ```