We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 864eae7 + dab3a58 commit 56986beCopy full SHA for 56986be
src/liballoc/sync.rs
@@ -835,12 +835,14 @@ impl<T: ?Sized> Arc<T> {
835
///
836
/// unsafe {
837
/// let ptr = Arc::into_raw(five);
838
- /// Arc::decr_strong_count(ptr);
+ /// Arc::incr_strong_count(ptr);
839
840
- /// // This assertion is deterministic because we haven't shared
+ /// // Those assertions are deterministic because we haven't shared
841
/// // the `Arc` between threads.
842
/// let five = Arc::from_raw(ptr);
843
- /// assert_eq!(0, Arc::strong_count(&five));
+ /// assert_eq!(2, Arc::strong_count(&five));
844
+ /// Arc::decr_strong_count(ptr);
845
+ /// assert_eq!(1, Arc::strong_count(&five));
846
/// }
847
/// ```
848
#[inline]
0 commit comments