Skip to content

Commit 54eeef1

Browse files
committed
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?
2 parents 29ef412 + 1af0cb1 commit 54eeef1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/liballoc/arc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ use heap::deallocate;
4242
/// necessarily) at _exactly_ `MAX_REFCOUNT + 1` references.
4343
const MAX_REFCOUNT: usize = (isize::MAX) as usize;
4444

45-
/// A thread-safe reference-counting pointer.
45+
/// A thread-safe reference-counting pointer. 'Arc' stands for 'Atomically
46+
/// Reference Counted'.
4647
///
4748
/// The type `Arc<T>` provides shared ownership of a value of type `T`,
4849
/// allocated in the heap. Invoking [`clone`][clone] on `Arc` produces

src/liballoc/rc.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
#![allow(deprecated)]
1212

13-
//! Single-threaded reference-counting pointers.
13+
//! Single-threaded reference-counting pointers. 'Rc' stands for 'Reference
14+
//! Counted'.
1415
//!
1516
//! The type [`Rc<T>`][`Rc`] provides shared ownership of a value of type `T`,
1617
//! allocated in the heap. Invoking [`clone`][clone] on [`Rc`] produces a new
@@ -266,7 +267,8 @@ struct RcBox<T: ?Sized> {
266267
value: T,
267268
}
268269

269-
/// A single-threaded reference-counting pointer.
270+
/// A single-threaded reference-counting pointer. 'Rc' stands for 'Reference
271+
/// Counted'.
270272
///
271273
/// See the [module-level documentation](./index.html) for more details.
272274
///

0 commit comments

Comments
 (0)