Skip to content

Commit 9357153

Browse files
committed
More proeminent warning in Arc::{strong,weak}_count docs.
1 parent 38a959a commit 9357153

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/liballoc/arc.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,14 @@ impl<T: ?Sized> Arc<T> {
319319

320320
/// Gets the number of [`Weak`][weak] pointers to this value.
321321
///
322-
/// Be careful how you use this information, because another thread
323-
/// may change the weak count at any time.
324-
///
325322
/// [weak]: struct.Weak.html
326323
///
324+
/// # Safety
325+
///
326+
/// This method by itself is safe, but using it correctly requires extra care.
327+
/// Another thread can change the weak count at any time,
328+
/// including potentially between calling this method and acting on the result.
329+
///
327330
/// # Examples
328331
///
329332
/// ```
@@ -347,8 +350,11 @@ impl<T: ?Sized> Arc<T> {
347350

348351
/// Gets the number of strong (`Arc`) pointers to this value.
349352
///
350-
/// Be careful how you use this information, because another thread
351-
/// may change the strong count at any time.
353+
/// # Safety
354+
///
355+
/// This method by itself is safe, but using it correctly requires extra care.
356+
/// Another thread can change the strong count at any time,
357+
/// including potentially between calling this method and acting on the result.
352358
///
353359
/// # Examples
354360
///

0 commit comments

Comments
 (0)