about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-03-06 12:13:55 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-03-06 15:19:31 +0100
commit136ad015b6862274bf8c161dc5d2955409ed1465 (patch)
tree44213c111b970f7f07b47611a2287e986a7f7a24
parent865b44a3e330f3ef8be0f6edf69896c9ed957ac0 (diff)
downloadrust-136ad015b6862274bf8c161dc5d2955409ed1465.tar.gz
rust-136ad015b6862274bf8c161dc5d2955409ed1465.zip
fix various typos
-rw-r--r--config.toml.example2
-rw-r--r--src/bootstrap/compile.rs2
-rw-r--r--src/bootstrap/flags.rs2
-rw-r--r--src/ci/azure-pipelines/try.yml2
-rw-r--r--src/doc/rustdoc/src/unstable-features.md2
-rw-r--r--src/doc/unstable-book/src/language-features/marker-trait-attr.md2
-rw-r--r--src/liballoc/collections/btree/node.rs2
-rw-r--r--src/liballoc/collections/linked_list.rs6
-rw-r--r--src/liballoc/collections/vec_deque.rs2
-rw-r--r--src/liballoc/vec.rs2
-rw-r--r--src/libcore/fmt/mod.rs2
-rw-r--r--src/libcore/mem/manually_drop.rs2
-rw-r--r--src/libcore/mem/mod.rs2
-rw-r--r--src/libcore/pin.rs4
-rw-r--r--src/libcore/ptr/const_ptr.rs8
-rw-r--r--src/libcore/ptr/mod.rs2
-rw-r--r--src/libcore/ptr/mut_ptr.rs10
-rw-r--r--src/libcore/tests/num/dec2flt/mod.rs2
-rw-r--r--src/libfmt_macros/lib.rs2
-rw-r--r--src/libproc_macro/bridge/client.rs4
-rw-r--r--src/librustc/hir/map/mod.rs2
-rw-r--r--src/librustc/mir/interpret/allocation.rs2
-rw-r--r--src/librustc/ty/layout.rs2
-rw-r--r--src/librustc/ty/print/mod.rs2
-rw-r--r--src/librustc/ty/print/pretty.rs6
-rw-r--r--src/librustc/ty/query/on_disk_cache.rs2
-rw-r--r--src/librustc/ty/query/plumbing.rs2
-rw-r--r--src/librustc/ty/relate.rs2
-rw-r--r--src/librustc_ast/ast.rs4
-rw-r--r--src/librustc_ast_lowering/lib.rs2
-rw-r--r--src/librustc_builtin_macros/format.rs2
-rw-r--r--src/librustc_codegen_llvm/back/lto.rs4
-rw-r--r--src/librustc_codegen_llvm/back/profiling.rs4
-rw-r--r--src/librustc_codegen_llvm/debuginfo/metadata.rs2
-rw-r--r--src/librustc_codegen_ssa/back/write.rs2
-rw-r--r--src/librustc_codegen_ssa/traits/mod.rs2
-rw-r--r--src/librustc_codegen_utils/symbol_names.rs2
-rw-r--r--src/librustc_data_structures/graph/vec_graph/tests.rs2
-rw-r--r--src/librustc_data_structures/sharded.rs4
-rw-r--r--src/librustc_error_codes/error_codes/E0326.md2
-rw-r--r--src/librustc_error_codes/error_codes/E0591.md2
-rw-r--r--src/librustc_expand/mbe/macro_rules.rs2
-rw-r--r--src/librustc_expand/proc_macro.rs2
-rw-r--r--src/librustc_feature/active.rs2
-rw-r--r--src/librustc_feature/builtin_attrs.rs2
-rw-r--r--src/librustc_infer/infer/error_reporting/mod.rs2
-rw-r--r--src/librustc_infer/infer/error_reporting/need_type_info.rs2
-rw-r--r--src/librustc_infer/infer/mod.rs4
-rw-r--r--src/librustc_infer/infer/opaque_types/mod.rs2
-rw-r--r--src/librustc_infer/infer/resolve.rs2
-rw-r--r--src/librustc_infer/traits/auto_trait.rs4
-rw-r--r--src/librustc_infer/traits/coherence.rs2
-rw-r--r--src/librustc_infer/traits/error_reporting/mod.rs2
-rw-r--r--src/librustc_infer/traits/object_safety.rs2
-rw-r--r--src/librustc_lexer/src/unescape.rs4
-rw-r--r--src/librustc_macros/src/query.rs4
-rw-r--r--src/librustc_metadata/locator.rs2
-rw-r--r--src/librustc_metadata/rmeta/mod.rs2
-rw-r--r--src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs2
-rw-r--r--src/librustc_mir/borrow_check/diagnostics/mutability_errors.rs2
-rw-r--r--src/librustc_mir/borrow_check/invalidation.rs2
-rw-r--r--src/librustc_mir/borrow_check/member_constraints.rs2
-rw-r--r--src/librustc_mir/borrow_check/mod.rs2
-rw-r--r--src/librustc_mir/borrow_check/type_check/mod.rs2
-rw-r--r--src/librustc_mir/const_eval/eval_queries.rs4
-rw-r--r--src/librustc_mir/interpret/eval_context.rs2
-rw-r--r--src/librustc_mir/interpret/machine.rs2
-rw-r--r--src/librustc_mir/interpret/operand.rs2
-rw-r--r--src/librustc_mir/interpret/snapshot.rs2
-rw-r--r--src/librustc_mir/transform/add_retag.rs2
-rw-r--r--src/librustc_mir/transform/const_prop.rs2
-rw-r--r--src/librustc_mir/util/elaborate_drops.rs2
-rw-r--r--src/librustc_mir/util/pretty.rs2
-rw-r--r--src/librustc_mir_build/hair/pattern/_match.rs2
-rw-r--r--src/librustc_parse/config.rs2
-rw-r--r--src/librustc_parse/parser/attr.rs2
-rw-r--r--src/librustc_parse/parser/diagnostics.rs2
-rw-r--r--src/librustc_parse/parser/expr.rs2
-rw-r--r--src/librustc_passes/region.rs2
-rw-r--r--src/librustc_passes/stability.rs2
-rw-r--r--src/librustc_resolve/diagnostics.rs2
-rw-r--r--src/librustc_resolve/imports.rs2
-rw-r--r--src/librustc_resolve/late.rs2
-rw-r--r--src/librustc_resolve/late/lifetimes.rs2
-rw-r--r--src/librustc_target/abi/call/mod.rs6
-rw-r--r--src/librustc_target/abi/mod.rs2
-rw-r--r--src/librustc_target/spec/i686_unknown_uefi.rs4
-rw-r--r--src/librustc_target/spec/nvptx64_nvidia_cuda.rs4
-rw-r--r--src/librustc_typeck/astconv.rs4
-rw-r--r--src/librustc_typeck/check/method/probe.rs2
-rw-r--r--src/librustc_typeck/check/mod.rs8
-rw-r--r--src/librustc_typeck/check/pat.rs4
-rw-r--r--src/librustc_typeck/coherence/orphan.rs2
-rw-r--r--src/librustc_typeck/collect.rs2
-rw-r--r--src/librustdoc/clean/auto_trait.rs2
-rw-r--r--src/librustdoc/html/highlight.rs2
-rw-r--r--src/librustdoc/html/render.rs2
-rw-r--r--src/libstd/net/ip.rs2
-rw-r--r--src/libstd/os/linux/fs.rs2
-rw-r--r--src/libstd/sync/mpsc/spsc_queue.rs2
-rw-r--r--src/libstd/sys/sgx/abi/usercalls/alloc.rs2
-rw-r--r--src/libstd/sys/unix/mod.rs2
-rw-r--r--src/libstd/sys/vxworks/mod.rs2
-rw-r--r--src/libtest/cli.rs2
-rw-r--r--src/libtest/options.rs2
-rw-r--r--src/libtest/test_result.rs2
-rw-r--r--src/test/incremental/cyclic-trait-hierarchy.rs2
-rw-r--r--src/test/incremental/thinlto/cgu_invalidated_when_import_added.rs2
-rw-r--r--src/test/incremental/thinlto/cgu_invalidated_when_import_removed.rs2
-rw-r--r--src/test/ui/consts/const-int-arithmetic-overflow.rs2
-rw-r--r--src/test/ui/definition-reachable/nested-fn.rs2
-rw-r--r--src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs2
-rw-r--r--src/test/ui/mir/mir_assign_eval_order.rs2
-rw-r--r--src/test/ui/nll/issue-54556-used-vs-unused-tails.rs2
-rw-r--r--src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-65918.rs2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs2
-rw-r--r--src/test/ui/typeck/issue-52082-type-param-shadows-existing-type.rs2
-rw-r--r--src/test/ui/wf/wf-array-elem-sized.rs2
-rw-r--r--src/tools/compiletest/src/errors.rs2
-rw-r--r--src/tools/compiletest/src/runtest.rs2
-rw-r--r--src/tools/tidy/src/pal.rs2
122 files changed, 153 insertions, 153 deletions
diff --git a/config.toml.example b/config.toml.example
index 9b7327ea69e..ce21b63467f 100644
--- a/config.toml.example
+++ b/config.toml.example
@@ -315,7 +315,7 @@
 # `0` - no debug info
 # `1` - line tables only
 # `2` - full debug info with variable and type information
-# Can be overriden for specific subsets of Rust code (rustc, std or tools).
+# Can be overridden for specific subsets of Rust code (rustc, std or tools).
 # Debuginfo for tests run with compiletest is not controlled by this option
 # and needs to be enabled separately with `debuginfo-level-tests`.
 #debuginfo-level = if debug { 2 } else { 0 }
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 7dded96e18e..65a00db3394 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -141,7 +141,7 @@ fn copy_third_party_objects(
         copy_and_stamp(&srcdir, "crt1.o");
     }
 
-    // Copies libunwind.a compiled to be linked wit x86_64-fortanix-unknown-sgx.
+    // Copies libunwind.a compiled to be linked with x86_64-fortanix-unknown-sgx.
     //
     // This target needs to be linked to Fortanix's port of llvm's libunwind.
     // libunwind requires support for rwlock and printing to stderr,
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
index 516be6a30c2..0b2ab6bbbc0 100644
--- a/src/bootstrap/flags.rs
+++ b/src/bootstrap/flags.rs
@@ -33,7 +33,7 @@ pub struct Flags {
     pub rustc_error_format: Option<String>,
     pub dry_run: bool,
 
-    // This overrides the deny-warnings configuation option,
+    // This overrides the deny-warnings configuration option,
     // which passes -Dwarnings to the compiler invocations.
     //
     // true => deny, false => warn
diff --git a/src/ci/azure-pipelines/try.yml b/src/ci/azure-pipelines/try.yml
index f8ddf0eb46c..a29d6f9ae1e 100644
--- a/src/ci/azure-pipelines/try.yml
+++ b/src/ci/azure-pipelines/try.yml
@@ -20,7 +20,7 @@ jobs:
 
 # The macOS and Windows builds here are currently disabled due to them not being
 # overly necessary on `try` builds. We also don't actually have anything that
-# consumes the artifacts currently. Perhaps one day we can reenable, but for now
+# consumes the artifacts currently. Perhaps one day we can re-enable, but for now
 # it helps free up capacity on Azure.
 # - job: macOS
 #   timeoutInMinutes: 600
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md
index a48526d39fd..22d2e297da3 100644
--- a/src/doc/rustdoc/src/unstable-features.md
+++ b/src/doc/rustdoc/src/unstable-features.md
@@ -453,7 +453,7 @@ override `ignore`.
 
 ### `--runtool`, `--runtool-arg`: program to run tests with; args to pass to it
 
-Using thses options looks like this:
+Using these options looks like this:
 
 ```bash
 $ rustdoc src/lib.rs -Z unstable-options --runtool runner --runtool-arg --do-thing --runtool-arg --do-other-thing
diff --git a/src/doc/unstable-book/src/language-features/marker-trait-attr.md b/src/doc/unstable-book/src/language-features/marker-trait-attr.md
index dedc7d3015d..be350cd6169 100644
--- a/src/doc/unstable-book/src/language-features/marker-trait-attr.md
+++ b/src/doc/unstable-book/src/language-features/marker-trait-attr.md
@@ -21,7 +21,7 @@ when they'd need to do the same thing for every type anyway).
 
 impl<T: Copy> CheapToClone for T {}
 
-// These could potentally overlap with the blanket implementation above,
+// These could potentially overlap with the blanket implementation above,
 // so are only allowed because CheapToClone is a marker trait.
 impl<T: CheapToClone, U: CheapToClone> CheapToClone for (T, U) {}
 impl<T: CheapToClone> CheapToClone for std::ops::Range<T> {}
diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs
index 362755f8b7f..edeb87a908d 100644
--- a/src/liballoc/collections/btree/node.rs
+++ b/src/liballoc/collections/btree/node.rs
@@ -306,7 +306,7 @@ impl<K, V> Root<K, V> {
 ///   `NodeRef` could be pointing to either type of node.
 ///   Note that in case of a leaf node, this might still be the shared root!
 ///   Only turn this into a `LeafNode` reference if you know it is not the shared root!
-///   Shared references must be dereferencable *for the entire size of their pointee*,
+///   Shared references must be dereferenceable *for the entire size of their pointee*,
 ///   so '&LeafNode` or `&InternalNode` pointing to the shared root is undefined behavior.
 ///   Turning this into a `NodeHeader` reference is always safe.
 pub struct NodeRef<BorrowType, K, V, Type> {
diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs
index a9b4e3e4706..e10d0db9d9a 100644
--- a/src/liballoc/collections/linked_list.rs
+++ b/src/liballoc/collections/linked_list.rs
@@ -841,10 +841,10 @@ impl<T> LinkedList<T> {
     /// d.push_front(2);
     /// d.push_front(3);
     ///
-    /// let mut splitted = d.split_off(2);
+    /// let mut split = d.split_off(2);
     ///
-    /// assert_eq!(splitted.pop_front(), Some(1));
-    /// assert_eq!(splitted.pop_front(), None);
+    /// assert_eq!(split.pop_front(), Some(1));
+    /// assert_eq!(split.pop_front(), None);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn split_off(&mut self, at: usize) -> LinkedList<T> {
diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs
index 85d1d98b8a9..9d56f17700a 100644
--- a/src/liballoc/collections/vec_deque.rs
+++ b/src/liballoc/collections/vec_deque.rs
@@ -2132,7 +2132,7 @@ impl<T> VecDeque<T> {
     // Safety: the following two methods require that the rotation amount
     // be less than half the length of the deque.
     //
-    // `wrap_copy` requres that `min(x, cap() - x) + copy_len <= cap()`,
+    // `wrap_copy` requires that `min(x, cap() - x) + copy_len <= cap()`,
     // but than `min` is never more than half the capacity, regardless of x,
     // so it's sound to call here because we're calling with something
     // less than half the length, which is never above half the capacity.
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs
index 3fd7be06fd4..05f3dd28e98 100644
--- a/src/liballoc/vec.rs
+++ b/src/liballoc/vec.rs
@@ -2894,7 +2894,7 @@ where
     /// The filter test predicate.
     pred: F,
     /// A flag that indicates a panic has occurred in the filter test prodicate.
-    /// This is used as a hint in the drop implmentation to prevent consumption
+    /// This is used as a hint in the drop implementation to prevent consumption
     /// of the remainder of the `DrainFilter`. Any unprocessed items will be
     /// backshifted in the `vec`, but no further items will be dropped or
     /// tested by the filter predicate.
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index 993b1073493..b13e9bcc6b4 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -255,7 +255,7 @@ pub struct ArgumentV1<'a> {
     formatter: fn(&Opaque, &mut Formatter<'_>) -> Result,
 }
 
-// This gurantees a single stable value for the function pointer associated with
+// This guarantees a single stable value for the function pointer associated with
 // indices/counts in the formatting infrastructure.
 //
 // Note that a function defined as such would not be correct as functions are
diff --git a/src/libcore/mem/manually_drop.rs b/src/libcore/mem/manually_drop.rs
index 4c3b81ea5ec..9e5c2b10d0d 100644
--- a/src/libcore/mem/manually_drop.rs
+++ b/src/libcore/mem/manually_drop.rs
@@ -93,7 +93,7 @@ impl<T> ManuallyDrop<T> {
     /// Instead of using [`ManuallyDrop::drop`] to manually drop the value,
     /// you can use this method to take the value and use it however desired.
     ///
-    /// Whenever possible, it is preferrable to use [`into_inner`][`ManuallyDrop::into_inner`]
+    /// Whenever possible, it is preferable to use [`into_inner`][`ManuallyDrop::into_inner`]
     /// instead, which prevents duplicating the content of the `ManuallyDrop<T>`.
     ///
     /// # Safety
diff --git a/src/libcore/mem/mod.rs b/src/libcore/mem/mod.rs
index 1120d6d4bc5..90144d11dc9 100644
--- a/src/libcore/mem/mod.rs
+++ b/src/libcore/mem/mod.rs
@@ -91,7 +91,7 @@ pub use crate::intrinsics::transmute;
 /// Using `ManuallyDrop` here has two advantages:
 ///
 /// * We do not "touch" `v` after disassembling it. For some types, operations
-///   such as passing ownership (to a funcion like `mem::forget`) requires them to actually
+///   such as passing ownership (to a function like `mem::forget`) requires them to actually
 ///   be fully owned right now; that is a promise we do not want to make here as we are
 ///   in the process of transferring ownership to the new `String` we are building.
 /// * In case of an unexpected panic, `ManuallyDrop` is not dropped, but if the panic
diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs
index 676d2c784ac..774ecd997c2 100644
--- a/src/libcore/pin.rs
+++ b/src/libcore/pin.rs
@@ -312,7 +312,7 @@
 //!
 //! ## Examples
 //!
-//! For a type like [`Vec<T>`], both possibilites (structural pinning or not) make sense.
+//! For a type like [`Vec<T>`], both possibilities (structural pinning or not) make sense.
 //! A [`Vec<T>`] with structural pinning could have `get_pin`/`get_pin_mut` methods to get
 //! pinned references to elements. However, it could *not* allow calling
 //! [`pop`][Vec::pop] on a pinned [`Vec<T>`] because that would move the (structurally pinned)
@@ -539,7 +539,7 @@ impl<P: Deref> Pin<P> {
     /// ```
     /// A value, once pinned, must remain pinned forever (unless its type implements `Unpin`).
     ///
-    /// Similarily, calling `Pin::new_unchecked` on an `Rc<T>` is unsafe because there could be
+    /// Similarly, calling `Pin::new_unchecked` on an `Rc<T>` is unsafe because there could be
     /// aliases to the same data that are not subject to the pinning restrictions:
     /// ```
     /// use std::rc::Rc;
diff --git a/src/libcore/ptr/const_ptr.rs b/src/libcore/ptr/const_ptr.rs
index fc3c02e1f06..a540016854d 100644
--- a/src/libcore/ptr/const_ptr.rs
+++ b/src/libcore/ptr/const_ptr.rs
@@ -53,7 +53,7 @@ impl<T: ?Sized> *const T {
     /// all of the following is true:
     /// - it is properly aligned
     /// - it must point to an initialized instance of T; in particular, the pointer must be
-    ///   "dereferencable" in the sense defined [here].
+    ///   "dereferenceable" in the sense defined [here].
     ///
     /// This applies even if the result of this method is unused!
     /// (The part about being initialized is not yet fully decided, but until
@@ -183,7 +183,7 @@ impl<T: ?Sized> *const T {
     /// within the same allocated object: [`offset`] is immediate Undefined Behavior when
     /// crossing object boundaries; `wrapping_offset` produces a pointer but still leads
     /// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized
-    /// better and is thus preferrable in performance-sensitive code.
+    /// better and is thus preferable in performance-sensitive code.
     ///
     /// If you need to cross object boundaries, cast the pointer to an integer and
     /// do the arithmetic there.
@@ -480,7 +480,7 @@ impl<T: ?Sized> *const T {
     /// within the same allocated object: [`add`] is immediate Undefined Behavior when
     /// crossing object boundaries; `wrapping_add` produces a pointer but still leads
     /// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized
-    /// better and is thus preferrable in performance-sensitive code.
+    /// better and is thus preferable in performance-sensitive code.
     ///
     /// If you need to cross object boundaries, cast the pointer to an integer and
     /// do the arithmetic there.
@@ -535,7 +535,7 @@ impl<T: ?Sized> *const T {
     /// within the same allocated object: [`sub`] is immediate Undefined Behavior when
     /// crossing object boundaries; `wrapping_sub` produces a pointer but still leads
     /// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized
-    /// better and is thus preferrable in performance-sensitive code.
+    /// better and is thus preferable in performance-sensitive code.
     ///
     /// If you need to cross object boundaries, cast the pointer to an integer and
     /// do the arithmetic there.
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs
index fcfa98d8507..72c46f58fcc 100644
--- a/src/libcore/ptr/mod.rs
+++ b/src/libcore/ptr/mod.rs
@@ -19,7 +19,7 @@
 //! * All pointers (except for the null pointer) are valid for all operations of
 //!   [size zero][zst].
 //! * For a pointer to be valid, it is necessary, but not always sufficient, that the pointer
-//!   be *dereferencable*: the memory range of the given size starting at the pointer must all be
+//!   be *dereferenceable*: the memory range of the given size starting at the pointer must all be
 //!   within the bounds of a single allocated object. Note that in Rust,
 //!   every (stack-allocated) variable is considered a separate allocated object.
 //! * All accesses performed by functions in this module are *non-atomic* in the sense
diff --git a/src/libcore/ptr/mut_ptr.rs b/src/libcore/ptr/mut_ptr.rs
index 4bc0a3e9faa..01d830ca186 100644
--- a/src/libcore/ptr/mut_ptr.rs
+++ b/src/libcore/ptr/mut_ptr.rs
@@ -49,7 +49,7 @@ impl<T: ?Sized> *mut T {
     /// memory.
     ///
     /// When calling this method, you have to ensure that if the pointer is
-    /// non-NULL, then it is properly aligned, dereferencable (for the whole
+    /// non-NULL, then it is properly aligned, dereferenceable (for the whole
     /// size of `T`) and points to an initialized instance of `T`. This applies
     /// even if the result of this method is unused!
     /// (The part about being initialized is not yet fully decided, but until
@@ -176,7 +176,7 @@ impl<T: ?Sized> *mut T {
     /// within the same allocated object: [`offset`] is immediate Undefined Behavior when
     /// crossing object boundaries; `wrapping_offset` produces a pointer but still leads
     /// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized
-    /// better and is thus preferrable in performance-sensitive code.
+    /// better and is thus preferable in performance-sensitive code.
     ///
     /// If you need to cross object boundaries, cast the pointer to an integer and
     /// do the arithmetic there.
@@ -224,7 +224,7 @@ impl<T: ?Sized> *mut T {
     /// all of the following is true:
     /// - it is properly aligned
     /// - it must point to an initialized instance of T; in particular, the pointer must be
-    ///   "dereferencable" in the sense defined [here].
+    ///   "dereferenceable" in the sense defined [here].
     ///
     /// This applies even if the result of this method is unused!
     /// (The part about being initialized is not yet fully decided, but until
@@ -526,7 +526,7 @@ impl<T: ?Sized> *mut T {
     /// within the same allocated object: [`add`] is immediate Undefined Behavior when
     /// crossing object boundaries; `wrapping_add` produces a pointer but still leads
     /// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized
-    /// better and is thus preferrable in performance-sensitive code.
+    /// better and is thus preferable in performance-sensitive code.
     ///
     /// If you need to cross object boundaries, cast the pointer to an integer and
     /// do the arithmetic there.
@@ -581,7 +581,7 @@ impl<T: ?Sized> *mut T {
     /// within the same allocated object: [`sub`] is immediate Undefined Behavior when
     /// crossing object boundaries; `wrapping_sub` produces a pointer but still leads
     /// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized
-    /// better and is thus preferrable in performance-sensitive code.
+    /// better and is thus preferable in performance-sensitive code.
     ///
     /// If you need to cross object boundaries, cast the pointer to an integer and
     /// do the arithmetic there.
diff --git a/src/libcore/tests/num/dec2flt/mod.rs b/src/libcore/tests/num/dec2flt/mod.rs
index a1fa5556ae5..509097fdb54 100644
--- a/src/libcore/tests/num/dec2flt/mod.rs
+++ b/src/libcore/tests/num/dec2flt/mod.rs
@@ -44,7 +44,7 @@ fn ordinary() {
 #[test]
 fn special_code_paths() {
     test_literal!(36893488147419103229.0); // 2^65 - 3, triggers half-to-even with even significand
-    test_literal!(101e-33); // Triggers the tricky underflow case in AlgorithmM (for f32)
+    test_literal!(101e-33); // Triggers the tricky underflow case in algorithm (for f32)
     test_literal!(1e23); // Triggers AlgorithmR
     test_literal!(2075e23); // Triggers another path through AlgorithmR
     test_literal!(8713e-23); // ... and yet another.
diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs
index 9ca7eee999f..e138503b508 100644
--- a/src/libfmt_macros/lib.rs
+++ b/src/libfmt_macros/lib.rs
@@ -176,7 +176,7 @@ pub struct Parser<'a> {
     skips: Vec<usize>,
     /// Span of the last opening brace seen, used for error reporting
     last_opening_brace: Option<InnerSpan>,
-    /// Wether the source string is comes from `println!` as opposed to `format!` or `print!`
+    /// Whether the source string is comes from `println!` as opposed to `format!` or `print!`
     append_newline: bool,
 }
 
diff --git a/src/libproc_macro/bridge/client.rs b/src/libproc_macro/bridge/client.rs
index dd948025c91..088db92253a 100644
--- a/src/libproc_macro/bridge/client.rs
+++ b/src/libproc_macro/bridge/client.rs
@@ -15,7 +15,7 @@ macro_rules! define_handles {
         }
 
         impl HandleCounters {
-            // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
+            // FIXME(eddyb) use a reference to the `static COUNTERS`, instead of
             // a wrapper `fn` pointer, once `const fn` can reference `static`s.
             extern "C" fn get() -> &'static Self {
                 static COUNTERS: HandleCounters = HandleCounters {
@@ -334,7 +334,7 @@ impl Bridge<'_> {
 #[repr(C)]
 #[derive(Copy, Clone)]
 pub struct Client<F> {
-    // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
+    // FIXME(eddyb) use a reference to the `static COUNTERS`, instead of
     // a wrapper `fn` pointer, once `const fn` can reference `static`s.
     pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters,
     pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer<u8>,
diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs
index bd26e02efb7..0f129904b43 100644
--- a/src/librustc/hir/map/mod.rs
+++ b/src/librustc/hir/map/mod.rs
@@ -653,7 +653,7 @@ impl<'hir> Map<'hir> {
         }
     }
 
-    /// Wether `hir_id` corresponds to a `mod` or a crate.
+    /// Whether `hir_id` corresponds to a `mod` or a crate.
     pub fn is_hir_id_module(&self, hir_id: HirId) -> bool {
         match self.lookup(hir_id) {
             Some(Entry { node: Node::Item(Item { kind: ItemKind::Mod(_), .. }), .. })
diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs
index c8d35db0ade..546ba586d30 100644
--- a/src/librustc/mir/interpret/allocation.rs
+++ b/src/librustc/mir/interpret/allocation.rs
@@ -610,7 +610,7 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
         // a naive undef mask copying algorithm would repeatedly have to read the undef mask from
         // the source and write it to the destination. Even if we optimized the memory accesses,
         // we'd be doing all of this `repeat` times.
-        // Therefor we precompute a compressed version of the undef mask of the source value and
+        // Therefore we precompute a compressed version of the undef mask of the source value and
         // then write it back `repeat` times without computing any more information from the source.
 
         // A precomputed cache for ranges of defined/undefined bits
diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs
index 7a5a417919d..e257b48f111 100644
--- a/src/librustc/ty/layout.rs
+++ b/src/librustc/ty/layout.rs
@@ -2579,7 +2579,7 @@ where
                 if let Some(kind) = pointee.safe {
                     attrs.pointee_align = Some(pointee.align);
 
-                    // `Box` (`UniqueBorrowed`) are not necessarily dereferencable
+                    // `Box` (`UniqueBorrowed`) are not necessarily dereferenceable
                     // for the entire duration of the function as they can be deallocated
                     // any time. Set their valid size to 0.
                     attrs.pointee_size = match kind {
diff --git a/src/librustc/ty/print/mod.rs b/src/librustc/ty/print/mod.rs
index 3ade9661917..8d784833bd3 100644
--- a/src/librustc/ty/print/mod.rs
+++ b/src/librustc/ty/print/mod.rs
@@ -97,7 +97,7 @@ pub trait Printer<'tcx>: Sized {
         args: &[GenericArg<'tcx>],
     ) -> Result<Self::Path, Self::Error>;
 
-    // Defaults (should not be overriden):
+    // Defaults (should not be overridden):
 
     fn default_print_def_path(
         self,
diff --git a/src/librustc/ty/print/pretty.rs b/src/librustc/ty/print/pretty.rs
index 4829955cb70..05dcc9e85ac 100644
--- a/src/librustc/ty/print/pretty.rs
+++ b/src/librustc/ty/print/pretty.rs
@@ -221,7 +221,7 @@ pub trait PrettyPrinter<'tcx>:
     /// This is typically the case for all non-`'_` regions.
     fn region_should_not_be_omitted(&self, region: ty::Region<'_>) -> bool;
 
-    // Defaults (should not be overriden):
+    // Defaults (should not be overridden):
 
     /// If possible, this returns a global path resolving to `def_id` that is visible
     /// from at least one local module, and returns `true`. If the crate defining `def_id` is
@@ -236,7 +236,7 @@ pub trait PrettyPrinter<'tcx>:
     /// post-process it into the valid and visible version that
     /// accounts for re-exports.
     ///
-    /// This method should only be callled by itself or
+    /// This method should only be called by itself or
     /// `try_print_visible_def_path`.
     ///
     /// `callers` is a chain of visible_parent's leading to `def_id`,
@@ -685,7 +685,7 @@ pub trait PrettyPrinter<'tcx>:
                 if self.tcx().sess.verbose() {
                     p!(write("{:?}", sz));
                 } else if let ty::ConstKind::Unevaluated(..) = sz.val {
-                    // do not try to evalute unevaluated constants. If we are const evaluating an
+                    // do not try to evaluate unevaluated constants. If we are const evaluating an
                     // array length anon const, rustc will (with debug assertions) print the
                     // constant's path. Which will end up here again.
                     p!(write("_"));
diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs
index 5e36e4df698..9c1db7c5f2b 100644
--- a/src/librustc/ty/query/on_disk_cache.rs
+++ b/src/librustc/ty/query/on_disk_cache.rs
@@ -425,7 +425,7 @@ impl<'sess> OnDiskCache<'sess> {
 
 //- DECODING -------------------------------------------------------------------
 
-/// A decoder that can read fro the incr. comp. cache. It is similar to the one
+/// A decoder that can read from the incr. comp. cache. It is similar to the one
 /// we use for crate metadata decoding in that it can rebase spans and eventually
 /// will also handle things that contain `Ty` instances.
 struct CacheDecoder<'a, 'tcx> {
diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs
index a61256b9fcb..c94909549df 100644
--- a/src/librustc/ty/query/plumbing.rs
+++ b/src/librustc/ty/query/plumbing.rs
@@ -1053,7 +1053,7 @@ macro_rules! define_queries_inner {
 
         impl TyCtxt<$tcx> {
             /// Returns a transparent wrapper for `TyCtxt`, which ensures queries
-            /// are executed instead of just returing their results.
+            /// are executed instead of just returning their results.
             #[inline(always)]
             pub fn ensure(self) -> TyCtxtEnsure<$tcx> {
                 TyCtxtEnsure {
diff --git a/src/librustc/ty/relate.rs b/src/librustc/ty/relate.rs
index 3b9df72266f..8da82a80dd3 100644
--- a/src/librustc/ty/relate.rs
+++ b/src/librustc/ty/relate.rs
@@ -72,7 +72,7 @@ pub trait TypeRelation<'tcx>: Sized {
         b: &T,
     ) -> RelateResult<'tcx, T>;
 
-    // Overrideable relations. You shouldn't typically call these
+    // Overridable relations. You shouldn't typically call these
     // directly, instead call `relate()`, which in turn calls
     // these. This is both more uniform but also allows us to add
     // additional hooks for other types in the future if needed
diff --git a/src/librustc_ast/ast.rs b/src/librustc_ast/ast.rs
index 7cc045ef344..88a96dc6c69 100644
--- a/src/librustc_ast/ast.rs
+++ b/src/librustc_ast/ast.rs
@@ -1078,7 +1078,7 @@ impl Expr {
 
             // If binary operator is `Add` and both `lhs` and `rhs` are trait bounds,
             // then type of result is trait object.
-            // Othewise we don't assume the result type.
+            // Otherwise we don't assume the result type.
             ExprKind::Binary(binop, lhs, rhs) if binop.node == BinOpKind::Add => {
                 if let (Some(lhs), Some(rhs)) = (lhs.to_bound(), rhs.to_bound()) {
                     TyKind::TraitObject(vec![lhs, rhs], TraitObjectSyntax::None)
@@ -2089,7 +2089,7 @@ impl Async {
         if let Async::Yes { .. } = self { true } else { false }
     }
 
-    /// In ths case this is an `async` return, the `NodeId` for the generated `impl Trait` item.
+    /// In this case this is an `async` return, the `NodeId` for the generated `impl Trait` item.
     pub fn opt_return_id(self) -> Option<NodeId> {
         match self {
             Async::Yes { return_impl_trait_id, .. } => Some(return_impl_trait_id),
diff --git a/src/librustc_ast_lowering/lib.rs b/src/librustc_ast_lowering/lib.rs
index df71b05ac2c..dd9526ccee4 100644
--- a/src/librustc_ast_lowering/lib.rs
+++ b/src/librustc_ast_lowering/lib.rs
@@ -1096,7 +1096,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
         match arg {
             ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(&lt)),
             ast::GenericArg::Type(ty) => {
-                // We parse const arguments as path types as we cannot distiguish them durring
+                // We parse const arguments as path types as we cannot distinguish them during
                 // parsing. We try to resolve that ambiguity by attempting resolution in both the
                 // type and value namespaces. If we resolved the path in the value namespace, we
                 // transform it into a generic const argument.
diff --git a/src/librustc_builtin_macros/format.rs b/src/librustc_builtin_macros/format.rs
index d6b8b8cafb7..1baec5eafe6 100644
--- a/src/librustc_builtin_macros/format.rs
+++ b/src/librustc_builtin_macros/format.rs
@@ -904,7 +904,7 @@ pub fn expand_preparsed_format_args(
     };
 
     /// Finds the indices of all characters that have been processed and differ between the actual
-    /// written code (code snippet) and the `InternedString` that get's processed in the `Parser`
+    /// written code (code snippet) and the `InternedString` that gets processed in the `Parser`
     /// in order to properly synthethise the intra-string `Span`s for error diagnostics.
     fn find_skips(snippet: &str, is_raw: bool) -> Vec<usize> {
         let mut eat_ws = false;
diff --git a/src/librustc_codegen_llvm/back/lto.rs b/src/librustc_codegen_llvm/back/lto.rs
index a39c25f6693..310cae978bf 100644
--- a/src/librustc_codegen_llvm/back/lto.rs
+++ b/src/librustc_codegen_llvm/back/lto.rs
@@ -504,7 +504,7 @@ fn thin_lto(
             //
             // This strategy means we can always save the computed imports as
             // canon: when we reuse the post-ThinLTO version, condition (3.)
-            // ensures that the curent import set is the same as the previous
+            // ensures that the current import set is the same as the previous
             // one. (And of course, when we don't reuse the post-ThinLTO
             // version, the current import set *is* the correct one, since we
             // are doing the ThinLTO in this current compilation cycle.)
@@ -538,7 +538,7 @@ fn thin_lto(
             }));
         }
 
-        // Save the curent ThinLTO import information for the next compilation
+        // Save the current ThinLTO import information for the next compilation
         // session, overwriting the previous serialized imports (if any).
         if let Some(path) = import_map_path {
             if let Err(err) = curr_import_map.save_to_file(&path) {
diff --git a/src/librustc_codegen_llvm/back/profiling.rs b/src/librustc_codegen_llvm/back/profiling.rs
index d56ddac699b..2741f7d848e 100644
--- a/src/librustc_codegen_llvm/back/profiling.rs
+++ b/src/librustc_codegen_llvm/back/profiling.rs
@@ -9,8 +9,8 @@ fn llvm_args_to_string_id(profiler: &SelfProfiler, pass_name: &str, ir_name: &st
     let mut components = vec![StringComponent::Ref(pass_name)];
     // handle that LazyCallGraph::SCC is a comma separated list within parentheses
     let parentheses: &[_] = &['(', ')'];
-    let trimed = ir_name.trim_matches(parentheses);
-    for part in trimed.split(", ") {
+    let trimmed = ir_name.trim_matches(parentheses);
+    for part in trimmed.split(", ") {
         let demangled_ir_name = rustc_demangle::demangle(part).to_string();
         let ir_name = profiler.get_or_alloc_cached_string(demangled_ir_name);
         components.push(StringComponent::Value(SEPARATOR_BYTE));
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs
index 3916653eb1d..cc9a51cf26b 100644
--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs
+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs
@@ -637,7 +637,7 @@ pub fn type_metadata(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>, usage_site_span: Sp
                 unsafe {
                     // The choice of type here is pretty arbitrary -
                     // anything reading the debuginfo for a recursive
-                    // type is going to see *somthing* weird - the only
+                    // type is going to see *something* weird - the only
                     // question is what exactly it will see.
                     let (size, align) = cx.size_and_align_of(t);
                     llvm::LLVMRustDIBuilderCreateBasicType(
diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs
index b313bf57d4a..3afa4758253 100644
--- a/src/librustc_codegen_ssa/back/write.rs
+++ b/src/librustc_codegen_ssa/back/write.rs
@@ -736,7 +736,7 @@ fn execute_work_item<B: ExtraBackendMethods>(
     }
 }
 
-// Actual LTO type we end up chosing based on multiple factors.
+// Actual LTO type we end up choosing based on multiple factors.
 enum ComputedLtoType {
     No,
     Thin,
diff --git a/src/librustc_codegen_ssa/traits/mod.rs b/src/librustc_codegen_ssa/traits/mod.rs
index b8afadaadef..d03ff8d4d37 100644
--- a/src/librustc_codegen_ssa/traits/mod.rs
+++ b/src/librustc_codegen_ssa/traits/mod.rs
@@ -8,7 +8,7 @@
 //! actual codegen, while the builder stores the information about the function during codegen and
 //! is used to produce the instructions of the backend IR.
 //!
-//! Finaly, a third `Backend` structure has to implement methods related to how codegen information
+//! Finally, a third `Backend` structure has to implement methods related to how codegen information
 //! is passed to the backend, especially for asynchronous compilation.
 //!
 //! The traits contain associated types that are backend-specific, such as the backend's value or
diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs
index 6713459f627..cfde09fad62 100644
--- a/src/librustc_codegen_utils/symbol_names.rs
+++ b/src/librustc_codegen_utils/symbol_names.rs
@@ -185,7 +185,7 @@ fn compute_symbol_name(
     //
     // * On the wasm32 targets there is a bug (or feature) in LLD [1] where the
     //   same-named symbol when imported from different wasm modules will get
-    //   hooked up incorectly. As a result foreign symbols, on the wasm target,
+    //   hooked up incorrectly. As a result foreign symbols, on the wasm target,
     //   with a wasm import module, get mangled. Additionally our codegen will
     //   deduplicate symbols based purely on the symbol name, but for wasm this
     //   isn't quite right because the same-named symbol on wasm can come from
diff --git a/src/librustc_data_structures/graph/vec_graph/tests.rs b/src/librustc_data_structures/graph/vec_graph/tests.rs
index 1db8bd4b102..c8f97926717 100644
--- a/src/librustc_data_structures/graph/vec_graph/tests.rs
+++ b/src/librustc_data_structures/graph/vec_graph/tests.rs
@@ -23,7 +23,7 @@ fn num_nodes() {
 }
 
 #[test]
-fn succesors() {
+fn successors() {
     let graph = create_graph();
     assert_eq!(graph.successors(0), &[1]);
     assert_eq!(graph.successors(1), &[2, 3]);
diff --git a/src/librustc_data_structures/sharded.rs b/src/librustc_data_structures/sharded.rs
index 15d1e2dd0b6..d08d46a7414 100644
--- a/src/librustc_data_structures/sharded.rs
+++ b/src/librustc_data_structures/sharded.rs
@@ -13,7 +13,7 @@ struct CacheAligned<T>(T);
 #[cfg(parallel_compiler)]
 // 32 shards is sufficient to reduce contention on an 8-core Ryzen 7 1700,
 // but this should be tested on higher core count CPUs. How the `Sharded` type gets used
-// may also affect the ideal nunber of shards.
+// may also affect the ideal number of shards.
 const SHARD_BITS: usize = 5;
 
 #[cfg(not(parallel_compiler))]
@@ -41,7 +41,7 @@ impl<T> Sharded<T> {
         let mut values: SmallVec<[_; SHARDS]> =
             (0..SHARDS).map(|_| CacheAligned(Lock::new(value()))).collect();
 
-        // Create an unintialized array
+        // Create an uninitialized array
         let mut shards: mem::MaybeUninit<[CacheAligned<Lock<T>>; SHARDS]> =
             mem::MaybeUninit::uninit();
 
diff --git a/src/librustc_error_codes/error_codes/E0326.md b/src/librustc_error_codes/error_codes/E0326.md
index 3d357819c7f..bc522e9cf40 100644
--- a/src/librustc_error_codes/error_codes/E0326.md
+++ b/src/librustc_error_codes/error_codes/E0326.md
@@ -1,4 +1,4 @@
-An implementation of a trait doesn't match the type contraint.
+An implementation of a trait doesn't match the type constraint.
 
 Erroneous code example:
 
diff --git a/src/librustc_error_codes/error_codes/E0591.md b/src/librustc_error_codes/error_codes/E0591.md
index 782d4cf29c3..7f68815b1c2 100644
--- a/src/librustc_error_codes/error_codes/E0591.md
+++ b/src/librustc_error_codes/error_codes/E0591.md
@@ -54,7 +54,7 @@ This pattern should be rewritten. There are a few possible ways to do this:
 
 - change the original fn declaration to match the expected signature,
   and do the cast in the fn body (the preferred option)
-- cast the fn item fo a fn pointer before calling transmute, as shown here:
+- cast the fn item of a fn pointer before calling transmute, as shown here:
 
     ```
     # extern "C" fn foo(_: Box<i32>) {}
diff --git a/src/librustc_expand/mbe/macro_rules.rs b/src/librustc_expand/mbe/macro_rules.rs
index b02c9350395..51b172a2114 100644
--- a/src/librustc_expand/mbe/macro_rules.rs
+++ b/src/librustc_expand/mbe/macro_rules.rs
@@ -991,7 +991,7 @@ fn token_can_be_followed_by_any(tok: &mbe::TokenTree) -> bool {
     if let mbe::TokenTree::MetaVarDecl(_, _, frag_spec) = *tok {
         frag_can_be_followed_by_any(frag_spec.name)
     } else {
-        // (Non NT's can always be followed by anthing in matchers.)
+        // (Non NT's can always be followed by anything in matchers.)
         true
     }
 }
diff --git a/src/librustc_expand/proc_macro.rs b/src/librustc_expand/proc_macro.rs
index 84a546345bb..5404ee192a6 100644
--- a/src/librustc_expand/proc_macro.rs
+++ b/src/librustc_expand/proc_macro.rs
@@ -133,7 +133,7 @@ impl MultiItemModifier for ProcMacroDerive {
         };
 
         let error_count_before = ecx.parse_sess.span_diagnostic.err_count();
-        let msg = "proc-macro derive produced unparseable tokens";
+        let msg = "proc-macro derive produced unparsable tokens";
 
         let mut parser =
             rustc_parse::stream_to_parser(ecx.parse_sess, stream, Some("proc-macro derive"));
diff --git a/src/librustc_feature/active.rs b/src/librustc_feature/active.rs
index 6517a22701b..642a3bf8964 100644
--- a/src/librustc_feature/active.rs
+++ b/src/librustc_feature/active.rs
@@ -387,7 +387,7 @@ declare_features! (
     /// Allows defining `trait X = A + B;` alias items.
     (active, trait_alias, "1.24.0", Some(41517), None),
 
-    /// Allows infering `'static` outlives requirements (RFC 2093).
+    /// Allows inferring `'static` outlives requirements (RFC 2093).
     (active, infer_static_outlives_requirements, "1.26.0", Some(54185), None),
 
     /// Allows accessing fields of unions inside `const` functions.
diff --git a/src/librustc_feature/builtin_attrs.rs b/src/librustc_feature/builtin_attrs.rs
index c140adf64d5..9810c0cfe66 100644
--- a/src/librustc_feature/builtin_attrs.rs
+++ b/src/librustc_feature/builtin_attrs.rs
@@ -175,7 +175,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
     // Stable attributes:
     // ==========================================================================
 
-    // Condtional compilation:
+    // Conditional compilation:
     ungated!(cfg, Normal, template!(List: "predicate")),
     ungated!(cfg_attr, Normal, template!(List: "predicate, attr1, attr2, ...")),
 
diff --git a/src/librustc_infer/infer/error_reporting/mod.rs b/src/librustc_infer/infer/error_reporting/mod.rs
index bd133738db7..40b493de9f4 100644
--- a/src/librustc_infer/infer/error_reporting/mod.rs
+++ b/src/librustc_infer/infer/error_reporting/mod.rs
@@ -1819,7 +1819,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
                     "{} may not live long enough",
                     labeled_user_string
                 );
-                // Explicitely use the name instead of `sub`'s `Display` impl. The `Display` impl
+                // Explicitly use the name instead of `sub`'s `Display` impl. The `Display` impl
                 // for the bound is not suitable for suggestions when `-Zverbose` is set because it
                 // uses `Debug` output, so we handle it specially here so that suggestions are
                 // always correct.
diff --git a/src/librustc_infer/infer/error_reporting/need_type_info.rs b/src/librustc_infer/infer/error_reporting/need_type_info.rs
index a1e6a0a325a..285f0c9cf51 100644
--- a/src/librustc_infer/infer/error_reporting/need_type_info.rs
+++ b/src/librustc_infer/infer/error_reporting/need_type_info.rs
@@ -391,7 +391,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
             err.span_label(pattern.span, msg);
         } else if let Some(e) = local_visitor.found_method_call {
             if let ExprKind::MethodCall(segment, ..) = &e.kind {
-                // Suggest specifiying type params or point out the return type of the call:
+                // Suggest specifying type params or point out the return type of the call:
                 //
                 // error[E0282]: type annotations needed
                 //   --> $DIR/type-annotations-needed-expr.rs:2:39
diff --git a/src/librustc_infer/infer/mod.rs b/src/librustc_infer/infer/mod.rs
index 6adddf2500c..938a0e7ab39 100644
--- a/src/librustc_infer/infer/mod.rs
+++ b/src/librustc_infer/infer/mod.rs
@@ -1667,14 +1667,14 @@ impl<'a, 'tcx> ShallowResolver<'a, 'tcx> {
 
             ty::IntVar(v) => {
                 // If inlined_probe_value returns a value it's always a
-                // `ty::Int(_)` or `ty::UInt(_)`, which nevers matches a
+                // `ty::Int(_)` or `ty::UInt(_)`, which never matches a
                 // `ty::Infer(_)`.
                 self.infcx.inner.borrow_mut().int_unification_table.inlined_probe_value(v).is_some()
             }
 
             ty::FloatVar(v) => {
                 // If inlined_probe_value returns a value it's always a
-                // `ty::Float(_)`, which nevers matches a `ty::Infer(_)`.
+                // `ty::Float(_)`, which never matches a `ty::Infer(_)`.
                 //
                 // Not `inlined_probe_value(v)` because this call site is colder.
                 self.infcx.inner.borrow_mut().float_unification_table.probe_value(v).is_some()
diff --git a/src/librustc_infer/infer/opaque_types/mod.rs b/src/librustc_infer/infer/opaque_types/mod.rs
index 06d45690e41..4d264008ee3 100644
--- a/src/librustc_infer/infer/opaque_types/mod.rs
+++ b/src/librustc_infer/infer/opaque_types/mod.rs
@@ -264,7 +264,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
     /// ```
     ///
     /// Here we would report a more complex "in constraint", like `'r
-    /// in ['a, 'b, 'static]` (where `'r` is some regon appearing in
+    /// in ['a, 'b, 'static]` (where `'r` is some region appearing in
     /// the hidden type).
     ///
     /// # Constrain regions, not the hidden concrete type
diff --git a/src/librustc_infer/infer/resolve.rs b/src/librustc_infer/infer/resolve.rs
index e2207d08ee6..6bf123114dc 100644
--- a/src/librustc_infer/infer/resolve.rs
+++ b/src/librustc_infer/infer/resolve.rs
@@ -169,7 +169,7 @@ where
 }
 
 // N.B. This type is not public because the protocol around checking the
-// `err` field is not enforcable otherwise.
+// `err` field is not enforceable otherwise.
 struct FullTypeResolver<'a, 'tcx> {
     infcx: &'a InferCtxt<'a, 'tcx>,
     err: Option<FixupError<'tcx>>,
diff --git a/src/librustc_infer/traits/auto_trait.rs b/src/librustc_infer/traits/auto_trait.rs
index 3166fe06576..39be8fc1c0f 100644
--- a/src/librustc_infer/traits/auto_trait.rs
+++ b/src/librustc_infer/traits/auto_trait.rs
@@ -455,7 +455,7 @@ impl AutoTraitFinder<'tcx> {
                                     // predicate has some other kind of region. An region
                                     // variable isn't something we can actually display to a user,
                                     // so we choose their new predicate (which doesn't have a region
-                                    // varaible).
+                                    // variable).
                                     //
                                     // In both cases, we want to remove the old predicate,
                                     // from `user_computed_preds`, and replace it with the new
@@ -701,7 +701,7 @@ impl AutoTraitFinder<'tcx> {
                     //  some subobligations. We then process these subobligations
                     //  like any other generated sub-obligations.
                     //
-                    // 3. We receieve an 'ambiguous' result (Ok(None))
+                    // 3. We receive an 'ambiguous' result (Ok(None))
                     // If we were actually trying to compile a crate,
                     // we would need to re-process this obligation later.
                     // However, all we care about is finding out what bounds
diff --git a/src/librustc_infer/traits/coherence.rs b/src/librustc_infer/traits/coherence.rs
index 0dec5ae6da5..15c5f4d402a 100644
--- a/src/librustc_infer/traits/coherence.rs
+++ b/src/librustc_infer/traits/coherence.rs
@@ -505,7 +505,7 @@ fn ty_is_non_local_constructor<'tcx>(ty: Ty<'tcx>, in_crate: InCrate) -> Option<
             //
             // We choose to treat all opaque types as non-local, even
             // those that appear within the same crate. This seems
-            // somewhat suprising at first, but makes sense when
+            // somewhat surprising at first, but makes sense when
             // you consider that opaque types are supposed to hide
             // the underlying type *within the same crate*. When an
             // opaque type is used from outside the module
diff --git a/src/librustc_infer/traits/error_reporting/mod.rs b/src/librustc_infer/traits/error_reporting/mod.rs
index 63c3f827c2e..10143ae015f 100644
--- a/src/librustc_infer/traits/error_reporting/mod.rs
+++ b/src/librustc_infer/traits/error_reporting/mod.rs
@@ -1142,7 +1142,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
                 // we're only talking about builtin traits, which are known to be
                 // inhabited. We used to check for `self.tcx.sess.has_errors()` to
                 // avoid inundating the user with unnecessary errors, but we now
-                // check upstream for type errors and dont add the obligations to
+                // check upstream for type errors and don't add the obligations to
                 // begin with in those cases.
                 if self
                     .tcx
diff --git a/src/librustc_infer/traits/object_safety.rs b/src/librustc_infer/traits/object_safety.rs
index f5bab7cfac9..6f20f5ac47e 100644
--- a/src/librustc_infer/traits/object_safety.rs
+++ b/src/librustc_infer/traits/object_safety.rs
@@ -612,7 +612,7 @@ fn receiver_is_dispatchable<'tcx>(
     };
 
     // the type `U` in the query
-    // use a bogus type parameter to mimick a forall(U) query using u32::MAX for now.
+    // use a bogus type parameter to mimic a forall(U) query using u32::MAX for now.
     // FIXME(mikeyhew) this is a total hack. Once object_safe_for_dispatch is stabilized, we can
     // replace this with `dyn Trait`
     let unsized_self_ty: Ty<'tcx> =
diff --git a/src/librustc_lexer/src/unescape.rs b/src/librustc_lexer/src/unescape.rs
index 4f5e03d008c..c51bf735fa7 100644
--- a/src/librustc_lexer/src/unescape.rs
+++ b/src/librustc_lexer/src/unescape.rs
@@ -17,7 +17,7 @@ pub enum EscapeError {
 
     /// Escaped '\' character without continuation.
     LoneSlash,
-    /// Invalid escape characted (e.g. '\z').
+    /// Invalid escape character (e.g. '\z').
     InvalidEscape,
     /// Raw '\r' encountered.
     BareCarriageReturn,
@@ -43,7 +43,7 @@ pub enum EscapeError {
     UnclosedUnicodeEscape,
     /// '\u{_12}'
     LeadingUnderscoreUnicodeEscape,
-    /// More than 6 charactes in '\u{..}', e.g. '\u{10FFFF_FF}'
+    /// More than 6 characters in '\u{..}', e.g. '\u{10FFFF_FF}'
     OverlongUnicodeEscape,
     /// Invalid in-bound unicode character code, e.g. '\u{DFFF}'.
     LoneSurrogateUnicodeEscape,
diff --git a/src/librustc_macros/src/query.rs b/src/librustc_macros/src/query.rs
index 6362f3c2c49..97b800decc5 100644
--- a/src/librustc_macros/src/query.rs
+++ b/src/librustc_macros/src/query.rs
@@ -57,7 +57,7 @@ enum QueryModifier {
     /// Generate a dep node based on the dependencies of the query
     Anon,
 
-    /// Always evaluate the query, ignoring its depdendencies
+    /// Always evaluate the query, ignoring its dependencies
     EvalAlways,
 }
 
@@ -228,7 +228,7 @@ struct QueryModifiers {
     /// Generate a dep node based on the dependencies of the query
     anon: bool,
 
-    // Always evaluate the query, ignoring its depdendencies
+    // Always evaluate the query, ignoring its dependencies
     eval_always: bool,
 }
 
diff --git a/src/librustc_metadata/locator.rs b/src/librustc_metadata/locator.rs
index 2157b8ce159..efa259d0c4e 100644
--- a/src/librustc_metadata/locator.rs
+++ b/src/librustc_metadata/locator.rs
@@ -711,7 +711,7 @@ impl<'a> CrateLocator<'a> {
         // See also #68149 which provides more detail on why emitting the
         // dependency on the rlib is a bad thing.
         //
-        // We currenty do not verify that these other sources are even in sync,
+        // We currently do not verify that these other sources are even in sync,
         // and this is arguably a bug (see #10786), but because reading metadata
         // is quite slow (especially from dylibs) we currently do not read it
         // from the other crate sources.
diff --git a/src/librustc_metadata/rmeta/mod.rs b/src/librustc_metadata/rmeta/mod.rs
index 9b05fd4734c..1553b6cf0af 100644
--- a/src/librustc_metadata/rmeta/mod.rs
+++ b/src/librustc_metadata/rmeta/mod.rs
@@ -201,7 +201,7 @@ crate struct CrateRoot<'tcx> {
 
     per_def: LazyPerDefTables<'tcx>,
 
-    /// The DefIndex's of any proc macros delcared by this crate.
+    /// The DefIndex's of any proc macros declared by this crate.
     proc_macro_data: Option<Lazy<[DefIndex]>>,
 
     compiler_builtins: bool,
diff --git a/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs b/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
index ca51d16f9f2..6ed4a1d4914 100644
--- a/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
+++ b/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
@@ -1231,7 +1231,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
                 GeneratorKind::Async(async_kind) => match async_kind {
                     AsyncGeneratorKind::Block => "async block",
                     AsyncGeneratorKind::Closure => "async closure",
-                    _ => bug!("async block/closure expected, but async funtion found."),
+                    _ => bug!("async block/closure expected, but async function found."),
                 },
                 GeneratorKind::Gen => "generator",
             },
diff --git a/src/librustc_mir/borrow_check/diagnostics/mutability_errors.rs b/src/librustc_mir/borrow_check/diagnostics/mutability_errors.rs
index d91f6edc980..5c37faaa82a 100644
--- a/src/librustc_mir/borrow_check/diagnostics/mutability_errors.rs
+++ b/src/librustc_mir/borrow_check/diagnostics/mutability_errors.rs
@@ -445,7 +445,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
         err.buffer(&mut self.errors_buffer);
     }
 
-    /// Targetted error when encountering an `FnMut` closure where an `Fn` closure was expected.
+    /// Targeted error when encountering an `FnMut` closure where an `Fn` closure was expected.
     fn expected_fn_found_fn_mut_call(&self, err: &mut DiagnosticBuilder<'_>, sp: Span, act: &str) {
         err.span_label(sp, format!("cannot {}", act));
 
diff --git a/src/librustc_mir/borrow_check/invalidation.rs b/src/librustc_mir/borrow_check/invalidation.rs
index 0bead27050c..d33639aa9d9 100644
--- a/src/librustc_mir/borrow_check/invalidation.rs
+++ b/src/librustc_mir/borrow_check/invalidation.rs
@@ -63,7 +63,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
                 self.mutate_place(location, lhs, Shallow(None), JustWrite);
             }
             StatementKind::FakeRead(_, _) => {
-                // Only relavent for initialized/liveness/safety checks.
+                // Only relevant for initialized/liveness/safety checks.
             }
             StatementKind::SetDiscriminant { ref place, variant_index: _ } => {
                 self.mutate_place(location, place, Shallow(None), JustWrite);
diff --git a/src/librustc_mir/borrow_check/member_constraints.rs b/src/librustc_mir/borrow_check/member_constraints.rs
index aeb29d2e11e..4323e2db844 100644
--- a/src/librustc_mir/borrow_check/member_constraints.rs
+++ b/src/librustc_mir/borrow_check/member_constraints.rs
@@ -125,7 +125,7 @@ where
         // wind up mapped to the same key `S`, we would append the
         // linked list for `Ra` onto the end of the linked list for
         // `Rb` (or vice versa) -- this basically just requires
-        // rewriting the final link from one list to point at the othe
+        // rewriting the final link from one list to point at the other
         // other (see `append_list`).
 
         let MemberConstraintSet { first_constraints, mut constraints, choice_regions } = self;
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index 28974dcd08b..f93f2acfa8a 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -452,7 +452,7 @@ crate struct MirBorrowckCtxt<'cx, 'tcx> {
     /// for the activation of the borrow.
     reservation_warnings:
         FxHashMap<BorrowIndex, (Place<'tcx>, Span, Location, BorrowKind, BorrowData<'tcx>)>,
-    /// This field keeps track of move errors that are to be reported for given move indicies.
+    /// This field keeps track of move errors that are to be reported for given move indices.
     ///
     /// There are situations where many errors can be reported for a single move out (see #53807)
     /// and we want only the best of those errors.
diff --git a/src/librustc_mir/borrow_check/type_check/mod.rs b/src/librustc_mir/borrow_check/type_check/mod.rs
index 652de6c7b6f..ace92949814 100644
--- a/src/librustc_mir/borrow_check/type_check/mod.rs
+++ b/src/librustc_mir/borrow_check/type_check/mod.rs
@@ -579,7 +579,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
             | ConstraintCategory::UseAsConst
             | ConstraintCategory::UseAsStatic = constraint.category
             {
-                // "Returning" from a promoted is an assigment to a
+                // "Returning" from a promoted is an assignment to a
                 // temporary from the user's point of view.
                 constraint.category = ConstraintCategory::Boring;
             }
diff --git a/src/librustc_mir/const_eval/eval_queries.rs b/src/librustc_mir/const_eval/eval_queries.rs
index 1bf748e66e2..7a8e61db6d0 100644
--- a/src/librustc_mir/const_eval/eval_queries.rs
+++ b/src/librustc_mir/const_eval/eval_queries.rs
@@ -226,7 +226,7 @@ pub fn const_eval_validated_provider<'tcx>(
         match tcx.const_eval_validated(key) {
             // try again with reveal all as requested
             Err(ErrorHandled::TooGeneric) => {}
-            // dedupliate calls
+            // deduplicate calls
             other => return other,
         }
     }
@@ -267,7 +267,7 @@ pub fn const_eval_raw_provider<'tcx>(
         match tcx.const_eval_raw(key) {
             // try again with reveal all as requested
             Err(ErrorHandled::TooGeneric) => {}
-            // dedupliate calls
+            // deduplicate calls
             other => return other,
         }
     }
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs
index 7a3f09ac80b..e683422e611 100644
--- a/src/librustc_mir/interpret/eval_context.rs
+++ b/src/librustc_mir/interpret/eval_context.rs
@@ -670,7 +670,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         );
         if cur_unwinding {
             // Follow the unwind edge.
-            let unwind = next_block.expect("Encounted StackPopCleanup::None when unwinding!");
+            let unwind = next_block.expect("Encountered StackPopCleanup::None when unwinding!");
             self.unwind_to_block(unwind);
         } else {
             // Follow the normal return edge.
diff --git a/src/librustc_mir/interpret/machine.rs b/src/librustc_mir/interpret/machine.rs
index 69c9664b351..6615cc608fb 100644
--- a/src/librustc_mir/interpret/machine.rs
+++ b/src/librustc_mir/interpret/machine.rs
@@ -227,7 +227,7 @@ pub trait Machine<'mir, 'tcx>: Sized {
     /// it contains (in relocations) tagged.  The way we construct allocations is
     /// to always first construct it without extra and then add the extra.
     /// This keeps uniform code paths for handling both allocations created by CTFE
-    /// for statics, and allocations ceated by Miri during evaluation.
+    /// for statics, and allocations created by Miri during evaluation.
     ///
     /// `kind` is the kind of the allocation being tagged; it can be `None` when
     /// it's a static and `STATIC_KIND` is `None`.
diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs
index 44b46d65bf1..22b1a7b7137 100644
--- a/src/librustc_mir/interpret/operand.rs
+++ b/src/librustc_mir/interpret/operand.rs
@@ -678,7 +678,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                             // Then computing the absolute variant idx should not overflow any more.
                             let variant_index = variants_start
                                 .checked_add(variant_index_relative)
-                                .expect("oveflow computing absolute variant idx");
+                                .expect("overflow computing absolute variant idx");
                             let variants_len = rval
                                 .layout
                                 .ty
diff --git a/src/librustc_mir/interpret/snapshot.rs b/src/librustc_mir/interpret/snapshot.rs
index 2353b74016c..ee45179fd8b 100644
--- a/src/librustc_mir/interpret/snapshot.rs
+++ b/src/librustc_mir/interpret/snapshot.rs
@@ -292,7 +292,7 @@ where
 
         let all_bytes = 0..self.len();
         // This 'inspect' is okay since following access respects undef and relocations. This does
-        // influence interpreter exeuction, but only to detect the error of cycles in evalution
+        // influence interpreter exeuction, but only to detect the error of cycles in evaluation
         // dependencies.
         let bytes = self.inspect_with_undef_and_ptr_outside_interpreter(all_bytes);
 
diff --git a/src/librustc_mir/transform/add_retag.rs b/src/librustc_mir/transform/add_retag.rs
index a5b467c1e10..67444a26782 100644
--- a/src/librustc_mir/transform/add_retag.rs
+++ b/src/librustc_mir/transform/add_retag.rs
@@ -20,7 +20,7 @@ fn is_stable(place: PlaceRef<'_, '_>) -> bool {
             // Which place this evaluates to can change with any memory write,
             // so cannot assume this to be stable.
             ProjectionElem::Deref => false,
-            // Array indices are intersting, but MIR building generates a *fresh*
+            // Array indices are interesting, but MIR building generates a *fresh*
             // temporary for every array access, so the index cannot be changed as
             // a side-effect.
             ProjectionElem::Index { .. } |
diff --git a/src/librustc_mir/transform/const_prop.rs b/src/librustc_mir/transform/const_prop.rs
index c196e748df3..0560f77f5c9 100644
--- a/src/librustc_mir/transform/const_prop.rs
+++ b/src/librustc_mir/transform/const_prop.rs
@@ -664,7 +664,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
             return;
         }
 
-        // FIXME> figure out what tho do when try_read_immediate fails
+        // FIXME> figure out what to do when try_read_immediate fails
         let imm = self.use_ecx(|this| this.ecx.try_read_immediate(value));
 
         if let Some(Ok(imm)) = imm {
diff --git a/src/librustc_mir/util/elaborate_drops.rs b/src/librustc_mir/util/elaborate_drops.rs
index f7239ae55fa..07b0765488d 100644
--- a/src/librustc_mir/util/elaborate_drops.rs
+++ b/src/librustc_mir/util/elaborate_drops.rs
@@ -731,7 +731,7 @@ where
         self.elaborator.patch().new_block(base_block)
     }
 
-    /// Ceates a pair of drop-loops of `place`, which drops its contents, even
+    /// Creates a pair of drop-loops of `place`, which drops its contents, even
     /// in the case of 1 panic. If `ptr_based`, creates a pointer loop,
     /// otherwise create an index loop.
     fn drop_loop_pair(
diff --git a/src/librustc_mir/util/pretty.rs b/src/librustc_mir/util/pretty.rs
index 6fd8f06fe8f..65cc6a90034 100644
--- a/src/librustc_mir/util/pretty.rs
+++ b/src/librustc_mir/util/pretty.rs
@@ -490,7 +490,7 @@ fn write_scope_tree(
     }
 
     let children = match scope_tree.get(&parent) {
-        Some(childs) => childs,
+        Some(children) => children,
         None => return Ok(()),
     };
 
diff --git a/src/librustc_mir_build/hair/pattern/_match.rs b/src/librustc_mir_build/hair/pattern/_match.rs
index 5b054c04522..066fd8281cc 100644
--- a/src/librustc_mir_build/hair/pattern/_match.rs
+++ b/src/librustc_mir_build/hair/pattern/_match.rs
@@ -837,7 +837,7 @@ impl<'tcx> Constructor<'tcx> {
                             // eliminate it straight away.
                             remaining_ranges = vec![];
                         } else {
-                            // Otherwise explicitely compute the remaining ranges.
+                            // Otherwise explicitly compute the remaining ranges.
                             remaining_ranges = other_range.subtract_from(remaining_ranges);
                         }
 
diff --git a/src/librustc_parse/config.rs b/src/librustc_parse/config.rs
index 17b9e78e5df..f42091e7c29 100644
--- a/src/librustc_parse/config.rs
+++ b/src/librustc_parse/config.rs
@@ -257,7 +257,7 @@ impl<'a> StripUnconfigured<'a> {
     /// Parse and expand all `cfg_attr` attributes into a list of attributes
     /// that are within each `cfg_attr` that has a true configuration predicate.
     ///
-    /// Gives compiler warnigns if any `cfg_attr` does not contain any
+    /// Gives compiler warnings if any `cfg_attr` does not contain any
     /// attributes and is in the original source code. Gives compiler errors if
     /// the syntax of any `cfg_attr` is incorrect.
     pub fn process_cfg_attrs<T: HasAttrs>(&mut self, node: &mut T) {
diff --git a/src/librustc_parse/parser/attr.rs b/src/librustc_parse/parser/attr.rs
index 2dccb04f6cc..bdd78e671a8 100644
--- a/src/librustc_parse/parser/attr.rs
+++ b/src/librustc_parse/parser/attr.rs
@@ -138,7 +138,7 @@ impl<'a> Parser<'a> {
 
                         if let Some(prev_attr_sp) = prev_attr_sp {
                             diagnostic
-                                .span_label(attr_sp, "not permitted following an outer attibute")
+                                .span_label(attr_sp, "not permitted following an outer attribute")
                                 .span_label(prev_attr_sp, prev_attr_note);
                         }
 
diff --git a/src/librustc_parse/parser/diagnostics.rs b/src/librustc_parse/parser/diagnostics.rs
index 8b43b424f55..6587e763d50 100644
--- a/src/librustc_parse/parser/diagnostics.rs
+++ b/src/librustc_parse/parser/diagnostics.rs
@@ -895,7 +895,7 @@ impl<'a> Parser<'a> {
         let msg = format!("expected `;`, found `{}`", super::token_descr(&self.token));
         let appl = Applicability::MachineApplicable;
         if self.token.span == DUMMY_SP || self.prev_token.span == DUMMY_SP {
-            // Likely inside a macro, can't provide meaninful suggestions.
+            // Likely inside a macro, can't provide meaningful suggestions.
             return self.expect(&token::Semi).map(drop);
         } else if !sm.is_multiline(self.prev_token.span.until(self.token.span)) {
             // The current token is in the same line as the prior token, not recoverable.
diff --git a/src/librustc_parse/parser/expr.rs b/src/librustc_parse/parser/expr.rs
index 18ddd23588e..e9ee797b90f 100644
--- a/src/librustc_parse/parser/expr.rs
+++ b/src/librustc_parse/parser/expr.rs
@@ -1373,7 +1373,7 @@ impl<'a> Parser<'a> {
         ))
     }
 
-    /// Parses an optional `move` prefix to a closure lke construct.
+    /// Parses an optional `move` prefix to a closure-like construct.
     fn parse_capture_clause(&mut self) -> CaptureBy {
         if self.eat_keyword(kw::Move) { CaptureBy::Value } else { CaptureBy::Ref }
     }
diff --git a/src/librustc_passes/region.rs b/src/librustc_passes/region.rs
index e636144794a..282bd20a9be 100644
--- a/src/librustc_passes/region.rs
+++ b/src/librustc_passes/region.rs
@@ -285,7 +285,7 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
 
     // Ordinarily, we can rely on the visit order of HIR intravisit
     // to correspond to the actual execution order of statements.
-    // However, there's a weird corner case with compund assignment
+    // However, there's a weird corner case with compound assignment
     // operators (e.g. `a += b`). The evaluation order depends on whether
     // or not the operator is overloaded (e.g. whether or not a trait
     // like AddAssign is implemented).
diff --git a/src/librustc_passes/stability.rs b/src/librustc_passes/stability.rs
index f075385ae18..7ea9ab5335d 100644
--- a/src/librustc_passes/stability.rs
+++ b/src/librustc_passes/stability.rs
@@ -655,7 +655,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
     }
 
     // FIXME(#44232): the `used_features` table no longer exists, so we
-    // don't lint about unused features. We should reenable this one day!
+    // don't lint about unused features. We should re-enable this one day!
 }
 
 fn unnecessary_stable_feature_lint(tcx: TyCtxt<'_>, span: Span, feature: Symbol, since: Symbol) {
diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs
index 18192a18cef..ab5816cb775 100644
--- a/src/librustc_resolve/diagnostics.rs
+++ b/src/librustc_resolve/diagnostics.rs
@@ -1090,7 +1090,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
         }
 
         // Sort extern crate names in reverse order to get
-        // 1) some consistent ordering for emitted dignostics, and
+        // 1) some consistent ordering for emitted diagnostics, and
         // 2) `std` suggestions before `core` suggestions.
         let mut extern_crate_names =
             self.r.extern_prelude.iter().map(|(ident, _)| ident.name).collect::<Vec<_>>();
diff --git a/src/librustc_resolve/imports.rs b/src/librustc_resolve/imports.rs
index 3b018005a88..5d4df992b94 100644
--- a/src/librustc_resolve/imports.rs
+++ b/src/librustc_resolve/imports.rs
@@ -1075,7 +1075,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
                         // single import (see test `issue-55884-2.rs`). In theory single imports should
                         // always block globs, even if they are not yet resolved, so that this kind of
                         // self-inconsistent resolution never happens.
-                        // Reenable the assert when the issue is fixed.
+                        // Re-enable the assert when the issue is fixed.
                         // assert!(result[ns].get().is_err());
                     }
                 }
diff --git a/src/librustc_resolve/late.rs b/src/librustc_resolve/late.rs
index a3554ea2ee0..ee67cecde9a 100644
--- a/src/librustc_resolve/late.rs
+++ b/src/librustc_resolve/late.rs
@@ -553,7 +553,7 @@ impl<'a, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
         let prev = replace(&mut self.diagnostic_metadata.currently_processing_generics, true);
         match arg {
             GenericArg::Type(ref ty) => {
-                // We parse const arguments as path types as we cannot distiguish them during
+                // We parse const arguments as path types as we cannot distinguish them during
                 // parsing. We try to resolve that ambiguity by attempting resolution the type
                 // namespace first, and if that fails we try again in the value namespace. If
                 // resolution in the value namespace succeeds, we have an generic const argument on
diff --git a/src/librustc_resolve/late/lifetimes.rs b/src/librustc_resolve/late/lifetimes.rs
index 193b6d75935..bd46e8e0869 100644
--- a/src/librustc_resolve/late/lifetimes.rs
+++ b/src/librustc_resolve/late/lifetimes.rs
@@ -540,7 +540,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
                     LifetimeName::Implicit => {
                         // For types like `dyn Foo`, we should
                         // generate a special form of elided.
-                        span_bug!(ty.span, "object-lifetime-default expected, not implict",);
+                        span_bug!(ty.span, "object-lifetime-default expected, not implicit",);
                     }
                     LifetimeName::ImplicitObjectLifetimeDefault => {
                         // If the user does not write *anything*, we
diff --git a/src/librustc_target/abi/call/mod.rs b/src/librustc_target/abi/call/mod.rs
index 8c7108229bd..77e7ff1e2a7 100644
--- a/src/librustc_target/abi/call/mod.rs
+++ b/src/librustc_target/abi/call/mod.rs
@@ -365,11 +365,11 @@ impl<'a, Ty> TyLayout<'a, Ty> {
                         //
                         // NB: for all tagged `enum`s (which include all non-C-like
                         // `enum`s with defined FFI representation), this will
-                        // match the homogenous computation on the equivalent
+                        // match the homogeneous computation on the equivalent
                         // `struct { tag; union { variant1; ... } }` and/or
                         // `union { struct { tag; variant1; } ... }`
                         // (the offsets of variant fields should be identical
-                        // between the two for either to be a homogenous aggregate).
+                        // between the two for either to be a homogeneous aggregate).
                         let variant_start = total;
                         for variant_idx in variants.indices() {
                             let (variant_result, variant_total) =
@@ -542,7 +542,7 @@ pub struct FnAbi<'a, Ty> {
     /// The count of non-variadic arguments.
     ///
     /// Should only be different from args.len() when c_variadic is true.
-    /// This can be used to know wether an argument is variadic or not.
+    /// This can be used to know whether an argument is variadic or not.
     pub fixed_count: usize,
 
     pub conv: Conv,
diff --git a/src/librustc_target/abi/mod.rs b/src/librustc_target/abi/mod.rs
index ffef38cedfc..e9bb94ca490 100644
--- a/src/librustc_target/abi/mod.rs
+++ b/src/librustc_target/abi/mod.rs
@@ -401,7 +401,7 @@ impl Align {
     }
 }
 
-/// A pair of aligments, ABI-mandated and preferred.
+/// A pair of alignments, ABI-mandated and preferred.
 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, RustcEncodable, RustcDecodable)]
 #[derive(HashStable_Generic)]
 pub struct AbiAndPrefAlign {
diff --git a/src/librustc_target/spec/i686_unknown_uefi.rs b/src/librustc_target/spec/i686_unknown_uefi.rs
index 345590a00be..e299f92fdeb 100644
--- a/src/librustc_target/spec/i686_unknown_uefi.rs
+++ b/src/librustc_target/spec/i686_unknown_uefi.rs
@@ -29,7 +29,7 @@ pub fn target() -> TargetResult {
     base.abi_return_struct_as_int = true;
 
     // Use -GNU here, because of the reason below:
-    // Backgound and Problem:
+    // Background and Problem:
     //   If we use i686-unknown-windows, the LLVM IA32 MSVC generates compiler intrinsic
     //   _alldiv, _aulldiv, _allrem, _aullrem, _allmul, which will cause undefined symbol.
     //   A real issue is __aulldiv() is referred by __udivdi3() - udivmod_inner!(), from
@@ -64,7 +64,7 @@ pub fn target() -> TargetResult {
     //      i386/umoddi3.S
     // Possible solution:
     //   1. Eliminate Intrinsics generation.
-    //      1.1 Choose differnt target to bypass isTargetKnownWindowsMSVC().
+    //      1.1 Choose different target to bypass isTargetKnownWindowsMSVC().
     //      1.2 Remove the "Setup Windows compiler runtime calls" in LLVM
     //   2. Implement Intrinsics.
     //   We evaluated all options.
diff --git a/src/librustc_target/spec/nvptx64_nvidia_cuda.rs b/src/librustc_target/spec/nvptx64_nvidia_cuda.rs
index f070a3e5da4..e0a402533e7 100644
--- a/src/librustc_target/spec/nvptx64_nvidia_cuda.rs
+++ b/src/librustc_target/spec/nvptx64_nvidia_cuda.rs
@@ -23,7 +23,7 @@ pub fn target() -> TargetResult {
             // The linker can be installed from `crates.io`.
             linker: Some("rust-ptx-linker".to_string()),
 
-            // With `ptx-linker` approach, it can be later overriden via link flags.
+            // With `ptx-linker` approach, it can be later overridden via link flags.
             cpu: "sm_30".to_string(),
 
             // FIXME: create tests for the atomics.
@@ -43,7 +43,7 @@ pub fn target() -> TargetResult {
             // Let the `ptx-linker` to handle LLVM lowering into MC / assembly.
             obj_is_bitcode: true,
 
-            // Convinient and predicable naming scheme.
+            // Convenient and predicable naming scheme.
             dll_prefix: "".to_string(),
             dll_suffix: ".ptx".to_string(),
             exe_suffix: ".ptx".to_string(),
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 199b476cb9a..c3cf0cdc61d 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -661,7 +661,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
     /// Given the type/lifetime/const arguments provided to some path (along with
     /// an implicit `Self`, if this is a trait reference), returns the complete
     /// set of substitutions. This may involve applying defaulted type parameters.
-    /// Also returns back constriants on associated types.
+    /// Also returns back constraints on associated types.
     ///
     /// Example:
     ///
@@ -2924,7 +2924,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
 
         let tcx = self.tcx();
 
-        // We proactively collect all the infered type params to emit a single error per fn def.
+        // We proactively collect all the inferred type params to emit a single error per fn def.
         let mut visitor = PlaceholderHirTyCollector::default();
         for ty in decl.inputs {
             visitor.visit_ty(ty);
diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs
index 40cafb626d7..b271bc95d94 100644
--- a/src/librustc_typeck/check/method/probe.rs
+++ b/src/librustc_typeck/check/method/probe.rs
@@ -1040,7 +1040,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
             return r;
         }
 
-        debug!("pick: actual search failed, assemble diagnotics");
+        debug!("pick: actual search failed, assemble diagnostics");
 
         let static_candidates = mem::take(&mut self.static_candidates);
         let private_candidate = self.private_candidate.take();
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index d8b23998e72..1ec97a48001 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -457,7 +457,7 @@ pub enum Diverges {
         /// where all arms diverge), we may be
         /// able to provide a more informative
         /// message to the user.
-        /// If this is `None`, a default messsage
+        /// If this is `None`, a default message
         /// will be generated, which is suitable
         /// for most cases.
         custom_note: Option<&'static str>,
@@ -896,7 +896,7 @@ where
                 ty::Opaque(def_id, substs) => {
                     debug!("fixup_opaque_types: found type {:?}", ty);
                     // Here, we replace any inference variables that occur within
-                    // the substs of an opaque type. By definition, any type occuring
+                    // the substs of an opaque type. By definition, any type occurring
                     // in the substs has a corresponding generic parameter, which is what
                     // we replace it with.
                     // This replacement is only run on the function signature, so any
@@ -1937,7 +1937,7 @@ fn check_specialization_validity<'tcx>(
         }
     });
 
-    // If `opt_result` is `None`, we have only encoutered `default impl`s that don't contain the
+    // If `opt_result` is `None`, we have only encountered `default impl`s that don't contain the
     // item. This is allowed, the item isn't actually getting specialized here.
     let result = opt_result.unwrap_or(Ok(()));
 
@@ -3452,7 +3452,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 //  }
                 //  ```
                 //
-                // In the above snippet, the inference varaible created by
+                // In the above snippet, the inference variable created by
                 // instantiating `Option<Foo>` will be completely unconstrained.
                 // We treat this as a non-defining use by making the inference
                 // variable fall back to the opaque type itself.
diff --git a/src/librustc_typeck/check/pat.rs b/src/librustc_typeck/check/pat.rs
index b7aac707a98..32f04f03a1d 100644
--- a/src/librustc_typeck/check/pat.rs
+++ b/src/librustc_typeck/check/pat.rs
@@ -98,7 +98,7 @@ const INITIAL_BM: BindingMode = BindingMode::BindByValue(hir::Mutability::Not);
 enum AdjustMode {
     /// Peel off all immediate reference types.
     Peel,
-    /// Reset binding mode to the inital mode.
+    /// Reset binding mode to the initial mode.
     Reset,
     /// Pass on the input binding mode and expected type.
     Pass,
@@ -841,7 +841,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         // N-arity-tuple, e.g., `V_i((p_0, .., p_N))`. Meanwhile, the user supplied a pattern
         // with the subpatterns directly in the tuple variant pattern, e.g., `V_i(p_0, .., p_N)`.
         let missing_parenthesis = match (&expected.kind, fields, had_err) {
-            // #67037: only do this if we could sucessfully type-check the expected type against
+            // #67037: only do this if we could successfully type-check the expected type against
             // the tuple struct pattern. Otherwise the substs could get out of range on e.g.,
             // `let P() = U;` where `P != U` with `struct P<T>(T);`.
             (ty::Adt(_, substs), [field], false) => {
diff --git a/src/librustc_typeck/coherence/orphan.rs b/src/librustc_typeck/coherence/orphan.rs
index a8e5a0ddf26..0a574493573 100644
--- a/src/librustc_typeck/coherence/orphan.rs
+++ b/src/librustc_typeck/coherence/orphan.rs
@@ -174,7 +174,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> {
             // impl !Send for (A, B) { }
             // ```
             //
-            // This final impl is legal according to the orpan
+            // This final impl is legal according to the orphan
             // rules, but it invalidates the reasoning from
             // `two_foos` above.
             debug!(
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index 26462e61e5d..fc1ef4f756c 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -1395,7 +1395,7 @@ fn are_suggestable_generic_args(generic_args: &[hir::GenericArg<'_>]) -> bool {
         .any(is_suggestable_infer_ty)
 }
 
-/// Whether `ty` is a type with `_` placeholders that can be infered. Used in diagnostics only to
+/// Whether `ty` is a type with `_` placeholders that can be inferred. Used in diagnostics only to
 /// use inference to provide suggestions for the appropriate type if possible.
 fn is_suggestable_infer_ty(ty: &hir::Ty<'_>) -> bool {
     use hir::TyKind::*;
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs
index 289923b45e6..407b50382fa 100644
--- a/src/librustdoc/clean/auto_trait.rs
+++ b/src/librustdoc/clean/auto_trait.rs
@@ -493,7 +493,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
                     // Writing a projection trait bound of the form
                     // <T as Trait>::Name : ?Sized
                     // is illegal, because ?Sized bounds can only
-                    // be written in the (here, nonexistant) definition
+                    // be written in the (here, nonexistent) definition
                     // of the type.
                     // Therefore, we make sure that we never add a ?Sized
                     // bound for projections
diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs
index 0b4bb304fe9..02f1947c99e 100644
--- a/src/librustdoc/html/highlight.rs
+++ b/src/librustdoc/html/highlight.rs
@@ -135,7 +135,7 @@ trait Writer {
     fn string<T: Display>(&mut self, text: T, klass: Class) -> io::Result<()>;
 }
 
-// Implement `Writer` for anthing that can be written to, this just implements
+// Implement `Writer` for anything that can be written to, this just implements
 // the default rustdoc behaviour.
 impl<U: Write> Writer for U {
     fn string<T: Display>(&mut self, text: T, klass: Class) -> io::Result<()> {
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 07fe439ace2..c64c4769708 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -3601,7 +3601,7 @@ fn render_impl(
     use_absolute: Option<bool>,
     is_on_foreign_type: bool,
     show_default_items: bool,
-    // This argument is used to reference same type with different pathes to avoid duplication
+    // This argument is used to reference same type with different paths to avoid duplication
     // in documentation pages for trait with automatic implementations like "Send" and "Sync".
     aliases: &[String],
 ) {
diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs
index 200b00b1195..edc28033c9b 100644
--- a/src/libstd/net/ip.rs
+++ b/src/libstd/net/ip.rs
@@ -651,7 +651,7 @@ impl Ipv4Addr {
 
     /// Returns [`true`] if this address is reserved by IANA for future use. [IETF RFC 1112]
     /// defines the block of reserved addresses as `240.0.0.0/4`. This range normally includes the
-    /// broadcast address `255.255.255.255`, but this implementation explicitely excludes it, since
+    /// broadcast address `255.255.255.255`, but this implementation explicitly excludes it, since
     /// it is obviously not reserved for future use.
     ///
     /// [IETF RFC 1112]: https://tools.ietf.org/html/rfc1112
diff --git a/src/libstd/os/linux/fs.rs b/src/libstd/os/linux/fs.rs
index dd71201b50b..d22b44a0666 100644
--- a/src/libstd/os/linux/fs.rs
+++ b/src/libstd/os/linux/fs.rs
@@ -34,7 +34,7 @@ pub trait MetadataExt {
     /// }
     /// ```
     #[stable(feature = "metadata_ext", since = "1.1.0")]
-    #[rustc_deprecated(since = "1.8.0", reason = "other methods of this trait are now prefered")]
+    #[rustc_deprecated(since = "1.8.0", reason = "other methods of this trait are now preferred")]
     #[allow(deprecated)]
     fn as_raw_stat(&self) -> &raw::stat;
 
diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs
index c51aa7619db..0274268f69f 100644
--- a/src/libstd/sync/mpsc/spsc_queue.rs
+++ b/src/libstd/sync/mpsc/spsc_queue.rs
@@ -40,7 +40,7 @@ struct Consumer<T, Addition> {
     tail: UnsafeCell<*mut Node<T>>, // where to pop from
     tail_prev: AtomicPtr<Node<T>>,  // where to pop from
     cache_bound: usize,             // maximum cache size
-    cached_nodes: AtomicUsize,      // number of nodes marked as cachable
+    cached_nodes: AtomicUsize,      // number of nodes marked as cacheable
     addition: Addition,
 }
 
diff --git a/src/libstd/sys/sgx/abi/usercalls/alloc.rs b/src/libstd/sys/sgx/abi/usercalls/alloc.rs
index b54c115a2b6..76a9b427b39 100644
--- a/src/libstd/sys/sgx/abi/usercalls/alloc.rs
+++ b/src/libstd/sys/sgx/abi/usercalls/alloc.rs
@@ -151,7 +151,7 @@ unsafe impl<T: UserSafeSized> UserSafe for [T] {
 /// It is also possible to obtain a mutable reference `&mut UserRef<T>`. Unlike
 /// regular mutable references, these are not exclusive. Userspace may always
 /// write to the backing memory at any time, so it can't be assumed that there
-/// the pointed-to memory is uniquely borrowed. The two different refence types
+/// the pointed-to memory is uniquely borrowed. The two different reference types
 /// are used solely to indicate intent: a mutable reference is for writing to
 /// user memory, an immutable reference for reading from user memory.
 #[unstable(feature = "sgx_platform", issue = "56975")]
diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs
index 06876cb0614..fbcb006ecdf 100644
--- a/src/libstd/sys/unix/mod.rs
+++ b/src/libstd/sys/unix/mod.rs
@@ -156,7 +156,7 @@ where
 
 // On Unix-like platforms, libc::abort will unregister signal handlers
 // including the SIGABRT handler, preventing the abort from being blocked, and
-// fclose streams, with the side effect of flushing them so libc bufferred
+// fclose streams, with the side effect of flushing them so libc buffered
 // output will be printed.  Additionally the shell will generally print a more
 // understandable error message like "Abort trap" rather than "Illegal
 // instruction" that intrinsics::abort would cause, as intrinsics::abort is
diff --git a/src/libstd/sys/vxworks/mod.rs b/src/libstd/sys/vxworks/mod.rs
index 12bbfa1d4e1..e23191c9431 100644
--- a/src/libstd/sys/vxworks/mod.rs
+++ b/src/libstd/sys/vxworks/mod.rs
@@ -103,7 +103,7 @@ where
 
 // On Unix-like platforms, libc::abort will unregister signal handlers
 // including the SIGABRT handler, preventing the abort from being blocked, and
-// fclose streams, with the side effect of flushing them so libc bufferred
+// fclose streams, with the side effect of flushing them so libc buffered
 // output will be printed.  Additionally the shell will generally print a more
 // understandable error message like "Abort trap" rather than "Illegal
 // instruction" that intrinsics::abort would cause, as intrinsics::abort is
diff --git a/src/libtest/cli.rs b/src/libtest/cli.rs
index a800bd17c50..5317063b80d 100644
--- a/src/libtest/cli.rs
+++ b/src/libtest/cli.rs
@@ -283,7 +283,7 @@ fn is_nightly() -> bool {
     bootstrap || !disable_unstable_features
 }
 
-// Gets the CLI options assotiated with `report-time` feature.
+// Gets the CLI options associated with `report-time` feature.
 fn get_time_options(
     matches: &getopts::Matches,
     allow_unstable: bool,
diff --git a/src/libtest/options.rs b/src/libtest/options.rs
index 7db164c269a..8e7bd8de924 100644
--- a/src/libtest/options.rs
+++ b/src/libtest/options.rs
@@ -41,7 +41,7 @@ pub enum OutputFormat {
     Json,
 }
 
-/// Whether ignored test should be runned or not
+/// Whether ignored test should be run or not
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
 pub enum RunIgnored {
     Yes,
diff --git a/src/libtest/test_result.rs b/src/libtest/test_result.rs
index 5c975c6272b..465f3f8f994 100644
--- a/src/libtest/test_result.rs
+++ b/src/libtest/test_result.rs
@@ -27,7 +27,7 @@ pub enum TestResult {
 unsafe impl Send for TestResult {}
 
 /// Creates a `TestResult` depending on the raw result of test execution
-/// and assotiated data.
+/// and associated data.
 pub fn calc_result<'a>(
     desc: &TestDesc,
     task_result: Result<(), &'a (dyn Any + 'static + Send)>,
diff --git a/src/test/incremental/cyclic-trait-hierarchy.rs b/src/test/incremental/cyclic-trait-hierarchy.rs
index 27287d06d54..03bb5eea765 100644
--- a/src/test/incremental/cyclic-trait-hierarchy.rs
+++ b/src/test/incremental/cyclic-trait-hierarchy.rs
@@ -1,4 +1,4 @@
-// Adapated from rust-lang/rust#58813
+// Adapted from rust-lang/rust#58813
 
 // revisions: rpass1 cfail2
 
diff --git a/src/test/incremental/thinlto/cgu_invalidated_when_import_added.rs b/src/test/incremental/thinlto/cgu_invalidated_when_import_added.rs
index 42168dd273e..9c17c8745f8 100644
--- a/src/test/incremental/thinlto/cgu_invalidated_when_import_added.rs
+++ b/src/test/incremental/thinlto/cgu_invalidated_when_import_added.rs
@@ -4,7 +4,7 @@
 
 // rust-lang/rust#59535:
 //
-// This is analgous to cgu_invalidated_when_import_removed.rs, but it covers
+// This is analogous to cgu_invalidated_when_import_removed.rs, but it covers
 // the other direction:
 //
 // We start with a call-graph like `[A] -> [B -> D] [C]` (where the letters are
diff --git a/src/test/incremental/thinlto/cgu_invalidated_when_import_removed.rs b/src/test/incremental/thinlto/cgu_invalidated_when_import_removed.rs
index 19ce7b3e148..1214e37f982 100644
--- a/src/test/incremental/thinlto/cgu_invalidated_when_import_removed.rs
+++ b/src/test/incremental/thinlto/cgu_invalidated_when_import_removed.rs
@@ -41,7 +41,7 @@ mod foo {
     // In cfail2, ThinLTO decides that foo() does not get inlined into main, and
     // instead bar() gets inlined into foo(). But faulty logic in our incr.
     // ThinLTO implementation thought that `main()` is unchanged and thus reused
-    // the object file still containing a call to the now non-existant bar().
+    // the object file still containing a call to the now non-existent bar().
     pub fn foo(){
         bar()
     }
diff --git a/src/test/ui/consts/const-int-arithmetic-overflow.rs b/src/test/ui/consts/const-int-arithmetic-overflow.rs
index 75dac812f1e..99bbeaafda5 100644
--- a/src/test/ui/consts/const-int-arithmetic-overflow.rs
+++ b/src/test/ui/consts/const-int-arithmetic-overflow.rs
@@ -8,7 +8,7 @@
 const fn add(x: i8, y: i8) -> i8 { x+y }
 const fn sub(x: i8, y: i8) -> i8 { x-y }
 const fn mul(x: i8, y: i8) -> i8 { x*y }
-// div and rem are always checked, so we cannot test their result in case of oveflow.
+// div and rem are always checked, so we cannot test their result in case of overflow.
 const fn neg(x: i8) -> i8 { -x }
 
 fn main() {
diff --git a/src/test/ui/definition-reachable/nested-fn.rs b/src/test/ui/definition-reachable/nested-fn.rs
index b596ba8936a..b665b049f32 100644
--- a/src/test/ui/definition-reachable/nested-fn.rs
+++ b/src/test/ui/definition-reachable/nested-fn.rs
@@ -1,4 +1,4 @@
-// Check that functions visible to macros through paths with >2 segements are
+// Check that functions visible to macros through paths with >2 segments are
 // considered reachable
 
 // aux-build:field-method-macro.rs
diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs
index 1c3b5ac7613..00f3490991b 100644
--- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs
+++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs
@@ -12,7 +12,7 @@ impl<'a> LifetimeTrait<'a> for &'a i32 {}
 fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
 //~^ ERROR cannot infer an appropriate lifetime
 
-// Tests that a closure type contianing 'b cannot be returned from a type where
+// Tests that a closure type containing 'b cannot be returned from a type where
 // only 'a was expected.
 fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
     //~^ ERROR lifetime mismatch
diff --git a/src/test/ui/mir/mir_assign_eval_order.rs b/src/test/ui/mir/mir_assign_eval_order.rs
index 1594421b0b1..799bf7f3a12 100644
--- a/src/test/ui/mir/mir_assign_eval_order.rs
+++ b/src/test/ui/mir/mir_assign_eval_order.rs
@@ -12,7 +12,7 @@ fn evaluate_reborrow_before_assign() {
     let y = &mut &2;
     let z = &3;
     // There's an implicit reborrow of `x` on the right-hand side of the
-    // assignement. Note that writing an explicit reborrow would not show this
+    // assignment. Note that writing an explicit reborrow would not show this
     // bug, as now there would be two reborrows on the right-hand side and at
     // least one of them would happen before the left-hand side is evaluated.
     *{ x = z; &mut *y } = x;
diff --git a/src/test/ui/nll/issue-54556-used-vs-unused-tails.rs b/src/test/ui/nll/issue-54556-used-vs-unused-tails.rs
index 0d96767a05d..a111acca66f 100644
--- a/src/test/ui/nll/issue-54556-used-vs-unused-tails.rs
+++ b/src/test/ui/nll/issue-54556-used-vs-unused-tails.rs
@@ -1,4 +1,4 @@
-// Ths test case is exploring the space of how blocs with tail
+// This test case is exploring the space of how blocks with tail
 // expressions and statements can be composed, trying to keep each
 // case on one line so that we can compare them via a vertical scan
 // with the human eye.
diff --git a/src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs b/src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
index 61d5d51cfd2..d0984bbe65f 100644
--- a/src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
+++ b/src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
@@ -1,6 +1,6 @@
 // Regression test for sanitizer function instrumentation passes not
 // being run when compiling with new LLVM pass manager and ThinLTO.
-// Note: The issue occured only on non-zero opt-level.
+// Note: The issue occurred only on non-zero opt-level.
 //
 // min-llvm-version 9.0
 // needs-sanitizer-support
diff --git a/src/test/ui/type-alias-impl-trait/issue-65918.rs b/src/test/ui/type-alias-impl-trait/issue-65918.rs
index 4ba778d53ac..af6d5010920 100644
--- a/src/test/ui/type-alias-impl-trait/issue-65918.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-65918.rs
@@ -6,7 +6,7 @@
 
 use std::marker::PhantomData;
 
-/* copied Index and TryFrom for convinience (and simplicity) */
+/* copied Index and TryFrom for convenience (and simplicity) */
 trait MyIndex<T> {
     type O;
     fn my_index(self) -> Self::O;
diff --git a/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs b/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs
index 2f844b4a05f..7da0b049264 100644
--- a/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs
@@ -1,6 +1,6 @@
 // check-pass
 // Regression test for issue #67844
-// Ensures that we properly handle nested TAIT occurences
+// Ensures that we properly handle nested TAIT occurrences
 // with generic parameters
 
 #![feature(type_alias_impl_trait)]
diff --git a/src/test/ui/typeck/issue-52082-type-param-shadows-existing-type.rs b/src/test/ui/typeck/issue-52082-type-param-shadows-existing-type.rs
index c57e8149574..7bf151514c3 100644
--- a/src/test/ui/typeck/issue-52082-type-param-shadows-existing-type.rs
+++ b/src/test/ui/typeck/issue-52082-type-param-shadows-existing-type.rs
@@ -1,4 +1,4 @@
-// Fix issue 52082: Confusing error if accidentially defining a type paramter with the same name as
+// Fix issue 52082: Confusing error if accidentally defining a type parameter with the same name as
 // an existing type
 //
 // To this end, make sure that when trying to retrieve a field of a (reference to) type parameter,
diff --git a/src/test/ui/wf/wf-array-elem-sized.rs b/src/test/ui/wf/wf-array-elem-sized.rs
index 41c2d3c43e9..34bf2203426 100644
--- a/src/test/ui/wf/wf-array-elem-sized.rs
+++ b/src/test/ui/wf/wf-array-elem-sized.rs
@@ -1,4 +1,4 @@
-// Check that array elemen types must be Sized. Issue #25692.
+// Check that array element types must be Sized. Issue #25692.
 
 
 #![allow(dead_code)]
diff --git a/src/tools/compiletest/src/errors.rs b/src/tools/compiletest/src/errors.rs
index c3d699b3e23..8f685fb8559 100644
--- a/src/tools/compiletest/src/errors.rs
+++ b/src/tools/compiletest/src/errors.rs
@@ -125,7 +125,7 @@ fn parse_expected(
     let captures = RE.captures(line)?;
 
     match (cfg, captures.name("cfgs")) {
-        // Only error messages that contain our `cfg` betweeen the square brackets apply to us.
+        // Only error messages that contain our `cfg` between the square brackets apply to us.
         (Some(cfg), Some(filter)) if !filter.as_str().split(',').any(|s| s == cfg) => return None,
         (Some(_), Some(_)) => {}
 
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index ac808b1f14e..424bac88c85 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1487,7 +1487,7 @@ impl<'test> TestCx<'test> {
                 // can turn it back on if needed.
                 if !self.is_rustdoc()
                     // Note that we use the local pass mode here as we don't want
-                    // to set unused to allow if we've overriden the pass mode
+                    // to set unused to allow if we've overridden the pass mode
                     // via command line flags.
                     && local_pm != Some(PassMode::Run)
                 {
diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs
index f11394bd95f..349829d8725 100644
--- a/src/tools/tidy/src/pal.rs
+++ b/src/tools/tidy/src/pal.rs
@@ -41,7 +41,7 @@ const EXCEPTION_PATHS: &[&str] = &[
     "src/libpanic_unwind",
     "src/libunwind",
     // black_box implementation is LLVM-version specific and it uses
-    // target_os to tell targets with different LLVM-versions appart
+    // target_os to tell targets with different LLVM-versions apart
     // (e.g. `wasm32-unknown-emscripten` vs `wasm32-unknown-unknown`):
     "src/libcore/hint.rs",
     "src/libstd/sys/", // Platform-specific code for std lives here.