Skip to content

Commit 56986be

Browse files
authored
Rollup merge of #72183 - tmiasko:decr-strong-count, r=Mark-Simulacrum
Fix Arc::decr_strong_count doc test
2 parents 864eae7 + dab3a58 commit 56986be

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/liballoc/sync.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -835,12 +835,14 @@ impl<T: ?Sized> Arc<T> {
835835
///
836836
/// unsafe {
837837
/// let ptr = Arc::into_raw(five);
838-
/// Arc::decr_strong_count(ptr);
838+
/// Arc::incr_strong_count(ptr);
839839
///
840-
/// // This assertion is deterministic because we haven't shared
840+
/// // Those assertions are deterministic because we haven't shared
841841
/// // the `Arc` between threads.
842842
/// let five = Arc::from_raw(ptr);
843-
/// assert_eq!(0, Arc::strong_count(&five));
843+
/// assert_eq!(2, Arc::strong_count(&five));
844+
/// Arc::decr_strong_count(ptr);
845+
/// assert_eq!(1, Arc::strong_count(&five));
844846
/// }
845847
/// ```
846848
#[inline]

0 commit comments

Comments
 (0)