about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-05-14 12:28:23 +0000
committerbors <bors@rust-lang.org>2020-05-14 12:28:23 +0000
commitaf6d8865fe0e1f6338c32cb3370802f2ebca0dc4 (patch)
tree2fd89879edd8b151150a11ebfca69825885616d6 /src/liballoc
parent7c34d8d6629506a596215886e5fc4bb2b04b00ae (diff)
parent56986bebc23788146dc46606d5af39b6354d6ad3 (diff)
downloadrust-af6d8865fe0e1f6338c32cb3370802f2ebca0dc4.tar.gz
rust-af6d8865fe0e1f6338c32cb3370802f2ebca0dc4.zip
Auto merge of #72187 - RalfJung:rollup-a7a9jdi, r=RalfJung
Rollup of 12 pull requests

Successful merges:

 - #71525 (`prefix` should not be mutable.)
 - #71741 (Pointer printing: do not print 0 offset)
 - #71870 (Be slightly more precise about any::type_name()'s guarantees.)
 - #71909 (Document From trait for Option implementations)
 - #71964 (Fix bootstrap failing on win32)
 - #72137 (Clean up E0581 explanation)
 - #72138 (Add doc comment for `rustc_middle::mir::mono::Linkage`)
 - #72150 (Remove UnnormalizedProjection)
 - #72151 (Update books)
 - #72163 (docs: remove comment referencing non-existent method)
 - #72169 (Clean up E0582 explanation)
 - #72183 (Fix Arc::decr_strong_count doc test)

Failed merges:

r? @ghost
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/sync.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs
index 19d289c87fd..dbee9d27d8a 100644
--- a/src/liballoc/sync.rs
+++ b/src/liballoc/sync.rs
@@ -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]