Skip to content

Commit 2bbfa02

Browse files
committed
Auto merge of #74667 - Manishearth:rollup-s6k59sw, r=Manishearth
Rollup of 8 pull requests Successful merges: - #74141 (libstd/libcore: fix various typos) - #74490 (add a Backtrace::disabled function) - #74548 (one more Path::with_extension example, to demonstrate behavior) - #74587 (Prefer constant over function) - #74606 (Remove Linux workarounds for missing CLOEXEC support) - #74637 (Make str point to primitive page) - #74654 (require type defaults to be after const generic parameters) - #74659 (Improve codegen for unchecked float casts on wasm) Failed merges: r? @ghost
2 parents fcac119 + 8f02f2c commit 2bbfa02

File tree

36 files changed

+266
-302
lines changed

36 files changed

+266
-302
lines changed

src/liballoc/string.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ use crate::vec::Vec;
6565
///
6666
/// # Examples
6767
///
68-
/// You can create a `String` from [a literal string][str] with [`String::from`]:
68+
/// You can create a `String` from [a literal string][`str`] with [`String::from`]:
6969
///
7070
/// [`String::from`]: From::from
7171
///
@@ -268,7 +268,8 @@ use crate::vec::Vec;
268268
///
269269
/// Here, there's no need to allocate more memory inside the loop.
270270
///
271-
/// [`&str`]: str
271+
/// [`str`]: type@str
272+
/// [`&str`]: type@str
272273
/// [`Deref`]: core::ops::Deref
273274
/// [`as_str()`]: String::as_str
274275
#[derive(PartialOrd, Eq, Ord)]

src/libcore/convert/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ impl AsRef<str> for str {
677677
///
678678
///
679679
/// However there is one case where `!` syntax can be used
680-
/// before `!` is stabilized as a full-fleged type: in the position of a function’s return type.
680+
/// before `!` is stabilized as a full-fledged type: in the position of a function’s return type.
681681
/// Specifically, it is possible implementations for two different function pointer types:
682682
///
683683
/// ```

src/libcore/hash/sip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct SipHasher24 {
4343
///
4444
/// SipHash is a general-purpose hashing function: it runs at a good
4545
/// speed (competitive with Spooky and City) and permits strong _keyed_
46-
/// hashing. This lets you key your hashtables from a strong RNG, such as
46+
/// hashing. This lets you key your hash tables from a strong RNG, such as
4747
/// [`rand::os::OsRng`](https://doc.rust-lang.org/rand/rand/os/struct.OsRng.html).
4848
///
4949
/// Although the SipHash algorithm is considered to be generally strong,

src/libcore/intrinsics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//!
1616
//! If an intrinsic is supposed to be used from a `const fn` with a `rustc_const_stable` attribute,
1717
//! the intrinsic's attribute must be `rustc_const_stable`, too. Such a change should not be done
18-
//! without T-lang consulation, because it bakes a feature into the language that cannot be
18+
//! without T-lang consultation, because it bakes a feature into the language that cannot be
1919
//! replicated in user code without compiler support.
2020
//!
2121
//! # Volatiles
@@ -994,7 +994,7 @@ extern "rust-intrinsic" {
994994
/// [`std::mem::align_of`](../../std/mem/fn.align_of.html).
995995
#[rustc_const_stable(feature = "const_min_align_of", since = "1.40.0")]
996996
pub fn min_align_of<T>() -> usize;
997-
/// The prefered alignment of a type.
997+
/// The preferred alignment of a type.
998998
///
999999
/// This intrinsic does not have a stable counterpart.
10001000
#[rustc_const_unstable(feature = "const_pref_align_of", issue = "none")]
@@ -1246,14 +1246,14 @@ extern "rust-intrinsic" {
12461246
/// assert!(mid <= len);
12471247
/// unsafe {
12481248
/// let slice2 = mem::transmute::<&mut [T], &mut [T]>(slice);
1249-
/// // first: transmute is not typesafe; all it checks is that T and
1249+
/// // first: transmute is not type safe; all it checks is that T and
12501250
/// // U are of the same size. Second, right here, you have two
12511251
/// // mutable references pointing to the same memory.
12521252
/// (&mut slice[0..mid], &mut slice2[mid..len])
12531253
/// }
12541254
/// }
12551255
///
1256-
/// // This gets rid of the typesafety problems; `&mut *` will *only* give
1256+
/// // This gets rid of the type safety problems; `&mut *` will *only* give
12571257
/// // you an `&mut T` from an `&mut T` or `*mut T`.
12581258
/// fn split_at_mut_casts<T>(slice: &mut [T], mid: usize)
12591259
/// -> (&mut [T], &mut [T]) {

src/libcore/iter/traits/iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ pub trait Iterator {
10691069
/// let vec = iter.collect::<Vec<_>>();
10701070
///
10711071
/// // We have more elements which could fit in u32 (4, 5), but `map_while` returned `None` for `-3`
1072-
/// // (as the `predicate` returned `None`) and `collect` stops at the first `None` entcountered.
1072+
/// // (as the `predicate` returned `None`) and `collect` stops at the first `None` encountered.
10731073
/// assert_eq!(vec, vec![0, 1, 2]);
10741074
/// ```
10751075
///

src/libcore/macros/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ pub(crate) mod builtin {
10471047
};
10481048
}
10491049

1050-
/// Includes a utf8-encoded file as a string.
1050+
/// Includes a UTF-8 encoded file as a string.
10511051
///
10521052
/// The file is located relative to the current file (similarly to how
10531053
/// modules are found). The provided path is interpreted in a platform-specific

src/libcore/mem/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,11 @@ pub fn size_of_val<T: ?Sized>(val: &T) -> usize {
348348
///
349349
/// - If `T` is `Sized`, this function is always safe to call.
350350
/// - If the unsized tail of `T` is:
351-
/// - a [slice], then the length of the slice tail must be an intialized
351+
/// - a [slice], then the length of the slice tail must be an initialized
352352
/// integer, and the size of the *entire value*
353353
/// (dynamic tail length + statically sized prefix) must fit in `isize`.
354354
/// - a [trait object], then the vtable part of the pointer must point
355-
/// to a valid vtable acquired by an unsizing coersion, and the size
355+
/// to a valid vtable acquired by an unsizing coercion, and the size
356356
/// of the *entire value* (dynamic tail length + statically sized prefix)
357357
/// must fit in `isize`.
358358
/// - an (unstable) [extern type], then this function is always safe to
@@ -483,11 +483,11 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
483483
///
484484
/// - If `T` is `Sized`, this function is always safe to call.
485485
/// - If the unsized tail of `T` is:
486-
/// - a [slice], then the length of the slice tail must be an intialized
486+
/// - a [slice], then the length of the slice tail must be an initialized
487487
/// integer, and the size of the *entire value*
488488
/// (dynamic tail length + statically sized prefix) must fit in `isize`.
489489
/// - a [trait object], then the vtable part of the pointer must point
490-
/// to a valid vtable acquired by an unsizing coersion, and the size
490+
/// to a valid vtable acquired by an unsizing coercion, and the size
491491
/// of the *entire value* (dynamic tail length + statically sized prefix)
492492
/// must fit in `isize`.
493493
/// - an (unstable) [extern type], then this function is always safe to

src/libcore/num/f64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ impl f64 {
687687
/// signaling NaNs on MIPS are quiet NaNs on x86, and vice-versa.
688688
///
689689
/// Rather than trying to preserve signaling-ness cross-platform, this
690-
/// implementation favours preserving the exact bits. This means that
690+
/// implementation favors preserving the exact bits. This means that
691691
/// any payloads encoded in NaNs will be preserved even if the result of
692692
/// this method is sent over the network from an x86 machine to a MIPS one.
693693
///
@@ -696,7 +696,7 @@ impl f64 {
696696
///
697697
/// If the input isn't NaN, then there is no portability concern.
698698
///
699-
/// If you don't care about signalingness (very likely), then there is no
699+
/// If you don't care about signaling-ness (very likely), then there is no
700700
/// portability concern.
701701
///
702702
/// Note that this function is distinct from `as` casting, which attempts to

src/libcore/pin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
//!
129129
//! Crucially, we have to be able to rely on [`drop`] being called. If an element
130130
//! could be deallocated or otherwise invalidated without calling [`drop`], the pointers into it
131-
//! from its neighbouring elements would become invalid, which would break the data structure.
131+
//! from its neighboring elements would become invalid, which would break the data structure.
132132
//!
133133
//! Therefore, pinning also comes with a [`drop`]-related guarantee.
134134
//!

src/libcore/ptr/const_ptr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,13 @@ impl<T: ?Sized> *const T {
331331
intrinsics::ptr_guaranteed_eq(self, other)
332332
}
333333

334-
/// Returns whether two pointers are guaranteed to be inequal.
334+
/// Returns whether two pointers are guaranteed to be unequal.
335335
///
336336
/// At runtime this function behaves like `self != other`.
337337
/// However, in some contexts (e.g., compile-time evaluation),
338338
/// it is not always possible to determine the inequality of two pointers, so this function may
339-
/// spuriously return `false` for pointers that later actually turn out to be inequal.
340-
/// But when it returns `true`, the pointers are guaranteed to be inequal.
339+
/// spuriously return `false` for pointers that later actually turn out to be unequal.
340+
/// But when it returns `true`, the pointers are guaranteed to be unequal.
341341
///
342342
/// This function is the mirror of [`guaranteed_eq`], but not its inverse. There are pointer
343343
/// comparisons for which both functions return `false`.

0 commit comments

Comments
 (0)