about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorOtto Rask <ojrask@gmail.com>2018-08-30 12:20:41 +0300
committerOtto Rask <ojrask@gmail.com>2018-08-30 12:20:41 +0300
commit60202199936365e7b2adc70189fbaa664ce729a6 (patch)
treeae25a721ad58d1b6c333c341195d5515ee8ee03c /src/liballoc
parent5399616f1d98b4bcc1da87af15f75c95e3c2288b (diff)
downloadrust-60202199936365e7b2adc70189fbaa664ce729a6.tar.gz
rust-60202199936365e7b2adc70189fbaa664ce729a6.zip
Rephrase Arc documentation changes regarding clones
Make it clearer that `Arc::clone()` in fact creates a whole new
Arc with the internal pointer pointing to the same location as
the source Arc.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/sync.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs
index 176743fdd1d..72a4740b156 100644
--- a/src/liballoc/sync.rs
+++ b/src/liballoc/sync.rs
@@ -49,8 +49,9 @@ 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 `Arc` reference value in the heap. When the last
-/// `Arc` pointer to a given value is destroyed, the pointed-to value is also
+/// 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
@@ -107,8 +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 where foo resides
-/// // (not where the value wrapped by foo resides).
+/// // a and b both point to the same memory location as foo
 /// ```
 ///
 /// The [`Arc::clone(&from)`] syntax is the most idiomatic because it conveys more explicitly