about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-09-01 15:48:21 +0000
committerbors <bors@rust-lang.org>2018-09-01 15:48:21 +0000
commit839d99c861dbabfd4fa97b66ede9a97b8255d179 (patch)
tree1e26f4d288d82bde6f02a4f805ff1229063b0ad1 /src/liballoc
parentfea32f1b775b3f37fc4abfa6391c1bebe48af9d1 (diff)
parentd0f8cf32b3c0a17037445f7544f5067bdd838f7b (diff)
downloadrust-839d99c861dbabfd4fa97b66ede9a97b8255d179.tar.gz
rust-839d99c861dbabfd4fa97b66ede9a97b8255d179.zip
Auto merge of #53884 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

Successful merges:

 - #53076 (set cfg(rustdoc) when rustdoc is running on a crate)
 - #53622 (cleanup: Add main functions to some UI tests)
 - #53769 (Also link Clippy repo in the CONTRIBUTING.md file)
 - #53774 (Add rust-gdbgui script.)
 - #53781 (bench: libcore: fix build failure of any.rs benchmark (use "dyn Any"))
 - #53782 (Make Arc cloning mechanics clearer in module docs)
 - #53790 (Add regression test for issue #52060)
 - #53801 (Prevent duplicated impl on foreign types)
 - #53850 (Nuke the `const_to_allocation` query)
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/sync.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs
index 2cd7898f4c7..db7a4044b26 100644
--- a/src/liballoc/sync.rs
+++ b/src/liballoc/sync.rs
@@ -49,9 +49,10 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
 ///
 /// The type `Arc<T>` provides shared ownership of a value of type `T`,
 /// allocated in the heap. Invoking [`clone`][clone] on `Arc` produces
-/// a new pointer to the same value in the heap. When the last `Arc`
-/// pointer to a given value is destroyed, the pointed-to value is
-/// also destroyed.
+/// a new `Arc` instance, which points to the same value on the heap as the
+/// source `Arc`, while increasing a reference count. When the last `Arc`
+/// pointer to a given value is destroyed, the pointed-to value is also
+/// destroyed.
 ///
 /// Shared references in Rust disallow mutation by default, and `Arc` is no
 /// exception: you cannot generally obtain a mutable reference to something
@@ -107,7 +108,7 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
 /// // The two syntaxes below are equivalent.
 /// let a = foo.clone();
 /// let b = Arc::clone(&foo);
-/// // a and b both point to the same memory location as foo.
+/// // a, b, and foo are all Arcs that point to the same memory location
 /// ```
 ///
 /// The [`Arc::clone(&from)`] syntax is the most idiomatic because it conveys more explicitly