diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-08-30 10:39:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-30 10:39:05 +0200 |
| commit | f60cb177aa147acebb9cd2fd97a661021b736490 (patch) | |
| tree | e4dc89fd263fe3b41316030058c4678cd37d24d1 /src/liballoc/arc.rs | |
| parent | addb7537620feb228d6c9fe149b9c069d3686199 (diff) | |
| parent | a068fc70ab38adea73f84a8f8c6f826454ce563b (diff) | |
| download | rust-f60cb177aa147acebb9cd2fd97a661021b736490.tar.gz rust-f60cb177aa147acebb9cd2fd97a661021b736490.zip | |
Rollup merge of #35418 - birkenfeld:patch-1, r=aturon
Doc: explain why Box/Rc/Arc methods do not take self This can be confusing for newcomers, especially due to the argument name `this` that is used for Rc and Arc.
Diffstat (limited to 'src/liballoc/arc.rs')
| -rw-r--r-- | src/liballoc/arc.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 9c9f1e7b9de..b54b71cabd1 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -71,6 +71,12 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize; /// does not use atomics, making it both thread-unsafe as well as significantly /// faster when updating the reference count. /// +/// Note: the inherent methods defined on `Arc<T>` are all associated functions, +/// which means that you have to call them as e.g. `Arc::get_mut(&value)` +/// instead of `value.get_mut()`. This is so that there are no conflicts with +/// methods on the inner type `T`, which are what you want to call in the +/// majority of cases. +/// /// # Examples /// /// In this example, a large vector of data will be shared by several threads. First we |
