Skip to content

Commit 4d5204c

Browse files
Rollup merge of rust-lang#88226 - steffahn:an_rc, r=michaelwoerister
Fix typo “a Rc” → “an Rc” (and a few more) After stumbling about it in the dev-guide, I’ve devided to eliminate all mentions of “a Rc”, replacing it with “an Rc”. E.g. ```plain $ rg "(^|[^'])\ba\b[^\w=:]*\bRc" compiler/rustc_data_structures/src/owning_ref/mod.rs 1149:/// Typedef of a owning reference that uses a `Rc` as the owner. library/std/src/ffi/os_str.rs 919: /// Converts a [`OsString`] into a [`Rc`]`<OsStr>` without copying or allocating. library/std/src/ffi/c_str.rs 961: /// Converts a [`CString`] into a [`Rc`]`<CStr>` without copying or allocating. src/doc/rustc-dev-guide/src/query.md 61:are cheaply cloneable; insert a `Rc` if necessary). src/doc/book/src/ch15-06-reference-cycles.md 72:decreases the reference count of the `a` `Rc<List>` instance from 2 to 1 as library/alloc/src/rc.rs 1746: /// Converts a generic type `T` into a `Rc<T>` ``` _(the match in the book is a false positive)_ Since the dev-guide is a submodule, it’s getting a separate PR: rust-lang/rustc-dev-guide#1191 I’ve also gone ahead and done the same search for `RwLock` and hit a few cases in the `OwningRef` adaption. Then, I couldn’t keep the countless cases of “a owning …” or “a owner” unaddressed, which concludes this PR. `@rustbot` label C-cleanup
2 parents c03ce91 + 870843d commit 4d5204c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

alloc/src/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ impl<T: ?Sized> fmt::Pointer for Rc<T> {
17451745
#[cfg(not(no_global_oom_handling))]
17461746
#[stable(feature = "from_for_ptrs", since = "1.6.0")]
17471747
impl<T> From<T> for Rc<T> {
1748-
/// Converts a generic type `T` into a `Rc<T>`
1748+
/// Converts a generic type `T` into an `Rc<T>`
17491749
///
17501750
/// The conversion allocates on the heap and moves `t`
17511751
/// from the stack into it.

std/src/ffi/c_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ impl From<&CStr> for Arc<CStr> {
958958

959959
#[stable(feature = "shared_from_slice2", since = "1.24.0")]
960960
impl From<CString> for Rc<CStr> {
961-
/// Converts a [`CString`] into a [`Rc`]`<CStr>` without copying or allocating.
961+
/// Converts a [`CString`] into an [`Rc`]`<CStr>` without copying or allocating.
962962
#[inline]
963963
fn from(s: CString) -> Rc<CStr> {
964964
let rc: Rc<[u8]> = Rc::from(s.into_inner());

std/src/ffi/os_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ impl From<&OsStr> for Arc<OsStr> {
916916

917917
#[stable(feature = "shared_from_slice2", since = "1.24.0")]
918918
impl From<OsString> for Rc<OsStr> {
919-
/// Converts an [`OsString`] into a [`Rc`]`<OsStr>` without copying or allocating.
919+
/// Converts an [`OsString`] into an [`Rc`]`<OsStr>` without copying or allocating.
920920
#[inline]
921921
fn from(s: OsString) -> Rc<OsStr> {
922922
let rc = s.inner.into_rc();

0 commit comments

Comments
 (0)