Skip to content

Commit

Permalink
rollup merge of rust-lang#23743: Adenilson/addInfoArcClone01
Browse files Browse the repository at this point in the history
Adding more information about the behavior of Arc/Rc when you perform a clone() call.
  • Loading branch information
alexcrichton committed Mar 27, 2015
2 parents d2fac62 + 7d3bf47 commit df49ea6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down

0 comments on commit df49ea6

Please sign in to comment.