diff options
| author | bors <bors@rust-lang.org> | 2017-06-12 04:08:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-06-12 04:08:14 +0000 |
| commit | 54eeef14a380ca026dc378e6927655fb08f64736 (patch) | |
| tree | 5a84cde6c14c489614177bc9fd48fe4ed7fb7511 /src/liballoc | |
| parent | 29ef41215c2ffe3105ea8cc1621dda00542f65ee (diff) | |
| parent | 1af0cb165065ebca5296a7b5841ebec9bfb40476 (diff) | |
| download | rust-54eeef14a380ca026dc378e6927655fb08f64736.tar.gz rust-54eeef14a380ca026dc378e6927655fb08f64736.zip | |
Auto merge of #42419 - ucarion:ucarion-explain-rc-arc-abbrev, r=frewsxcv
Explicate what "Rc" and "Arc" stand for. A person on the weekly "Easy Questions" Reddit thread [was mystified by what `Arc`/`Rc` means](https://www.reddit.com/r/rust/comments/6dyud9/hey_rustaceans_got_an_easy_question_ask_here/did87ds/). Though this is explained in various places, it's not mentioned in the documentation directly. This PR adds an explanation of the `Rc`/`Arc` acronyms to their respective documentations. There are two things I'm not sure of: * Does "Rc" mean "Reference Count**er**" or "Reference Count**ed**"? ~~I went with the former.~~ *Edit:* I've changed this to use the latter alternative. * Should this information be spelled out elsewhere, such as in the docs for the `rc` module?
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 3 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 5faf4dcccaf..5ed41f6ffe6 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -42,7 +42,8 @@ use heap::deallocate; /// necessarily) at _exactly_ `MAX_REFCOUNT + 1` references. const MAX_REFCOUNT: usize = (isize::MAX) as usize; -/// A thread-safe reference-counting pointer. +/// A thread-safe reference-counting pointer. 'Arc' stands for 'Atomically +/// Reference Counted'. /// /// The type `Arc<T>` provides shared ownership of a value of type `T`, /// allocated in the heap. Invoking [`clone`][clone] on `Arc` produces diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 33951b911dd..1f3388ad2c2 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -10,7 +10,8 @@ #![allow(deprecated)] -//! Single-threaded reference-counting pointers. +//! Single-threaded reference-counting pointers. 'Rc' stands for 'Reference +//! Counted'. //! //! The type [`Rc<T>`][`Rc`] provides shared ownership of a value of type `T`, //! allocated in the heap. Invoking [`clone`][clone] on [`Rc`] produces a new @@ -266,7 +267,8 @@ struct RcBox<T: ?Sized> { value: T, } -/// A single-threaded reference-counting pointer. +/// A single-threaded reference-counting pointer. 'Rc' stands for 'Reference +/// Counted'. /// /// See the [module-level documentation](./index.html) for more details. /// |
