diff options
| author | Adenilson Cavalcanti <cavalcantii@gmail.com> | 2015-03-26 12:05:21 -0700 |
|---|---|---|
| committer | Adenilson Cavalcanti <cavalcantii@gmail.com> | 2015-03-26 12:05:21 -0700 |
| commit | 7d3bf47323694183b573d3e8b70b9a5fe973b587 (patch) | |
| tree | 6f5b8f0dcb3a989ef63b43dbc665541736349dfd /src/liballoc | |
| parent | 557d4346a26266d2eb13f6b0adf106b8873b0da1 (diff) | |
| download | rust-7d3bf47323694183b573d3e8b70b9a5fe973b587.tar.gz rust-7d3bf47323694183b573d3e8b70b9a5fe973b587.zip | |
Adding more information about the behavior of Arc/Rc
when you perform a clone() call.
Diffstat (limited to 'src/liballoc')
| -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 b5d16d29272..b012612af59 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 eb3c5c16726..085042ce5a7 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 /// |
