From 93571537e3ba1e5d9e9c32151af0287299409246 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 8 Nov 2016 20:15:20 +0100 Subject: [PATCH] More proeminent warning in Arc::{strong,weak}_count docs. --- src/liballoc/arc.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index d6096d5894772..ca78142bc1d2a 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -319,11 +319,14 @@ impl Arc { /// Gets the number of [`Weak`][weak] pointers to this value. /// - /// Be careful how you use this information, because another thread - /// may change the weak count at any time. - /// /// [weak]: struct.Weak.html /// + /// # Safety + /// + /// This method by itself is safe, but using it correctly requires extra care. + /// Another thread can change the weak count at any time, + /// including potentially between calling this method and acting on the result. + /// /// # Examples /// /// ``` @@ -347,8 +350,11 @@ impl Arc { /// Gets the number of strong (`Arc`) pointers to this value. /// - /// Be careful how you use this information, because another thread - /// may change the strong count at any time. + /// # Safety + /// + /// This method by itself is safe, but using it correctly requires extra care. + /// Another thread can change the strong count at any time, + /// including potentially between calling this method and acting on the result. /// /// # Examples ///