diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-27 10:07:47 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-27 10:07:47 -0700 |
| commit | df49ea6a837ddf72e61b46bed5ea9d61fa3b78ff (patch) | |
| tree | b7b0daaafceeb4d6a78c3a01ff002f92ec94ccbf /src | |
| parent | d2fac629e491d1e31306611a57a0e447d6ca74fd (diff) | |
| parent | 7d3bf47323694183b573d3e8b70b9a5fe973b587 (diff) | |
| download | rust-df49ea6a837ddf72e61b46bed5ea9d61fa3b78ff.tar.gz rust-df49ea6a837ddf72e61b46bed5ea9d61fa3b78ff.zip | |
rollup merge of #23743: Adenilson/addInfoArcClone01
Adding more information about the behavior of Arc/Rc when you perform a clone() call.
Diffstat (limited to 'src')
| -rw-r--r-- | src/liballoc/arc.rs | 3 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index e107d19a87c..f3b72e4a9ee 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -94,6 +94,9 @@ use heap::deallocate; /// With simple pipes, without `Arc`, a copy would have to be made for each /// task. /// +/// When you clone an `Arc<T>`, it will create another pointer to the data and +/// increase the reference counter. +/// /// ``` /// # #![feature(alloc, core)] /// use std::sync::Arc; diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index e0d7e32ecf5..7cdd4888426 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -431,7 +431,8 @@ impl<T> Clone for Rc<T> { /// Makes a clone of the `Rc<T>`. /// - /// This increases the strong reference count. + /// When you clone an `Rc<T>`, it will create another pointer to the data and + /// increase the strong reference counter. /// /// # Examples /// |
