diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index a2f60142ffc75..40adf1b4ea742 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -3280,7 +3280,7 @@ declare_lint! { /// /// In Rust 2021, one of the important introductions is the [prelude changes], which add /// `TryFrom`, `TryInto`, and `FromIterator` into the standard library's prelude. Since this - /// results in an amiguity as to which method/function to call when an existing `try_into` + /// results in an ambiguity as to which method/function to call when an existing `try_into` /// method is called via dot-call syntax or a `try_from`/`from_iter` associated function /// is called directly on a type. /// diff --git a/library/alloc/src/collections/btree/fix.rs b/library/alloc/src/collections/btree/fix.rs index af87a9b956a17..c4861817dd05d 100644 --- a/library/alloc/src/collections/btree/fix.rs +++ b/library/alloc/src/collections/btree/fix.rs @@ -3,7 +3,7 @@ use super::node::{marker, ForceResult::*, Handle, LeftOrRight::*, NodeRef, Root} impl<'a, K: 'a, V: 'a> NodeRef, K, V, marker::LeafOrInternal> { /// Stocks up a possibly underfull node by merging with or stealing from a - /// sibling. If succesful but at the cost of shrinking the parent node, + /// sibling. If successful but at the cost of shrinking the parent node, /// returns that shrunk parent node. Returns an `Err` if the node is /// an empty root. fn fix_node_through_parent( diff --git a/library/alloc/src/collections/btree/node.rs b/library/alloc/src/collections/btree/node.rs index 3c453529ba84d..30d237d8bbc54 100644 --- a/library/alloc/src/collections/btree/node.rs +++ b/library/alloc/src/collections/btree/node.rs @@ -167,7 +167,7 @@ type BoxedNode = NonNull>; /// carry a lifetime, because we want it to return `&'a` references. /// Therefore, we define it only for the least powerful type `Immut<'a>`. /// - We cannot get implicit coercion from say `Mut<'a>` to `Immut<'a>`. -/// Therefore, we have to explicitly call `reborrow` on a more powerfull +/// Therefore, we have to explicitly call `reborrow` on a more powerful /// `NodeRef` in order to reach a method like `into_kv`. /// /// All methods on `NodeRef` that return some kind of reference, either: diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index 6c2f09514a611..879deed3bed5e 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -41,7 +41,7 @@ use self::Ordering::*; /// /// If [`PartialOrd`] or [`Ord`] are also implemented for `Self` and `Rhs`, their methods must also /// be consistent with `PartialEq` (see the documentation of those traits for the exact -/// requirememts). It's easy to accidentally make them disagree by deriving some of the traits and +/// requirements). It's easy to accidentally make them disagree by deriving some of the traits and /// manually implementing others. /// /// The equality relation `==` must satisfy the following conditions diff --git a/library/core/src/iter/adapters/mod.rs b/library/core/src/iter/adapters/mod.rs index 9fdd4fca04c97..a3fbf4d9c38d8 100644 --- a/library/core/src/iter/adapters/mod.rs +++ b/library/core/src/iter/adapters/mod.rs @@ -54,7 +54,7 @@ pub use self::zip::TrustedRandomAccess; #[unstable(feature = "iter_zip", issue = "83574")] pub use self::zip::zip; -/// This trait provides transitive access to source-stage in an interator-adapter pipeline +/// This trait provides transitive access to source-stage in an iterator-adapter pipeline /// under the conditions that /// * the iterator source `S` itself implements `SourceIter` /// * there is a delegating implementation of this trait for each adapter in the pipeline between diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index de3367e5e5297..3dfbd98fa6c7b 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -980,7 +980,7 @@ impl MaybeUninit { this.as_mut_ptr() as *mut T } - /// Copies the elements from `src` to `this`, returning a mutable reference to the now initalized contents of `this`. + /// Copies the elements from `src` to `this`, returning a mutable reference to the now initialized contents of `this`. /// /// If `T` does not implement `Copy`, use [`write_slice_cloned`] /// @@ -1033,12 +1033,12 @@ impl MaybeUninit { this.copy_from_slice(uninit_src); - // SAFETY: Valid elements have just been copied into `this` so it is initalized + // SAFETY: Valid elements have just been copied into `this` so it is initialized unsafe { MaybeUninit::slice_assume_init_mut(this) } } - /// Clones the elements from `src` to `this`, returning a mutable reference to the now initalized contents of `this`. - /// Any already initalized elements will not be dropped. + /// Clones the elements from `src` to `this`, returning a mutable reference to the now initialized contents of `this`. + /// Any already initialized elements will not be dropped. /// /// If `T` implements `Copy`, use [`write_slice`] /// @@ -1124,7 +1124,7 @@ impl MaybeUninit { super::forget(guard); - // SAFETY: Valid elements have just been written into `this` so it is initalized + // SAFETY: Valid elements have just been written into `this` so it is initialized unsafe { MaybeUninit::slice_assume_init_mut(this) } } } diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs index 7c7dce0ce74e2..287ae69acd198 100644 --- a/library/core/src/ptr/metadata.rs +++ b/library/core/src/ptr/metadata.rs @@ -101,7 +101,7 @@ pub const fn metadata(ptr: *const T) -> ::Metadata { /// /// This function is safe but the returned pointer is not necessarily safe to dereference. /// For slices, see the documentation of [`slice::from_raw_parts`] for safety requirements. -/// For trait objects, the metadata must come from a pointer to the same underlying ereased type. +/// For trait objects, the metadata must come from a pointer to the same underlying erased type. /// /// [`slice::from_raw_parts`]: crate::slice::from_raw_parts #[unstable(feature = "ptr_metadata", issue = "81513")] diff --git a/library/proc_macro/src/bridge/rpc.rs b/library/proc_macro/src/bridge/rpc.rs index 588e6ded0f480..42432563faf33 100644 --- a/library/proc_macro/src/bridge/rpc.rs +++ b/library/proc_macro/src/bridge/rpc.rs @@ -246,7 +246,7 @@ impl DecodeMut<'_, '_, S> for String { } } -/// Simplied version of panic payloads, ignoring +/// Simplified version of panic payloads, ignoring /// types other than `&'static str` and `String`. pub enum PanicMessage { StaticStr(&'static str), diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs index a609567ce93f3..605bd33a4bf22 100644 --- a/library/std/src/keyword_docs.rs +++ b/library/std/src/keyword_docs.rs @@ -971,7 +971,7 @@ mod match_keyword {} /// ``` /// /// Like [`struct`]s and [`enum`]s, a module and its content are private by -/// default, unaccessible to code outside of the module. +/// default, inaccessible to code outside of the module. /// /// To learn more about allowing access, see the documentation for the [`pub`] /// keyword. diff --git a/library/std/src/os/unix/process.rs b/library/std/src/os/unix/process.rs index 3dc389b7582f7..f3b5227df869d 100644 --- a/library/std/src/os/unix/process.rs +++ b/library/std/src/os/unix/process.rs @@ -226,7 +226,7 @@ pub trait ExitStatusExt: Sealed { /// /// Panics on an attempt to make an `ExitStatusError` from a wait status of `0`. /// - /// Making an `ExitStatus` always succeds and never panics. + /// Making an `ExitStatus` always succeeds and never panics. #[stable(feature = "exit_status_from", since = "1.12.0")] fn from_raw(raw: i32) -> Self; diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 6903ba9056089..6f523728d7b69 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -1568,7 +1568,7 @@ impl ExitStatusError { /// Reports the exit code, if applicable, from an `ExitStatusError`, as a `NonZero` /// - /// This is exaclty like [`code()`](Self::code), except that it returns a `NonZeroI32`. + /// This is exactly like [`code()`](Self::code), except that it returns a `NonZeroI32`. /// /// Plain `code`, returning a plain integer, is provided because is is often more convenient. /// The returned value from `code()` is indeed also nonzero; use `code_nonzero()` when you want diff --git a/library/std/src/sys/hermit/mutex.rs b/library/std/src/sys/hermit/mutex.rs index 885389ca54cd4..4221799114b53 100644 --- a/library/std/src/sys/hermit/mutex.rs +++ b/library/std/src/sys/hermit/mutex.rs @@ -14,7 +14,7 @@ use crate::sys::hermit::abi; /// This structure behaves a lot like a common mutex. There are some differences: /// /// - By using busy waiting, it can be used outside the runtime. -/// - It is a so called ticket lock and is completly fair. +/// - It is a so called ticket lock and is completely fair. #[cfg_attr(target_arch = "x86_64", repr(align(128)))] #[cfg_attr(not(target_arch = "x86_64"), repr(align(64)))] struct Spinlock {