about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-01-05 09:52:33 +0900
committerGitHub <noreply@github.com>2021-01-05 09:52:33 +0900
commitbdf8bbde1db65b2800b4c688c16ae6d029b3ffc8 (patch)
treed04cd93c08e3906e520f5e6b8436fcc1f3ec1aff
parent61f5a0092364061ec5649ca98d5e3e9b927880fe (diff)
parent303203f992088d05d930b2d7e4bb826c2b611a53 (diff)
downloadrust-bdf8bbde1db65b2800b4c688c16ae6d029b3ffc8.tar.gz
rust-bdf8bbde1db65b2800b4c688c16ae6d029b3ffc8.zip
Rollup merge of #80442 - steffahn:mention_arc_in_cow, r=Mark-Simulacrum
Mention Arc::make_mut and Rc::make_mut in the documentation of Cow

Following this discussion: https://users.rust-lang.org/t/should-the-cow-documentation-mention-arc/53341

_Rendered (the last paragraph is new):_

![Screenshot_20201228_171551](https://user-images.githubusercontent.com/3986214/103228135-5d72e200-4930-11eb-89e1-38b5c86b08c7.png)

`@rustbot` modify labels: T-doc, T-libs
-rw-r--r--library/alloc/src/borrow.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/alloc/src/borrow.rs b/library/alloc/src/borrow.rs
index f801c1ac75b..adf996fc782 100644
--- a/library/alloc/src/borrow.rs
+++ b/library/alloc/src/borrow.rs
@@ -103,6 +103,11 @@ where
 /// is desired, `to_mut` will obtain a mutable reference to an owned
 /// value, cloning if necessary.
 ///
+/// If you need reference-counting pointers, note that
+/// [`Rc::make_mut`][crate::rc::Rc::make_mut] and
+/// [`Arc::make_mut`][crate::sync::Arc::make_mut] can provide clone-on-write
+/// functionality as well.
+///
 /// # Examples
 ///
 /// ```