Skip to content

Commit df49ea6

Browse files
committed
rollup merge of #23743: Adenilson/addInfoArcClone01
Adding more information about the behavior of Arc/Rc when you perform a clone() call.
2 parents d2fac62 + 7d3bf47 commit df49ea6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/liballoc/arc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ use heap::deallocate;
9494
/// With simple pipes, without `Arc`, a copy would have to be made for each
9595
/// task.
9696
///
97+
/// When you clone an `Arc<T>`, it will create another pointer to the data and
98+
/// increase the reference counter.
99+
///
97100
/// ```
98101
/// # #![feature(alloc, core)]
99102
/// use std::sync::Arc;

src/liballoc/rc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ impl<T> Clone for Rc<T> {
431431

432432
/// Makes a clone of the `Rc<T>`.
433433
///
434-
/// This increases the strong reference count.
434+
/// When you clone an `Rc<T>`, it will create another pointer to the data and
435+
/// increase the strong reference counter.
435436
///
436437
/// # Examples
437438
///

0 commit comments

Comments
 (0)