Skip to content

Commit 9be1099

Browse files
authored
Rollup merge of #74141 - euclio:typos, r=steveklabnik
libstd/libcore: fix various typos
2 parents e8b55a4 + 133e91d commit 9be1099

File tree

19 files changed

+34
-34
lines changed

19 files changed

+34
-34
lines changed

src/libcore/convert/mod.rs

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

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

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

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

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

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

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

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

+3-3
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`.

src/libcore/ptr/mut_ptr.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,13 @@ impl<T: ?Sized> *mut T {
317317
intrinsics::ptr_guaranteed_eq(self as *const _, other as *const _)
318318
}
319319

320-
/// Returns whether two pointers are guaranteed to be inequal.
320+
/// Returns whether two pointers are guaranteed to be unequal.
321321
///
322322
/// At runtime this function behaves like `self != other`.
323323
/// However, in some contexts (e.g., compile-time evaluation),
324324
/// it is not always possible to determine the inequality of two pointers, so this function may
325-
/// spuriously return `false` for pointers that later actually turn out to be inequal.
326-
/// But when it returns `true`, the pointers are guaranteed to be inequal.
325+
/// spuriously return `false` for pointers that later actually turn out to be unequal.
326+
/// But when it returns `true`, the pointers are guaranteed to be unequal.
327327
///
328328
/// This function is the mirror of [`guaranteed_eq`], but not its inverse. There are pointer
329329
/// comparisons for which both functions return `false`.

src/libcore/ptr/non_null.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl<T> NonNull<[T]> {
172172
/// assert_eq!(unsafe { slice.as_ref()[2] }, 7);
173173
/// ```
174174
///
175-
/// (Note that this example artifically demonstrates a use of this method,
175+
/// (Note that this example artificially demonstrates a use of this method,
176176
/// but `let slice = NonNull::from(&x[..]);` would be a better way to write code like this.)
177177
#[unstable(feature = "nonnull_slice_from_raw_parts", issue = "71941")]
178178
#[rustc_const_unstable(feature = "const_nonnull_slice_from_raw_parts", issue = "71941")]

src/libstd/f32.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ mod tests {
15001500
assert_approx_eq!(f32::from_bits(0x44a72000), 1337.0);
15011501
assert_approx_eq!(f32::from_bits(0xc1640000), -14.25);
15021502

1503-
// Check that NaNs roundtrip their bits regardless of signalingness
1503+
// Check that NaNs roundtrip their bits regardless of signaling-ness
15041504
// 0xA is 0b1010; 0x5 is 0b0101 -- so these two together clobbers all the mantissa bits
15051505
let masked_nan1 = f32::NAN.to_bits() ^ 0x002A_AAAA;
15061506
let masked_nan2 = f32::NAN.to_bits() ^ 0x0055_5555;

src/libstd/f64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ mod tests {
15231523
assert_approx_eq!(f64::from_bits(0x4094e40000000000), 1337.0);
15241524
assert_approx_eq!(f64::from_bits(0xc02c800000000000), -14.25);
15251525

1526-
// Check that NaNs roundtrip their bits regardless of signalingness
1526+
// Check that NaNs roundtrip their bits regardless of signaling-ness
15271527
// 0xA is 0b1010; 0x5 is 0b0101 -- so these two together clobbers all the mantissa bits
15281528
let masked_nan1 = f64::NAN.to_bits() ^ 0x000A_AAAA_AAAA_AAAA;
15291529
let masked_nan2 = f64::NAN.to_bits() ^ 0x0005_5555_5555_5555;

src/libstd/os/linux/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ pub trait MetadataExt {
285285
/// ```
286286
#[stable(feature = "metadata_ext2", since = "1.8.0")]
287287
fn st_ctime_nsec(&self) -> i64;
288-
/// Returns the "preferred" blocksize for efficient filesystem I/O.
288+
/// Returns the "preferred" block size for efficient filesystem I/O.
289289
///
290290
/// # Examples
291291
///

src/libstd/os/redox/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub trait MetadataExt {
289289
/// ```
290290
#[stable(feature = "metadata_ext2", since = "1.8.0")]
291291
fn st_ctime_nsec(&self) -> i64;
292-
/// Returns the "preferred" blocksize for efficient filesystem I/O.
292+
/// Returns the "preferred" block size for efficient filesystem I/O.
293293
///
294294
/// # Examples
295295
///

src/libstd/sys/sgx/fd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl FileDesc {
1919
self.fd
2020
}
2121

22-
/// Extracts the actual filedescriptor without closing it.
22+
/// Extracts the actual file descriptor without closing it.
2323
pub fn into_raw(self) -> Fd {
2424
let fd = self.fd;
2525
mem::forget(self);

src/libstd/sys/unix/ext/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ pub trait MetadataExt {
624624
/// ```
625625
#[stable(feature = "metadata_ext", since = "1.1.0")]
626626
fn ctime_nsec(&self) -> i64;
627-
/// Returns the blocksize for filesystem I/O.
627+
/// Returns the block size for filesystem I/O.
628628
///
629629
/// # Examples
630630
///
@@ -635,7 +635,7 @@ pub trait MetadataExt {
635635
///
636636
/// fn main() -> io::Result<()> {
637637
/// let meta = fs::metadata("some_file")?;
638-
/// let blocksize = meta.blksize();
638+
/// let block_size = meta.blksize();
639639
/// Ok(())
640640
/// }
641641
/// ```

src/libstd/sys/vxworks/fd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl FileDesc {
2929
self.fd
3030
}
3131

32-
/// Extracts the actual filedescriptor without closing it.
32+
/// Extracts the actual file descriptor without closing it.
3333
pub fn into_raw(self) -> c_int {
3434
let fd = self.fd;
3535
mem::forget(self);

src/libstd/sys/wasi/fs.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -597,14 +597,14 @@ fn open_at(fd: &WasiFd, path: &Path, opts: &OpenOptions) -> io::Result<File> {
597597
///
598598
/// WASI has no fundamental capability to do this. All syscalls and operations
599599
/// are relative to already-open file descriptors. The C library, however,
600-
/// manages a map of preopened file descriptors to their path, and then the C
600+
/// manages a map of pre-opened file descriptors to their path, and then the C
601601
/// library provides an API to look at this. In other words, when you want to
602602
/// open a path `p`, you have to find a previously opened file descriptor in a
603603
/// global table and then see if `p` is relative to that file descriptor.
604604
///
605605
/// This function, if successful, will return two items:
606606
///
607-
/// * The first is a `ManuallyDrop<WasiFd>`. This represents a preopened file
607+
/// * The first is a `ManuallyDrop<WasiFd>`. This represents a pre-opened file
608608
/// descriptor which we don't have ownership of, but we can use. You shouldn't
609609
/// actually drop the `fd`.
610610
///
@@ -619,15 +619,15 @@ fn open_at(fd: &WasiFd, path: &Path, opts: &OpenOptions) -> io::Result<File> {
619619
/// appropriate rights for performing `rights` actions.
620620
///
621621
/// Note that this can fail if `p` doesn't look like it can be opened relative
622-
/// to any preopened file descriptor.
622+
/// to any pre-opened file descriptor.
623623
fn open_parent(p: &Path) -> io::Result<(ManuallyDrop<WasiFd>, PathBuf)> {
624624
let p = CString::new(p.as_os_str().as_bytes())?;
625625
unsafe {
626626
let mut ret = ptr::null();
627627
let fd = __wasilibc_find_relpath(p.as_ptr(), &mut ret);
628628
if fd == -1 {
629629
let msg = format!(
630-
"failed to find a preopened file descriptor \
630+
"failed to find a pre-opened file descriptor \
631631
through which {:?} could be opened",
632632
p
633633
);

0 commit comments

Comments
 (0)