From 24ad26db3b8bac3c812d797cb34df76f1bff306b Mon Sep 17 00:00:00 2001 From: ranger-ross Date: Sat, 31 Aug 2024 14:41:01 +0900 Subject: [PATCH 1/3] Fixed some typos in the standard library documentation/comments --- library/std/build.rs | 2 +- library/std/src/io/tests.rs | 2 +- library/std/src/rt.rs | 2 +- library/std/src/sync/mpmc/list.rs | 2 +- library/std/src/sys/pal/uefi/process.rs | 2 +- library/std/src/sys/pal/unix/net.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/std/build.rs b/library/std/build.rs index fecdf2c3e1f..72254cafc85 100644 --- a/library/std/build.rs +++ b/library/std/build.rs @@ -142,7 +142,7 @@ fn main() { // Configure platforms that have reliable basics but may have unreliable math. - // LLVM is currenlty adding missing routines, + // LLVM is currently adding missing routines, let has_reliable_f16_math = has_reliable_f16 && match (target_arch.as_str(), target_os.as_str()) { // FIXME: Disabled on Miri as the intrinsics are not implemented yet. diff --git a/library/std/src/io/tests.rs b/library/std/src/io/tests.rs index bb6a53bb290..24e5a1dfd5c 100644 --- a/library/std/src/io/tests.rs +++ b/library/std/src/io/tests.rs @@ -738,7 +738,7 @@ fn read_buf_full_read() { #[test] // Miri does not support signalling OOM #[cfg_attr(miri, ignore)] -// 64-bit only to be sure the allocator will fail fast on an impossible to satsify size +// 64-bit only to be sure the allocator will fail fast on an impossible to satisfy size #[cfg(target_pointer_width = "64")] fn try_oom_error() { let mut v = Vec::::new(); diff --git a/library/std/src/rt.rs b/library/std/src/rt.rs index 307a543c9d2..b6f36931ec2 100644 --- a/library/std/src/rt.rs +++ b/library/std/src/rt.rs @@ -146,7 +146,7 @@ fn lang_start_internal( rtabort!("drop of the panic payload panicked"); }); panic::catch_unwind(cleanup).map_err(rt_abort)?; - // Guard against multple threads calling `libc::exit` concurrently. + // Guard against multiple threads calling `libc::exit` concurrently. // See the documentation for `unique_thread_exit` for more information. panic::catch_unwind(|| crate::sys::exit_guard::unique_thread_exit()).map_err(rt_abort)?; ret_code diff --git a/library/std/src/sync/mpmc/list.rs b/library/std/src/sync/mpmc/list.rs index bbe205cad04..88a8c75f7c8 100644 --- a/library/std/src/sync/mpmc/list.rs +++ b/library/std/src/sync/mpmc/list.rs @@ -551,7 +551,7 @@ impl Channel { let mut head = self.head.index.load(Ordering::Acquire); // The channel may be uninitialized, so we have to swap to avoid overwriting any sender's attempts - // to initalize the first block before noticing that the receivers disconnected. Late allocations + // to initialize the first block before noticing that the receivers disconnected. Late allocations // will be deallocated by the sender in Drop. let mut block = self.head.block.swap(ptr::null_mut(), Ordering::AcqRel); diff --git a/library/std/src/sys/pal/uefi/process.rs b/library/std/src/sys/pal/uefi/process.rs index fdc5f5d7e4f..0cc9cecb89d 100644 --- a/library/std/src/sys/pal/uefi/process.rs +++ b/library/std/src/sys/pal/uefi/process.rs @@ -470,7 +470,7 @@ mod uefi_command_internal { let st_size = unsafe { (*self.st.as_ptr()).hdr.header_size as usize }; let mut crc32: u32 = 0; - // Set crc to 0 before calcuation + // Set crc to 0 before calculation unsafe { (*self.st.as_mut_ptr()).hdr.crc32 = 0; } diff --git a/library/std/src/sys/pal/unix/net.rs b/library/std/src/sys/pal/unix/net.rs index bc0e3f4eeea..d75a666d350 100644 --- a/library/std/src/sys/pal/unix/net.rs +++ b/library/std/src/sys/pal/unix/net.rs @@ -215,7 +215,7 @@ impl Socket { _ => { if cfg!(target_os = "vxworks") { // VxWorks poll does not return POLLHUP or POLLERR in revents. Check if the - // connnection actually succeeded and return ok only when the socket is + // connection actually succeeded and return ok only when the socket is // ready and no errors were found. if let Some(e) = self.take_error()? { return Err(e); From 92f45900bb1ef2c8e9cbb90478a4cddc4961de9f Mon Sep 17 00:00:00 2001 From: ranger-ross Date: Sat, 31 Aug 2024 14:50:37 +0900 Subject: [PATCH 2/3] Fixed typos in btree map docs --- library/alloc/src/collections/btree/map.rs | 4 ++-- library/alloc/src/collections/btree/set.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index f6f773cc42a..c7908578522 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -3302,7 +3302,7 @@ impl<'a, K: Ord, V, A: Allocator + Clone> CursorMutKey<'a, K, V, A> { Some(kv) } - /// Removes the precending element from the `BTreeMap`. + /// Removes the preceding element from the `BTreeMap`. /// /// The element that was removed is returned. The cursor position is /// unchanged (after the removed element). @@ -3408,7 +3408,7 @@ impl<'a, K: Ord, V, A: Allocator + Clone> CursorMut<'a, K, V, A> { self.inner.remove_next() } - /// Removes the precending element from the `BTreeMap`. + /// Removes the preceding element from the `BTreeMap`. /// /// The element that was removed is returned. The cursor position is /// unchanged (after the removed element). diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index 973e7c66067..2b5bebcd8cd 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -2298,7 +2298,7 @@ impl<'a, T: Ord, A: Allocator + Clone> CursorMut<'a, T, A> { self.inner.remove_next().map(|(k, _)| k) } - /// Removes the precending element from the `BTreeSet`. + /// Removes the preceding element from the `BTreeSet`. /// /// The element that was removed is returned. The cursor position is /// unchanged (after the removed element). @@ -2384,7 +2384,7 @@ impl<'a, T: Ord, A: Allocator + Clone> CursorMutKey<'a, T, A> { self.inner.remove_next().map(|(k, _)| k) } - /// Removes the precending element from the `BTreeSet`. + /// Removes the preceding element from the `BTreeSet`. /// /// The element that was removed is returned. The cursor position is /// unchanged (after the removed element). From cbf92fcf39154a25b4bb491eebc4c3a27ae4e6ce Mon Sep 17 00:00:00 2001 From: ranger-ross Date: Sat, 31 Aug 2024 14:57:38 +0900 Subject: [PATCH 3/3] Fixed more typos in library/core --- library/core/src/array/mod.rs | 2 +- library/core/src/future/async_drop.rs | 4 ++-- library/core/src/intrinsics/mir.rs | 2 +- library/core/src/macros/mod.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 61c713c9e81..c63f261edab 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -37,7 +37,7 @@ pub use iter::IntoIter; /// /// # Example /// -/// Creating muliple copies of a `String`: +/// Creating multiple copies of a `String`: /// ```rust /// #![feature(array_repeat)] /// diff --git a/library/core/src/future/async_drop.rs b/library/core/src/future/async_drop.rs index 8971a2c0aaf..16ac77fa150 100644 --- a/library/core/src/future/async_drop.rs +++ b/library/core/src/future/async_drop.rs @@ -157,7 +157,7 @@ async unsafe fn surface_drop_in_place(ptr: *mut T) { unsafe { crate::ops::fallback_surface_drop(&mut *ptr) } } -/// Wraps a future to continue outputing `Poll::Ready(())` once after +/// Wraps a future to continue outputting `Poll::Ready(())` once after /// wrapped future completes by returning `Poll::Ready(())` on poll. This /// is useful for constructing async destructors to guarantee this /// "fuse" property @@ -223,7 +223,7 @@ where /// # Safety /// /// Same as `async_drop_in_place` except is lazy to avoid creating -/// multiple mutable refernces. +/// multiple mutable references. #[lang = "async_drop_defer"] async unsafe fn defer(to_drop: *mut T) { // SAFETY: same safety requirements as `async_drop_in_place` diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs index c7cec396e1f..fb0aa5398a5 100644 --- a/library/core/src/intrinsics/mir.rs +++ b/library/core/src/intrinsics/mir.rs @@ -310,7 +310,7 @@ define!( ); define!( "mir_unwind_cleanup", - /// An unwind action that continues execution in a given basic blok. + /// An unwind action that continues execution in a given basic block. fn UnwindCleanup(goto: BasicBlock) -> UnwindActionArg ); diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index ac51a40d9f4..888832251f6 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -1072,7 +1072,7 @@ pub(crate) mod builtin { /// If the environment variable is not defined, then a compilation error /// will be emitted. To not emit a compile error, use the [`option_env!`] /// macro instead. A compilation error will also be emitted if the - /// environment variable is not a vaild Unicode string. + /// environment variable is not a valid Unicode string. /// /// # Examples ///