about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2016-11-08 16:20:58 -0500
committerGitHub <noreply@github.com>2016-11-08 16:20:58 -0500
commit5c92c2c6a9450d087b0977b89318688fe1bbd2a0 (patch)
tree2b984537f739bdf21e942758789edda115279e43 /src
parent48c4d1740e621ed7727424de5f00f22dda5d78fe (diff)
parent93571537e3ba1e5d9e9c32151af0287299409246 (diff)
Rollup merge of #37652 - SimonSapin:arc-count-doc, r=alexcrichton
More proeminent warning in Arc::{strong,weak}_count docs.

CC https://github.com/rust-lang/rust/issues/28356#issuecomment-259212258
Diffstat (limited to 'src')
-rw-r--r--src/liballoc/arc.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index d6096d58947..ca78142bc1d 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -319,11 +319,14 @@ impl<T: ?Sized> Arc<T> {
 
     /// 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<T: ?Sized> Arc<T> {
 
     /// 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
     ///