diff options
| author | steveklabnik <steve@steveklabnik.com> | 2017-10-05 16:54:56 -0400 |
|---|---|---|
| committer | steveklabnik <steve@steveklabnik.com> | 2017-10-05 16:54:56 -0400 |
| commit | 5e251b74eb200ba6d3b8ddaa68ef682c78be26e2 (patch) | |
| tree | 6573e4a8c309a0251aa7c1b9002d4ab41ea4dc68 /src/liballoc/arc.rs | |
| parent | 4531131bf328e1372663310bfd45cd354db511ce (diff) | |
| download | rust-5e251b74eb200ba6d3b8ddaa68ef682c78be26e2.tar.gz rust-5e251b74eb200ba6d3b8ddaa68ef682c78be26e2.zip | |
Modify Rc/Arc language around mutability
There are a few exceptions to the rule that Arc/Rc are immutable. Rather than dig into the details, add "generally" to hint at this difference, as it's kind of a distraction at this point in the docs. Additionally, Arc's docs were slightly different here generally, so add in both the existing language and the exception. Fixes #44105
Diffstat (limited to 'src/liballoc/arc.rs')
| -rw-r--r-- | src/liballoc/arc.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 3b7dbd813cf..9481cd4e1a4 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -52,8 +52,10 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize; /// also destroyed. /// /// Shared references in Rust disallow mutation by default, and `Arc` is no -/// exception. If you need to mutate through an `Arc`, use [`Mutex`][mutex], -/// [`RwLock`][rwlock], or one of the [`Atomic`][atomic] types. +/// exception: you cannot generally obtain a mutable reference to something +/// inside an `Arc`. If you need to mutate through an `Arc`, use +/// [`Mutex`][mutex], [`RwLock`][rwlock], or one of the [`Atomic`][atomic] +/// types. /// /// ## Thread Safety /// |
