Skip to content

Commit 25b1f1c

Browse files
authored
Rollup merge of rust-lang#103707 - jonathanCogan:master, r=m-ou-se
Replace libstd, libcore, liballoc terminology in docs Fixes rust-lang#103551. I changed line comments containing the outdated terms as well. It would be great if someone with more experience could weigh in on whether these changes introduce ambiguity as suggested in rust-lang#103551 (comment).
2 parents 80e309f + 78691e3 commit 25b1f1c

File tree

40 files changed

+84
-85
lines changed

40 files changed

+84
-85
lines changed

library/alloc/src/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "Rust" {
2323
// These are the magic symbols to call the global allocator. rustc generates
2424
// them to call `__rg_alloc` etc. if there is a `#[global_allocator]` attribute
2525
// (the code expanding that attribute macro generates those functions), or to call
26-
// the default implementations in libstd (`__rdl_alloc` etc. in `library/std/src/alloc.rs`)
26+
// the default implementations in std (`__rdl_alloc` etc. in `library/std/src/alloc.rs`)
2727
// otherwise.
2828
// The rustc fork of LLVM 14 and earlier also special-cases these function names to be able to optimize them
2929
// like `malloc`, `realloc`, and `free`, respectively.

library/alloc/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! This library provides smart pointers and collections for managing
44
//! heap-allocated values.
55
//!
6-
//! This library, like libcore, normally doesn’t need to be used directly
6+
//! This library, like core, normally doesn’t need to be used directly
77
//! since its contents are re-exported in the [`std` crate](../std/index.html).
88
//! Crates that use the `#![no_std]` attribute however will typically
99
//! not depend on `std`, so they’d use this crate instead.
@@ -75,7 +75,7 @@
7575
))]
7676
#![no_std]
7777
#![needs_allocator]
78-
// To run liballoc tests without x.py without ending up with two copies of liballoc, Miri needs to be
78+
// To run alloc tests without x.py without ending up with two copies of alloc, Miri needs to be
7979
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
8080
// rustc itself never sets the feature, so this line has no affect there.
8181
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]

library/alloc/src/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ impl [u8] {
653653
///
654654
/// ```error
655655
/// error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predica
656-
/// --> src/liballoc/slice.rs:608:6
656+
/// --> library/alloc/src/slice.rs:608:6
657657
/// |
658658
/// 608 | impl<T: Clone, V: Borrow<[T]>> Concat for [V] {
659659
/// | ^ unconstrained type parameter

library/alloc/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2678,7 +2678,7 @@ impl From<&String> for String {
26782678
}
26792679
}
26802680

2681-
// note: test pulls in libstd, which causes errors here
2681+
// note: test pulls in std, which causes errors here
26822682
#[cfg(not(test))]
26832683
#[stable(feature = "string_from_box", since = "1.18.0")]
26842684
impl From<Box<str>> for String {

library/alloc/src/vec/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,7 +3191,7 @@ where
31913191
}
31923192
}
31933193

3194-
// note: test pulls in libstd, which causes errors here
3194+
// note: test pulls in std, which causes errors here
31953195
#[cfg(not(test))]
31963196
#[stable(feature = "vec_from_box", since = "1.18.0")]
31973197
impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> {
@@ -3209,7 +3209,7 @@ impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> {
32093209
}
32103210
}
32113211

3212-
// note: test pulls in libstd, which causes errors here
3212+
// note: test pulls in std, which causes errors here
32133213
#[cfg(not(no_global_oom_handling))]
32143214
#[cfg(not(test))]
32153215
#[stable(feature = "box_from_vec", since = "1.20.0")]

library/alloc/tests/autotraits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn test_btree_map() {
3232
// spawn(f());
3333
// }
3434
//
35-
// where with some unintentionally overconstrained Send impls in liballoc's
35+
// where with some unintentionally overconstrained Send impls in alloc's
3636
// internals, the future might incorrectly not be Send even though every
3737
// single type involved in the program is Send and Sync.
3838
require_send_sync(async {

library/core/src/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,7 +1994,7 @@ impl<T: ?Sized> UnsafeCell<T> {
19941994
#[rustc_const_stable(feature = "const_unsafecell_get", since = "1.32.0")]
19951995
pub const fn get(&self) -> *mut T {
19961996
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
1997-
// #[repr(transparent)]. This exploits libstd's special status, there is
1997+
// #[repr(transparent)]. This exploits std's special status, there is
19981998
// no guarantee for user code that this will work in future versions of the compiler!
19991999
self as *const UnsafeCell<T> as *const T as *mut T
20002000
}
@@ -2052,7 +2052,7 @@ impl<T: ?Sized> UnsafeCell<T> {
20522052
#[rustc_const_stable(feature = "unsafe_cell_raw_get", since = "1.56.0")]
20532053
pub const fn raw_get(this: *const Self) -> *mut T {
20542054
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
2055-
// #[repr(transparent)]. This exploits libstd's special status, there is
2055+
// #[repr(transparent)]. This exploits std's special status, there is
20562056
// no guarantee for user code that this will work in future versions of the compiler!
20572057
this as *const T as *mut T
20582058
}

library/core/src/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ impl Display for Arguments<'_> {
558558
///
559559
/// Derived `Debug` formats are not stable, and so may change with future Rust
560560
/// versions. Additionally, `Debug` implementations of types provided by the
561-
/// standard library (`libstd`, `libcore`, `liballoc`, etc.) are not stable, and
561+
/// standard library (`std`, `core`, `alloc`, etc.) are not stable, and
562562
/// may also change with future Rust versions.
563563
///
564564
/// # Examples

library/core/src/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@
3838
//! which do not trigger a panic can be assured that this function is never
3939
//! called. The `lang` attribute is called `eh_personality`.
4040
41-
// Since libcore defines many fundamental lang items, all tests live in a
42-
// separate crate, libcoretest, to avoid bizarre issues.
41+
// Since core defines many fundamental lang items, all tests live in a
42+
// separate crate, libcoretest (library/core/tests), to avoid bizarre issues.
4343
//
4444
// Here we explicitly #[cfg]-out this whole crate when testing. If we don't do
4545
// this, both the generated test artifact and the linked libtest (which
46-
// transitively includes libcore) will both define the same set of lang items,
46+
// transitively includes core) will both define the same set of lang items,
4747
// and this will cause the E0152 "found duplicate lang item" error. See
4848
// discussion in #50466 for details.
4949
//
5050
// This cfg won't affect doc tests.
5151
#![cfg(not(test))]
52-
// To run libcore tests without x.py without ending up with two copies of libcore, Miri needs to be
52+
// To run core tests without x.py without ending up with two copies of core, Miri needs to be
5353
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
5454
// rustc itself never sets the feature, so this line has no affect there.
5555
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
@@ -311,7 +311,7 @@ pub mod f64;
311311
#[macro_use]
312312
pub mod num;
313313

314-
/* The libcore prelude, not as all-encompassing as the libstd prelude */
314+
/* The core prelude, not as all-encompassing as the std prelude */
315315

316316
pub mod prelude;
317317

@@ -378,12 +378,12 @@ mod const_closure;
378378
#[stable(feature = "core_primitive", since = "1.43.0")]
379379
pub mod primitive;
380380

381-
// Pull in the `core_arch` crate directly into libcore. The contents of
381+
// Pull in the `core_arch` crate directly into core. The contents of
382382
// `core_arch` are in a different repository: rust-lang/stdarch.
383383
//
384-
// `core_arch` depends on libcore, but the contents of this module are
384+
// `core_arch` depends on core, but the contents of this module are
385385
// set up in such a way that directly pulling it here works such that the
386-
// crate uses the this crate as its libcore.
386+
// crate uses the this crate as its core.
387387
#[path = "../../stdarch/crates/core_arch/src/mod.rs"]
388388
#[allow(
389389
missing_docs,
@@ -402,12 +402,12 @@ mod core_arch;
402402
#[stable(feature = "simd_arch", since = "1.27.0")]
403403
pub mod arch;
404404

405-
// Pull in the `core_simd` crate directly into libcore. The contents of
405+
// Pull in the `core_simd` crate directly into core. The contents of
406406
// `core_simd` are in a different repository: rust-lang/portable-simd.
407407
//
408-
// `core_simd` depends on libcore, but the contents of this module are
408+
// `core_simd` depends on core, but the contents of this module are
409409
// set up in such a way that directly pulling it here works such that the
410-
// crate uses this crate as its libcore.
410+
// crate uses this crate as its core.
411411
#[path = "../../portable-simd/crates/core_simd/src/mod.rs"]
412412
#[allow(missing_debug_implementations, dead_code, unsafe_op_in_unsafe_fn, unused_unsafe)]
413413
#[allow(rustdoc::bare_urls)]

library/core/src/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ impl f32 {
428428
self != self
429429
}
430430

431-
// FIXME(#50145): `abs` is publicly unavailable in libcore due to
431+
// FIXME(#50145): `abs` is publicly unavailable in core due to
432432
// concerns about portability, so this implementation is for
433433
// private use internally.
434434
#[inline]

0 commit comments

Comments
 (0)