Skip to content

Commit

Permalink
Rollup merge of #72183 - tmiasko:decr-strong-count, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Fix Arc::decr_strong_count doc test
  • Loading branch information
RalfJung authored May 14, 2020
2 parents 864eae7 + dab3a58 commit 56986be
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/liballoc/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,12 +835,14 @@ impl<T: ?Sized> Arc<T> {
///
/// unsafe {
/// let ptr = Arc::into_raw(five);
/// Arc::decr_strong_count(ptr);
/// Arc::incr_strong_count(ptr);
///
/// // This assertion is deterministic because we haven't shared
/// // Those assertions are deterministic because we haven't shared
/// // the `Arc` between threads.
/// let five = Arc::from_raw(ptr);
/// assert_eq!(0, Arc::strong_count(&five));
/// assert_eq!(2, Arc::strong_count(&five));
/// Arc::decr_strong_count(ptr);
/// assert_eq!(1, Arc::strong_count(&five));
/// }
/// ```
#[inline]
Expand Down

0 comments on commit 56986be

Please sign in to comment.