Skip to content

Commit bbdca4c

Browse files
committed
Auto merge of rust-lang#106296 - matthiaskrgr:rollup-ukdbqwx, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - rust-lang#99244 (doc: clearer and more correct Iterator::scan) - rust-lang#103707 (Replace libstd, libcore, liballoc terminology in docs) - rust-lang#104182 (`IN6ADDR_ANY_INIT` and `IN6ADDR_LOOPBACK_INIT` documentation.) - rust-lang#106273 (rustdoc: remove redundant CSS `.source .content { overflow: visible }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7c99186 + 3f9909a commit bbdca4c

File tree

43 files changed

+104
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+104
-95
lines changed

library/alloc/src/alloc.rs

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+2-2
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

+1-1
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/iter/traits/iterator.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -1381,8 +1381,8 @@ pub trait Iterator {
13811381
Take::new(self, n)
13821382
}
13831383

1384-
/// An iterator adapter similar to [`fold`] that holds internal state and
1385-
/// produces a new iterator.
1384+
/// An iterator adapter which, like [`fold`], holds internal state, but
1385+
/// unlike [`fold`], produces a new iterator.
13861386
///
13871387
/// [`fold`]: Iterator::fold
13881388
///
@@ -1394,20 +1394,25 @@ pub trait Iterator {
13941394
///
13951395
/// On iteration, the closure will be applied to each element of the
13961396
/// iterator and the return value from the closure, an [`Option`], is
1397-
/// yielded by the iterator.
1397+
/// returned by the `next` method. Thus the closure can return
1398+
/// `Some(value)` to yield `value`, or `None` to end the iteration.
13981399
///
13991400
/// # Examples
14001401
///
14011402
/// Basic usage:
14021403
///
14031404
/// ```
1404-
/// let a = [1, 2, 3];
1405+
/// let a = [1, 2, 3, 4];
14051406
///
14061407
/// let mut iter = a.iter().scan(1, |state, &x| {
1407-
/// // each iteration, we'll multiply the state by the element
1408+
/// // each iteration, we'll multiply the state by the element ...
14081409
/// *state = *state * x;
14091410
///
1410-
/// // then, we'll yield the negation of the state
1411+
/// // ... and terminate if the state exceeds 6
1412+
/// if *state > 6 {
1413+
/// return None;
1414+
/// }
1415+
/// // ... else yield the negation of the state
14111416
/// Some(-*state)
14121417
/// });
14131418
///

library/core/src/lib.rs

+11-11
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

+1-1
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]

library/core/src/num/f64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ impl f64 {
427427
self != self
428428
}
429429

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

library/core/src/panic.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ pub macro unreachable_2021 {
9090
),
9191
}
9292

93-
/// An internal trait used by libstd to pass data from libstd to `panic_unwind`
94-
/// and other panic runtimes. Not intended to be stabilized any time soon, do
95-
/// not use.
93+
/// An internal trait used by std to pass data from std to `panic_unwind` and
94+
/// other panic runtimes. Not intended to be stabilized any time soon, do not
95+
/// use.
9696
#[unstable(feature = "std_internals", issue = "none")]
9797
#[doc(hidden)]
9898
pub unsafe trait BoxMeUp {
9999
/// Take full ownership of the contents.
100-
/// The return type is actually `Box<dyn Any + Send>`, but we cannot use `Box` in libcore.
100+
/// The return type is actually `Box<dyn Any + Send>`, but we cannot use `Box` in core.
101101
///
102102
/// After this method got called, only some dummy default value is left in `self`.
103103
/// Calling this method twice, or calling `get` after calling this method, is an error.

library/core/src/panic/panic_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl fmt::Display for PanicInfo<'_> {
157157
write!(formatter, "'{}', ", payload)?
158158
}
159159
// NOTE: we cannot use downcast_ref::<String>() here
160-
// since String is not available in libcore!
160+
// since String is not available in core!
161161
// The payload is a String when `std::panic!` is called with multiple arguments,
162162
// but in that case the message is also available.
163163

library/core/src/panicking.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//! Panic support for libcore
1+
//! Panic support for core
22
//!
33
//! The core library cannot define panicking, but it does *declare* panicking. This
4-
//! means that the functions inside of libcore are allowed to panic, but to be
5-
//! useful an upstream crate must define panicking for libcore to use. The current
4+
//! means that the functions inside of core are allowed to panic, but to be
5+
//! useful an upstream crate must define panicking for core to use. The current
66
//! interface for panicking is:
77
//!
88
//! ```
@@ -13,7 +13,7 @@
1313
//! This definition allows for panicking with any general message, but it does not
1414
//! allow for failing with a `Box<Any>` value. (`PanicInfo` just contains a `&(dyn Any + Send)`,
1515
//! for which we fill in a dummy value in `PanicInfo::internal_constructor`.)
16-
//! The reason for this is that libcore is not allowed to allocate.
16+
//! The reason for this is that core is not allowed to allocate.
1717
//!
1818
//! This module contains a few other panicking functions, but these are just the
1919
//! necessary lang items for the compiler. All panics are funneled through this
@@ -94,7 +94,7 @@ pub fn panic_nounwind(msg: &'static str) -> ! {
9494
// Next we define a bunch of higher-level wrappers that all bottom out in the two core functions
9595
// above.
9696

97-
/// The underlying implementation of libcore's `panic!` macro when no formatting is used.
97+
/// The underlying implementation of core's `panic!` macro when no formatting is used.
9898
// never inline unless panic_immediate_abort to avoid code
9999
// bloat at the call sites as much as possible
100100
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]

library/core/src/prelude/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//! The libcore prelude
1+
//! The core prelude
22
//!
3-
//! This module is intended for users of libcore which do not link to libstd as
4-
//! well. This module is imported by default when `#![no_std]` is used in the
5-
//! same manner as the standard library's prelude.
3+
//! This module is intended for users of core which do not link to std as well.
4+
//! This module is imported by default when `#![no_std]` is used in the same
5+
//! manner as the standard library's prelude.
66
77
#![stable(feature = "core_prelude", since = "1.4.0")]
88

library/core/src/slice/sort.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! This module contains a sorting algorithm based on Orson Peters' pattern-defeating quicksort,
44
//! published at: <https://github.com/orlp/pdqsort>
55
//!
6-
//! Unstable sorting is compatible with libcore because it doesn't allocate memory, unlike our
6+
//! Unstable sorting is compatible with core because it doesn't allocate memory, unlike our
77
//! stable sorting implementation.
88
99
use crate::cmp;

library/core/src/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl str {
368368
#[inline(always)]
369369
pub unsafe fn as_bytes_mut(&mut self) -> &mut [u8] {
370370
// SAFETY: the cast from `&str` to `&[u8]` is safe since `str`
371-
// has the same layout as `&[u8]` (only libstd can make this guarantee).
371+
// has the same layout as `&[u8]` (only std can make this guarantee).
372372
// The pointer dereference is safe since it comes from a mutable reference which
373373
// is guaranteed to be valid for writes.
374374
unsafe { &mut *(self as *mut str as *mut [u8]) }

library/core/src/unicode/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod unicode_data;
1717
#[stable(feature = "unicode_version", since = "1.45.0")]
1818
pub const UNICODE_VERSION: (u8, u8, u8) = unicode_data::UNICODE_VERSION;
1919

20-
// For use in liballoc, not re-exported in libstd.
20+
// For use in alloc, not re-exported in std.
2121
pub use unicode_data::{
2222
case_ignorable::lookup as Case_Ignorable, cased::lookup as Cased, conversions,
2323
};

library/core/tests/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ fn ptr_metadata_bounds() {
807807
}
808808
// "Synthetic" trait impls generated by the compiler like those of `Pointee`
809809
// are not checked for bounds of associated type.
810-
// So with a buggy libcore we could have both:
810+
// So with a buggy core we could have both:
811811
// * `<dyn Display as Pointee>::Metadata == DynMetadata`
812812
// * `DynMetadata: !PartialEq`
813813
// … and cause an ICE here:

library/core/tests/str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// All `str` tests live in liballoc/tests
1+
// All `str` tests live in library/alloc/tests/str.rs

library/panic_abort/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub unsafe fn __rust_start_panic(_payload: *mut &mut dyn BoxMeUp) -> u32 {
6161
//
6262
// https://docs.microsoft.com/en-us/cpp/intrinsics/fastfail
6363
//
64-
// Note: this is the same implementation as in libstd's `abort_internal`
64+
// Note: this is the same implementation as in std's `abort_internal`
6565
unsafe fn abort() -> ! {
6666
#[allow(unused)]
6767
const FAST_FAIL_FATAL_APP_EXIT: usize = 7;
@@ -89,7 +89,7 @@ pub unsafe fn __rust_start_panic(_payload: *mut &mut dyn BoxMeUp) -> u32 {
8989
// This... is a bit of an oddity. The tl;dr; is that this is required to link
9090
// correctly, the longer explanation is below.
9191
//
92-
// Right now the binaries of libcore/libstd that we ship are all compiled with
92+
// Right now the binaries of core/std that we ship are all compiled with
9393
// `-C panic=unwind`. This is done to ensure that the binaries are maximally
9494
// compatible with as many situations as possible. The compiler, however,
9595
// requires a "personality function" for all functions compiled with `-C
@@ -109,7 +109,7 @@ pub unsafe fn __rust_start_panic(_payload: *mut &mut dyn BoxMeUp) -> u32 {
109109
// library just defines this symbol so there's at least some personality
110110
// somewhere.
111111
//
112-
// Essentially this symbol is just defined to get wired up to libcore/libstd
112+
// Essentially this symbol is just defined to get wired up to core/std
113113
// binaries, but it should never be called as we don't link in an unwinding
114114
// runtime at all.
115115
pub mod personalities {

library/panic_unwind/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ cfg_if::cfg_if! {
8282
}
8383

8484
extern "C" {
85-
/// Handler in libstd called when a panic object is dropped outside of
85+
/// Handler in std called when a panic object is dropped outside of
8686
/// `catch_unwind`.
8787
fn __rust_drop_panic() -> !;
8888

89-
/// Handler in libstd called when a foreign exception is caught.
89+
/// Handler in std called when a foreign exception is caught.
9090
fn __rust_foreign_exception() -> !;
9191
}
9292

library/proc_macro/src/bridge/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ impl<I, O> Clone for Client<I, O> {
356356

357357
fn maybe_install_panic_hook(force_show_panics: bool) {
358358
// Hide the default panic output within `proc_macro` expansions.
359-
// NB. the server can't do this because it may use a different libstd.
359+
// NB. the server can't do this because it may use a different std.
360360
static HIDE_PANICS_DURING_EXPANSION: Once = Once::new();
361361
HIDE_PANICS_DURING_EXPANSION.call_once(|| {
362362
let prev = panic::take_hook();

library/proc_macro/src/bridge/fxhash.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use std::ops::BitXor;
1515
/// Type alias for a hashmap using the `fx` hash algorithm.
1616
pub type FxHashMap<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher>>;
1717

18-
/// A speedy hash algorithm for use within rustc. The hashmap in liballoc
19-
/// by default uses SipHash which isn't quite as speedy as we want. In the
20-
/// compiler we're not really worried about DOS attempts, so we use a fast
18+
/// A speedy hash algorithm for use within rustc. The hashmap in alloc by
19+
/// default uses SipHash which isn't quite as speedy as we want. In the compiler
20+
/// we're not really worried about DOS attempts, so we use a fast
2121
/// non-cryptographic hash.
2222
///
2323
/// This is the same as the algorithm used by Firefox -- which is a homespun

0 commit comments

Comments
 (0)