]> git.lizzy.rs Git - rust.git/commitdiff
Spellchecking compiler comments
authorYuri Astrakhan <YuriAstrakhan@gmail.com>
Wed, 30 Mar 2022 19:14:15 +0000 (15:14 -0400)
committerYuri Astrakhan <YuriAstrakhan@gmail.com>
Wed, 30 Mar 2022 19:14:15 +0000 (15:14 -0400)
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.

116 files changed:
compiler/rustc_apfloat/src/ieee.rs
compiler/rustc_ast/src/tokenstream.rs
compiler/rustc_borrowck/src/type_check/relate_tys.rs
compiler/rustc_codegen_cranelift/src/pretty_clif.rs
compiler/rustc_codegen_ssa/src/back/write.rs
compiler/rustc_expand/src/mbe/transcribe.rs
compiler/rustc_index/src/bit_set.rs
compiler/rustc_infer/src/infer/canonical/query_response.rs
compiler/rustc_infer/src/infer/error_reporting/mod.rs
compiler/rustc_infer/src/infer/lattice.rs
compiler/rustc_infer/src/infer/mod.rs
compiler/rustc_infer/src/infer/nll_relate/mod.rs
compiler/rustc_infer/src/infer/opaque_types.rs
compiler/rustc_infer/src/infer/outlives/components.rs
compiler/rustc_infer/src/infer/outlives/env.rs
compiler/rustc_infer/src/infer/outlives/obligations.rs
compiler/rustc_infer/src/infer/region_constraints/leak_check.rs
compiler/rustc_infer/src/infer/region_constraints/mod.rs
compiler/rustc_infer/src/infer/resolve.rs
compiler/rustc_interface/src/passes.rs
compiler/rustc_lint/src/noop_method_call.rs
compiler/rustc_lint_defs/src/builtin.rs
compiler/rustc_metadata/src/rmeta/decoder.rs
compiler/rustc_metadata/src/rmeta/encoder.rs
compiler/rustc_middle/src/hir/map/mod.rs
compiler/rustc_middle/src/infer/canonical.rs
compiler/rustc_middle/src/lint.rs
compiler/rustc_middle/src/mir/interpret/error.rs
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_middle/src/mir/query.rs
compiler/rustc_middle/src/mir/traversal.rs
compiler/rustc_middle/src/thir.rs
compiler/rustc_middle/src/traits/mod.rs
compiler/rustc_middle/src/traits/util.rs
compiler/rustc_middle/src/ty/diagnostics.rs
compiler/rustc_middle/src/ty/layout.rs
compiler/rustc_middle/src/ty/mod.rs
compiler/rustc_middle/src/ty/print/pretty.rs
compiler/rustc_middle/src/ty/sty.rs
compiler/rustc_mir_build/src/build/matches/mod.rs
compiler/rustc_mir_build/src/build/matches/test.rs
compiler/rustc_mir_build/src/build/scope.rs
compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
compiler/rustc_mir_dataflow/src/elaborate_drops.rs
compiler/rustc_mir_dataflow/src/impls/liveness.rs
compiler/rustc_mir_dataflow/src/impls/mod.rs
compiler/rustc_mir_transform/src/check_unsafety.rs
compiler/rustc_mir_transform/src/const_prop.rs
compiler/rustc_mir_transform/src/coverage/query.rs
compiler/rustc_mir_transform/src/coverage/spans.rs
compiler/rustc_mir_transform/src/early_otherwise_branch.rs
compiler/rustc_mir_transform/src/generator.rs
compiler/rustc_mir_transform/src/inline.rs
compiler/rustc_mir_transform/src/inline/cycle.rs
compiler/rustc_mir_transform/src/nrvo.rs
compiler/rustc_mir_transform/src/remove_noop_landing_pads.rs
compiler/rustc_mir_transform/src/remove_uninit_drops.rs
compiler/rustc_mir_transform/src/remove_unneeded_drops.rs
compiler/rustc_mir_transform/src/simplify_try.rs
compiler/rustc_monomorphize/src/partitioning/default.rs
compiler/rustc_monomorphize/src/polymorphize.rs
compiler/rustc_parse/src/parser/diagnostics.rs
compiler/rustc_parse/src/parser/expr.rs
compiler/rustc_parse/src/parser/mod.rs
compiler/rustc_parse_format/src/lib.rs
compiler/rustc_passes/src/check_const.rs
compiler/rustc_passes/src/region.rs
compiler/rustc_passes/src/stability.rs
compiler/rustc_privacy/src/lib.rs
compiler/rustc_query_system/src/dep_graph/serialized.rs
compiler/rustc_resolve/src/diagnostics.rs
compiler/rustc_resolve/src/imports.rs
compiler/rustc_resolve/src/late/diagnostics.rs
compiler/rustc_resolve/src/late/lifetimes.rs
compiler/rustc_resolve/src/lib.rs
compiler/rustc_resolve/src/macros.rs
compiler/rustc_save_analysis/src/dump_visitor.rs
compiler/rustc_span/src/hygiene.rs
compiler/rustc_span/src/symbol.rs
compiler/rustc_target/src/abi/call/sparc64.rs
compiler/rustc_target/src/spec/i686_unknown_uefi.rs
compiler/rustc_target/src/spec/mod.rs
compiler/rustc_target/src/spec/wasm_base.rs
compiler/rustc_trait_selection/src/opaque_types.rs
compiler/rustc_trait_selection/src/traits/codegen.rs
compiler/rustc_trait_selection/src/traits/coherence.rs
compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
compiler/rustc_trait_selection/src/traits/fulfill.rs
compiler/rustc_trait_selection/src/traits/mod.rs
compiler/rustc_trait_selection/src/traits/project.rs
compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs
compiler/rustc_trait_selection/src/traits/relationships.rs
compiler/rustc_trait_selection/src/traits/select/mod.rs
compiler/rustc_typeck/src/astconv/errors.rs
compiler/rustc_typeck/src/astconv/mod.rs
compiler/rustc_typeck/src/check/closure.rs
compiler/rustc_typeck/src/check/coercion.rs
compiler/rustc_typeck/src/check/expr.rs
compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
compiler/rustc_typeck/src/check/generator_interior/drop_ranges.rs
compiler/rustc_typeck/src/check/generator_interior/drop_ranges/cfg_build.rs
compiler/rustc_typeck/src/check/method/probe.rs
compiler/rustc_typeck/src/check/method/suggest.rs
compiler/rustc_typeck/src/check/mod.rs
compiler/rustc_typeck/src/check/op.rs
compiler/rustc_typeck/src/check/pat.rs
compiler/rustc_typeck/src/check/upvar.rs
compiler/rustc_typeck/src/check/wfcheck.rs
compiler/rustc_typeck/src/check/writeback.rs
compiler/rustc_typeck/src/collect.rs
compiler/rustc_typeck/src/collect/type_of.rs
compiler/rustc_typeck/src/hir_wf_check.rs
compiler/rustc_typeck/src/impl_wf_check.rs
compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs

index 3db8adb2a244424a52cbf667128b7a722f92150a..193f3145dc14709630f01d643f1fea62e6070ae9 100644 (file)
@@ -2646,7 +2646,7 @@ pub(super) fn mul<'a>(
 
         // Convert the result having "2 * precision" significant-bits back to the one
         // having "precision" significant-bits. First, move the radix point from
-        // poision "2*precision - 1" to "precision - 1". The exponent need to be
+        // position "2*precision - 1" to "precision - 1". The exponent need to be
         // adjusted by "2*precision - 1" - "precision - 1" = "precision".
         *exp -= precision as ExpInt + 1;
 
index a67e7b1215b28c4ccce422707546d815b992cce6..affb4289cb1b5a4f229a79cdaba90b1d7008f7c3 100644 (file)
@@ -295,7 +295,7 @@ pub fn to_tokenstream(&self) -> TokenStream {
 ///
 /// For example, `#[cfg(FALSE)] struct Foo {}` would
 /// have an `attrs` field containing the `#[cfg(FALSE)]` attr,
-/// and a `tokens` field storing the (unparesd) tokens `struct Foo {}`
+/// and a `tokens` field storing the (unparsed) tokens `struct Foo {}`
 #[derive(Clone, Debug, Encodable, Decodable)]
 pub struct AttributesData {
     /// Attributes, both outer and inner.
index 8a757636087dfb92e5535c3565c35f719c5a3a58..f0106630797d33d91f4cf771d22759a272c80d77 100644 (file)
@@ -158,7 +158,7 @@ fn register_opaque_type(
                         .infcx
                         .handle_opaque_type(a, b, a_is_expected, &cause, param_env)?
                         .obligations,
-                    // These fields are filled in during exectuion of the operation
+                    // These fields are filled in during execution of the operation
                     base_universe: None,
                     region_constraints: None,
                 },
index ca7116b887d5a622a298d336ade72684f18413df..90024c5921a9543cf98281a748ceb5b1bfc03454 100644 (file)
@@ -23,7 +23,7 @@
 //!     ss2 = explicit_slot 8 ; _4: (&&[u16],) size=8 align=8,8
 //!     sig0 = (i64, i64, i64) system_v
 //!     sig1 = (i64, i64, i64) system_v
-//!     fn0 = colocated u0:6 sig1 ; Instance { def: Item(DefId(0/0:31 ~ example[8787]::{{impl}}[1]::call_mut[0])), substs: [ReErased, ReErased] }
+//!     fn0 = collocated u0:6 sig1 ; Instance { def: Item(DefId(0/0:31 ~ example[8787]::{{impl}}[1]::call_mut[0])), substs: [ReErased, ReErased] }
 //!
 //! block0(v0: i64, v1: i64, v2: i64):
 //!     v3 = stack_addr.i64 ss0
index 1d11e6dfbd25f42f58b23b3f61aebd7517fb628c..d4eaf6389dfe9949518005548cc9f4253b3da32e 100644 (file)
@@ -779,7 +779,7 @@ pub fn compute_per_cgu_lto_type(
     // we'll encounter later.
     let is_allocator = module_kind == ModuleKind::Allocator;
 
-    // We ignore a request for full crate grath LTO if the cate type
+    // We ignore a request for full crate graph LTO if the crate type
     // is only an rlib, as there is no full crate graph to process,
     // that'll happen later.
     //
index cd016bfd8f4d73b6cfb1ec948298d4ef365db2e0..508108df001ec588f36938a09d61702ded26de5d 100644 (file)
@@ -35,7 +35,7 @@ enum Frame {
 impl Frame {
     /// Construct a new frame around the delimited set of tokens.
     fn new(mut tts: Vec<mbe::TokenTree>) -> Frame {
-        // Need to add empty delimeters.
+        // Need to add empty delimiters.
         let open_tt = mbe::TokenTree::token(token::OpenDelim(token::NoDelim), DUMMY_SP);
         let close_tt = mbe::TokenTree::token(token::CloseDelim(token::NoDelim), DUMMY_SP);
         tts.insert(0, open_tt);
@@ -210,7 +210,7 @@ pub(super) fn transcribe<'a>(
                                 ));
                             }
                         } else {
-                            // 0 is the initial counter (we have done 0 repretitions so far). `len`
+                            // 0 is the initial counter (we have done 0 repetitions so far). `len`
                             // is the total number of repetitions we should generate.
                             repeats.push((0, len));
 
index f1b51da05822e4df7ceb34620c49b28247d2c72f..cdc05095e685111a983d32dc24e9ae2b92699992 100644 (file)
@@ -1717,7 +1717,7 @@ pub fn row(&self, row: R) -> Option<&HybridBitSet<C>> {
         if let Some(Some(row)) = self.rows.get(row) { Some(row) } else { None }
     }
 
-    /// Interescts `row` with `set`. `set` can be either `BitSet` or
+    /// Intersects `row` with `set`. `set` can be either `BitSet` or
     /// `HybridBitSet`. Has no effect if `row` does not exist.
     ///
     /// Returns true if the row was changed.
index 750643acdda3b03009a25b2f7803b83b6fe5c85b..5671711397a2ce9452165adba73666108b8ffc30 100644 (file)
@@ -2,7 +2,7 @@
 //! in particular to extract out the resulting region obligations and
 //! encode them therein.
 //!
-//! For an overview of what canonicaliation is and how it fits into
+//! For an overview of what canonicalization is and how it fits into
 //! rustc, check out the [chapter in the rustc dev guide][c].
 //!
 //! [c]: https://rust-lang.github.io/chalk/book/canonical_queries/canonicalization.html
index 6e007b181f2c2b1682c6a9d282edfbd12a578fbc..9b2fc07e9cbe4e930dcf8e1eb91dd89e98748c1d 100644 (file)
@@ -1164,7 +1164,7 @@ fn push_ty_ref<'tcx>(
                     let len = sub1.len() - common_default_params;
                     let consts_offset = len - sub1.consts().count();
 
-                    // Only draw `<...>` if there're lifetime/type arguments.
+                    // Only draw `<...>` if there are lifetime/type arguments.
                     if len > 0 {
                         values.0.push_normal("<");
                         values.1.push_normal("<");
@@ -1245,7 +1245,7 @@ fn lifetime_display(lifetime: Region<'_>) -> String {
                     }
 
                     // Close the type argument bracket.
-                    // Only draw `<...>` if there're lifetime/type arguments.
+                    // Only draw `<...>` if there are lifetime/type arguments.
                     if len > 0 {
                         values.0.push_normal(">");
                         values.1.push_normal(">");
@@ -1857,7 +1857,7 @@ pub fn get_impl_future_output_ty(&self, ty: Ty<'tcx>) -> Option<Binder<'tcx, Ty<
                     })
                     .transpose();
                 if output.is_some() {
-                    // We don't account for multiple `Future::Output = Ty` contraints.
+                    // We don't account for multiple `Future::Output = Ty` constraints.
                     return output;
                 }
             }
index b77245c2592f9abe8cdca374b0ccb1f693345b06..1e3293efad649be1d3e490353ed7b37fe19d979a 100644 (file)
@@ -83,7 +83,7 @@ pub fn super_lattice_tys<'a, 'tcx: 'a, L>(
         // But if we did in reverse order, we would create a `v <:
         // LHS` (or vice versa) constraint and then instantiate
         // `v`. This would require further processing to achieve same
-        // end-result; in partiular, this screws up some of the logic
+        // end-result; in particular, this screws up some of the logic
         // in coercion, which expects LUB to figure out that the LHS
         // is (e.g.) `Box<i32>`. A more obvious solution might be to
         // iterate on the subtype obligations that are returned, but I
index 63ffb5bde38461d79fbe2b90c887dcd073322867..a9b4451e77b08ce0d6d5adac91a98e50572d3d21 100644 (file)
@@ -343,7 +343,7 @@ pub struct InferCtxt<'a, 'tcx> {
 
     /// Track how many errors were reported when this infcx is created.
     /// If the number of errors increases, that's also a sign (line
-    /// `tained_by_errors`) to avoid reporting certain kinds of errors.
+    /// `tainted_by_errors`) to avoid reporting certain kinds of errors.
     // FIXME(matthewjasper) Merge into `tainted_by_errors_flag`
     err_count_on_creation: usize,
 
index cc0114d7538e0e5df8e04c635a5558d1bfb91c7c..94a795f613e9dbfa08da38aae9ed373a92376dcd 100644 (file)
@@ -550,7 +550,7 @@ fn tys(&mut self, a: Ty<'tcx>, mut b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>>
         }
 
         if a == b {
-            // Subtle: if a or b has a bound variable that we are lazilly
+            // Subtle: if a or b has a bound variable that we are lazily
             // substituting, then even if a == b, it could be that the values we
             // will substitute for those bound variables are *not* the same, and
             // hence returning `Ok(a)` is incorrect.
index e8cd5988b96ec93269fc6724c179a0c6c40947c1..78e6f3a05be66c58c46c54a29f59ee3a63ab264d 100644 (file)
@@ -306,7 +306,7 @@ pub fn handle_opaque_type(
     /// # Constrain regions, not the hidden concrete type
     ///
     /// Note that generating constraints on each region `Rc` is *not*
-    /// the same as generating an outlives constraint on `Tc` iself.
+    /// the same as generating an outlives constraint on `Tc` itself.
     /// For example, if we had a function like this:
     ///
     /// ```rust
index fbf149a4788e3fe76feba0bd00c878c58b8dcdcb..291362a61809ea63b33c1270b3f6620b382095c9 100644 (file)
@@ -125,7 +125,7 @@ fn compute_components<'tcx>(
             // regionck more ways to prove that it holds. However,
             // regionck is not (at least currently) prepared to deal with
             // higher-ranked regions that may appear in the
-            // trait-ref. Therefore, if we see any higher-ranke regions,
+            // trait-ref. Therefore, if we see any higher-rank regions,
             // we simply fallback to the most restrictive rule, which
             // requires that `Pi: 'a` for all `i`.
             ty::Projection(ref data) => {
index bd8bb9e1fa9ea2b2eb7420ca1b75afd659028484..97e219ab61de936b1e8dd5e9d67d0ad004a58694 100644 (file)
@@ -93,7 +93,7 @@ pub fn region_bound_pairs_map(&self) -> &FxHashMap<hir::HirId, RegionBoundPairs<
         &self.region_bound_pairs_map
     }
 
-    /// This is a hack to support the old-skool regionck, which
+    /// This is a hack to support the old-school regionck, which
     /// processes region constraints from the main function and the
     /// closure together. In that context, when we enter a closure, we
     /// want to be able to "save" the state of the surrounding a
index 45aa2bcba86f264e02698e48f1d4328895402141..e3312e6c6e14680c2f33736be429396d50768daf 100644 (file)
@@ -365,7 +365,7 @@ fn projection_must_outlive(
         debug!("projection_must_outlive: approx_env_bounds={:?}", approx_env_bounds);
 
         // Remove outlives bounds that we get from the environment but
-        // which are also deducable from the trait. This arises (cc
+        // which are also deducible from the trait. This arises (cc
         // #55756) in cases where you have e.g., `<T as Foo<'a>>::Item:
         // 'a` in the environment but `trait Foo<'b> { type Item: 'b
         // }` in the trait definition.
index 817aaf10053efdf1812244e07f0fde928e6da47b..9ba527862590a682be1a17c75426a72dc20b4290 100644 (file)
@@ -33,7 +33,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
     /// not entirely true. In particular, in the future, we may extend the
     /// environment with implied bounds or other info about how placeholders
     /// relate to regions in outer universes. In that case, `P1: R` for example
-    /// might become solveable.
+    /// might become solvable.
     ///
     /// # Summary of the implementation
     ///
@@ -210,7 +210,7 @@ fn propagate_scc_value(&mut self) -> RelateResult<'tcx, ()> {
         // * `scc_placeholder[scc1]` stores the placeholder that `scc1` must
         //   be equal to (if any)
         //
-        // For each succssor `scc2` where `scc1: scc2`:
+        // For each successor `scc2` where `scc1: scc2`:
         //
         // * `scc_placeholder[scc2]` stores some placeholder `P` where
         //   `scc2: P` (if any)
@@ -243,7 +243,7 @@ fn propagate_scc_value(&mut self) -> RelateResult<'tcx, ()> {
             // Update minimum universe of scc1.
             self.scc_universes[scc1] = scc1_universe;
 
-            // At this point, `scc_placholder[scc1]` stores the placeholder that
+            // At this point, `scc_placeholder[scc1]` stores the placeholder that
             // `scc1` must be equal to, if any.
             if let Some(scc1_placeholder) = self.scc_placeholders[scc1] {
                 debug!(
index 6966f5014464ed7c63a69e6d7f89bdd1ecd06c9c..4ea1c3f76c8ad415e392d44a779de1e6a443af5c 100644 (file)
@@ -46,7 +46,7 @@ pub struct RegionConstraintStorage<'tcx> {
     /// exist). This prevents us from making many such regions.
     glbs: CombineMap<'tcx>,
 
-    /// When we add a R1 == R2 constriant, we currently add (a) edges
+    /// When we add a R1 == R2 constraint, we currently add (a) edges
     /// R1 <= R2 and R2 <= R1 and (b) we unify the two regions in this
     /// table. You can then call `opportunistic_resolve_var` early
     /// which will map R1 and R2 to some common region (i.e., either
index 08358bf506778b85af4c4a1ad8d92ca0d6b970ba..cf9345142afa79631818eab1876ffe764113e5b4 100644 (file)
@@ -55,7 +55,7 @@ fn fold_mir_const(&mut self, constant: mir::ConstantKind<'tcx>) -> mir::Constant
 
 /// The opportunistic region resolver opportunistically resolves regions
 /// variables to the variable with the least variable id. It is used when
-/// normlizing projections to avoid hitting the recursion limit by creating
+/// normalizing projections to avoid hitting the recursion limit by creating
 /// many versions of a predicate for types that in the end have to unify.
 ///
 /// If you want to resolve type and const variables as well, call
index 4f30e78f5e2aa7efba92581e86ab7bee9b64982e..ea4955e9a549a0bf51f315e7a16ba65b16d9ff07 100644 (file)
@@ -929,7 +929,7 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
                 });
             },
             {
-                // We force these querie to run,
+                // We force these queries to run,
                 // since they might not otherwise get called.
                 // This marks the corresponding crate-level attributes
                 // as used, and ensures that their values are valid.
index 5d734fd2ba7052f40ce51164f72ef082cd9ad521..675bee738a672a313c78580618e10f5ba6ea33eb 100644 (file)
@@ -64,7 +64,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
         let substs = cx.typeck_results().node_substs(expr.hir_id);
         if substs.needs_subst() {
             // We can't resolve on types that require monomorphization, so we don't handle them if
-            // we need to perfom substitution.
+            // we need to perform substitution.
             return;
         }
         let param_env = cx.tcx.param_env(trait_id);
index 88e049410790dd40afe59f2e0ef7be0ea1a76e57..5704c6ed3b25d7653e7d0a25e7bad400ae1a759e 100644 (file)
 declare_lint! {
     /// The `nontrivial_structural_match` lint detects constants that are used in patterns,
     /// whose type is not structural-match and whose initializer body actually uses values
-    /// that are not structural-match. So `Option<NotStruturalMatch>` is ok if the constant
+    /// that are not structural-match. So `Option<NotStructuralMatch>` is ok if the constant
     /// is just `None`.
     ///
     /// ### Example
     ///
     /// ### Explanation
     ///
-    /// Previous versions of Rust accepted constants in patterns, even if those constants's types
+    /// Previous versions of Rust accepted constants in patterns, even if those constants' types
     /// did not have `PartialEq` derived. Thus the compiler falls back to runtime execution of
     /// `PartialEq`, which can report that two constants are not equal even if they are
     /// bit-equivalent.
     /// The `deref_into_dyn_supertrait` lint is output whenever there is a use of the
     /// `Deref` implementation with a `dyn SuperTrait` type as `Output`.
     ///
-    /// These implementations will become shadowed when the `trait_upcasting` feature is stablized.
+    /// These implementations will become shadowed when the `trait_upcasting` feature is stabilized.
     /// The `deref` functions will no longer be called implicitly, so there might be behavior change.
     ///
     /// ### Example
index e88ef68c7224d75e0b6df24e83d7632e8ccabe9a..4423a5cac89fda2aa0ca72ee33b30a3f63c63937 100644 (file)
@@ -580,7 +580,7 @@ fn decode(decoder: &mut DecodeContext<'a, 'tcx>) -> Span {
         //
         // Suppose that we're currently compiling crate A, and start deserializing
         // metadata from crate B. When we deserialize a Span from crate B's metadata,
-        // there are two posibilites:
+        // there are two possibilities:
         //
         // 1. The span references a file from crate B. This makes it a 'local' span,
         // which means that we can use crate B's serialized source map information.
index a219b9eb2be832374a8a227c30a85f5158e0922d..611f76b9dde873b1ba761d4138832e50215e0352 100644 (file)
@@ -271,7 +271,7 @@ fn encode(&self, s: &mut EncodeContext<'a, 'tcx>) -> opaque::EncodeResult {
         // from. We use `TAG_VALID_SPAN_FOREIGN` to indicate that a `CrateNum` should
         // be deserialized after the rest of the span data, which tells the deserializer
         // which crate contains the source map information.
-        // 2. This span comes from our own crate. No special hamdling is needed - we just
+        // 2. This span comes from our own crate. No special handling is needed - we just
         // write `TAG_VALID_SPAN_LOCAL` to let the deserializer know that it should use
         // our own source map information.
         //
index 8afa6e70e41839024b8a941d7fd6ecb0cb4a4b2b..1f407b8f6367134a3ccdfddf8a29b03ddeeb2dcb 100644 (file)
@@ -218,7 +218,7 @@ pub fn local_def_id_to_hir_id(self, def_id: LocalDefId) -> HirId {
     }
 
     pub fn iter_local_def_id(self) -> impl Iterator<Item = LocalDefId> + 'hir {
-        // Create a dependency to the crate to be sure we reexcute this when the amount of
+        // Create a dependency to the crate to be sure we re-execute this when the amount of
         // definitions change.
         self.tcx.ensure().hir_crate(());
         self.tcx.untracked_resolutions.definitions.iter_local_def_id()
index f3ea83a32b5864e9d7d413b4d50489f2be463049..6b7ac883f5cebbc5a6b4abbc0da4b8ddd166a69b 100644 (file)
@@ -220,7 +220,7 @@ pub enum Certainty {
     /// distinguish the two (e.g., due to our preference for where
     /// clauses over impls).
     ///
-    /// After some unifiations and things have been done, it makes
+    /// After some unification and things have been done, it makes
     /// sense to try and prove again -- of course, at that point, the
     /// canonical form will be different, making this a distinct
     /// query.
index 1f0cd907f8aceda2b4cb9254f5f484e4b3ab66e2..002d25ab7705d289f77f8e1b10b3d6a222afc466 100644 (file)
@@ -340,7 +340,7 @@ fn struct_lint_level_impl<'s, 'd>(
             (Level::Expect(expect_id), _) => {
                 // This case is special as we actually allow the lint itself in this context, but
                 // we can't return early like in the case for `Level::Allow` because we still
-                // need the lint diagnostic to be emitted to `rustc_error::HanderInner`.
+                // need the lint diagnostic to be emitted to `rustc_error::HandlerInner`.
                 //
                 // We can also not mark the lint expectation as fulfilled here right away, as it
                 // can still be cancelled in the decorate function. All of this means that we simply
index 492091a4f25405f5ed1a47161e8fda432e5752cf..22c5eadf8875afb250df63a86c035aab980ffc89 100644 (file)
@@ -234,7 +234,7 @@ pub enum UndefinedBehaviorInfo<'tcx> {
     },
     /// Something was divided by 0 (x / 0).
     DivisionByZero,
-    /// Something was "remainded" by 0 (x % 0).
+    /// Something was "remaineded" by 0 (x % 0).
     RemainderByZero,
     /// Signed division overflowed (INT_MIN / -1).
     DivisionOverflow,
index eec6eed311bc3e4030010461465a8ff504f7ec86..0a4f84558fee410f229daca537a941b5972c71cc 100644 (file)
@@ -2840,7 +2840,7 @@ pub fn variant(self, adt_def: AdtDef<'tcx>, variant_index: VariantIdx, field: Fi
 
 /// Encodes the effect of a user-supplied type annotation on the
 /// subcomponents of a pattern. The effect is determined by applying the
-/// given list of proejctions to some underlying base type. Often,
+/// given list of projections to some underlying base type. Often,
 /// the projection element list `projs` is empty, in which case this
 /// directly encodes a type in `base`. But in the case of complex patterns with
 /// subpatterns and bindings, we want to apply only a *part* of the type to a variable,
index 811b9da3740d7b4694f79156f81efc14d52e9d68..cee510a42413abbf63457fc6cce2452201deb8f7 100644 (file)
@@ -126,7 +126,7 @@ pub enum UnusedUnsafe {
     /// > ``… because it's nested under this `unsafe fn` ``
     ///
     /// the second HirId here indicates the first usage of the `unsafe` block,
-    /// which allows retrival of the LintLevelSource for why that operation would
+    /// which allows retrieval of the LintLevelSource for why that operation would
     /// have been permitted without the block
     InUnsafeFn(hir::HirId, hir::HirId),
 }
index 480f28620dc8fb0402484e337646cf6f3782502e..d08bede1d733447900eece1c22e6952a98f13d57 100644 (file)
@@ -5,7 +5,7 @@
 /// Preorder traversal of a graph.
 ///
 /// Preorder traversal is when each node is visited after at least one of its predecessors. If you
-/// are familar with some basic graph theory, then this performs a depth first search and returns
+/// are familiar with some basic graph theory, then this performs a depth first search and returns
 /// nodes in order of discovery time.
 ///
 /// ```text
index 170a49124c65673ad8491d2b80958f78ce0f5c11..b31cc17a9594dec915eff548c8b8a679836ed3c0 100644 (file)
@@ -656,7 +656,7 @@ pub enum PatKind<'tcx> {
     /// One of the following:
     /// * `&str`, which will be handled as a string pattern and thus exhaustiveness
     ///   checking will detect if you use the same string twice in different patterns.
-    /// * integer, bool, char or float, which will be handled by exhaustivenes to cover exactly
+    /// * integer, bool, char or float, which will be handled by exhaustiveness to cover exactly
     ///   its own value, similar to `&str`, but these values are much simpler.
     /// * Opaque constants, that must not be matched structurally. So anything that does not derive
     ///   `PartialEq` and `Eq`.
index d852531bc68672075ce0453ec1ca75e4f2a3984e..3d0a0d2a58e1f907b07e0c9c4d1c55f4532847ef 100644 (file)
@@ -524,7 +524,7 @@ pub enum SelectionError<'tcx> {
 ///     // Case A: ImplSource points at a specific impl. Only possible when
 ///     // type is concretely known. If the impl itself has bounded
 ///     // type parameters, ImplSource will carry resolutions for those as well:
-///     concrete.clone(); // ImpleSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
+///     concrete.clone(); // ImplSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
 ///
 ///     // Case A: ImplSource points at a specific impl. Only possible when
 ///     // type is concretely known. If the impl itself has bounded
index 815f4824bc134f8dfbd9fd8b918298236c257fa9..8ce428c9799f5c150d3dc7f3d2d99568477a05b4 100644 (file)
@@ -4,7 +4,7 @@
 
 /// Given a PolyTraitRef, get the PolyTraitRefs of the trait's (transitive) supertraits.
 ///
-/// A simplfied version of the same function at `rustc_infer::traits::util::supertraits`.
+/// A simplified version of the same function at `rustc_infer::traits::util::supertraits`.
 pub fn supertraits<'tcx>(
     tcx: TyCtxt<'tcx>,
     trait_ref: PolyTraitRef<'tcx>,
index 7d950b79cdd8da671d4c1835370355b5c02ffcc1..ee4ba49410010c9677d135a2b82ddd09c227ddd0 100644 (file)
@@ -139,7 +139,7 @@ pub fn suggest_arbitrary_trait_bound(
         (Some(_), "Self") => return false,
         _ => {}
     }
-    // Suggest a where clause bound for a non-type paremeter.
+    // Suggest a where clause bound for a non-type parameter.
     let (action, prefix) = if generics.where_clause.predicates.is_empty() {
         ("introducing a", " where ")
     } else {
index 5b92b33f6d457574b22c0d6cae81887e7d66f636..0c1ab67cc4ac778c21a5a463f36865788d32ada1 100644 (file)
@@ -2718,7 +2718,7 @@ fn fn_sig_for_fn_abi(
 /// stack-based unwinding (the exact mechanism of which varies
 /// platform-by-platform).
 ///
-/// Rust functions are classfied whether or not they can unwind based on the
+/// Rust functions are classified whether or not they can unwind based on the
 /// active "panic strategy". In other words Rust functions are considered to
 /// unwind in `-Cpanic=unwind` mode and cannot unwind in `-Cpanic=abort` mode.
 /// Note that Rust supports intermingling panic=abort and panic=unwind code, but
@@ -2773,7 +2773,7 @@ pub fn fn_can_unwind<'tcx>(
     // To fix this UB rustc would like to change in the future to catch unwinds
     // from function calls that may unwind within a Rust-defined `extern "C"`
     // function and forcibly abort the process, thereby respecting the
-    // `nounwind` attribut emitted for `extern "C"`. This behavior change isn't
+    // `nounwind` attribute emitted for `extern "C"`. This behavior change isn't
     // ready to roll out, so determining whether or not the `C` family of ABIs
     // unwinds is conditional not only on their definition but also whether the
     // `#![feature(c_unwind)]` feature gate is active.
index dfc405b1195ee8ed346b6c7c77157d7eb7ff6cdb..2a7ed6c6d7a88c02bcc3ea5f89f379d0896970f7 100644 (file)
@@ -5,7 +5,7 @@
 //! - [`rustc_middle::ty::Ty`], used to represent the semantics of a type.
 //! - [`rustc_middle::ty::TyCtxt`], the central data structure in the compiler.
 //!
-//! For more information, see ["The `ty` module: representing types"] in the ructc-dev-guide.
+//! For more information, see ["The `ty` module: representing types"] in the rustc-dev-guide.
 //!
 //! ["The `ty` module: representing types"]: https://rustc-dev-guide.rust-lang.org/ty.html
 
@@ -1263,7 +1263,7 @@ pub struct BoundConst<'tcx> {
 /// aren't allowed to call that query: it is equal to `type_of(const_param)` which is
 /// trivial to compute.
 ///
-/// If we now want to use that constant in a place which potentionally needs its type
+/// If we now want to use that constant in a place which potentially needs its type
 /// we also pass the type of its `const_param`. This is the point of `WithOptConstParam`,
 /// except that instead of a `Ty` we bundle the `DefId` of the const parameter.
 /// Meaning that we need to use `type_of(const_param_did)` if `const_param_did` is `Some`
index fecc5d805fcace0670e0805c5767b54ffc07b291..6b3bce7dec50719f0b4144dffd04bbd57f242be9 100644 (file)
@@ -431,7 +431,7 @@ fn try_print_visible_def_path_recur(
             // For example, take `std::os::unix::process::CommandExt`, this trait is actually
             // defined at `std::sys::unix::ext::process::CommandExt` (at time of writing).
             //
-            // `std::os::unix` rexports the contents of `std::sys::unix::ext`. `std::sys` is
+            // `std::os::unix` reexports the contents of `std::sys::unix::ext`. `std::sys` is
             // private so the "true" path to `CommandExt` isn't accessible.
             //
             // In this case, the `visible_parent_map` will look something like this:
@@ -1036,7 +1036,7 @@ fn pretty_print_dyn_existential(
 
                 let mut resugared = false;
 
-                // Special-case `Fn(...) -> ...` and resugar it.
+                // Special-case `Fn(...) -> ...` and re-sugar it.
                 let fn_trait_kind = cx.tcx().fn_trait_kind_from_lang_item(principal.def_id);
                 if !cx.tcx().sess.verbose() && fn_trait_kind.is_some() {
                     if let ty::Tuple(tys) = principal.substs.type_at(0).kind() {
@@ -2171,7 +2171,7 @@ fn name_by_region_index(index: usize) -> Symbol {
         define_scoped_cx!(self);
 
         let mut region_index = self.region_index;
-        // If we want to print verbosly, then print *all* binders, even if they
+        // If we want to print verbosely, then print *all* binders, even if they
         // aren't named. Eventually, we might just want this as the default, but
         // this is not *quite* right and changes the ordering of some output
         // anyways.
index 5a13216846d54e8d8a5ad7c61f33711be0b36989..dd1ccd4e4ef0705704f979b5fd5a944782d05f48 100644 (file)
@@ -284,7 +284,7 @@ pub fn article(&self) -> &'static str {
 /// - 'l0...'li and T0...Tj are the generic parameters
 ///   in scope on the function that defined the closure,
 /// - CK represents the *closure kind* (Fn vs FnMut vs FnOnce). This
-///   is rather hackily encoded via a scalar type. See
+///   is rather hacky encoded via a scalar type. See
 ///   `Ty::to_opt_closure_kind` for details.
 /// - CS represents the *closure signature*, representing as a `fn()`
 ///   type. For example, `fn(u32, u32) -> u32` would mean that the closure
index c724e3e1b8f2af94e4b97e5c4a211660af96dd2b..310fdf77b6fc75d71d9661979e736f63e86259af 100644 (file)
@@ -444,7 +444,7 @@ fn bind_pattern(
             // we lower the guard.
             let target_block = self.cfg.start_new_block();
             let mut schedule_drops = true;
-            // We keep a stack of all of the bindings and type asciptions
+            // We keep a stack of all of the bindings and type descriptions
             // from the parent candidates that we visit, that also need to
             // be bound for each candidate.
             traverse_candidate(
index 96069f05b40f3ad30e5a3ef2515f294d579ec011..4b880876d3f6366a832c3fa24bee25107c83b71a 100644 (file)
@@ -234,7 +234,7 @@ pub(super) fn perform_test(
                     };
                     TerminatorKind::if_(self.tcx, Operand::Copy(place), true_bb, false_bb)
                 } else {
-                    // The switch may be inexhaustive so we have a catch all block
+                    // The switch may be inexhaustible so we have a catch all block
                     debug_assert_eq!(options.len() + 1, target_blocks.len());
                     let otherwise_block = *target_blocks.last().unwrap();
                     let switch_targets = SwitchTargets::new(
index b2ea2889b3e048b55d13783b7a2d1f5ecb1edac7..d96534fe3e0a879e6f7287dbf19ec36ee9478b03 100644 (file)
@@ -567,7 +567,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
         let tcx = self.tcx;
         if let LintLevel::Explicit(current_hir_id) = lint_level {
             // Use `maybe_lint_level_root_bounded` with `root_lint_level` as a bound
-            // to avoid adding Hir dependences on our parents.
+            // to avoid adding Hir dependencies on our parents.
             // We estimate the true lint roots here to avoid creating a lot of source scopes.
 
             let parent_root = tcx.maybe_lint_level_root_bounded(
@@ -965,7 +965,7 @@ fn leave_top_scope(&mut self, block: BasicBlock) -> BasicBlock {
     /// However, `_X` is still registered to be dropped, and so if we
     /// do nothing else, we would generate a `DROP(_X)` that occurs
     /// after the call. This will later be optimized out by the
-    /// drop-elaboation code, but in the meantime it can lead to
+    /// drop-elaboration code, but in the meantime it can lead to
     /// spurious borrow-check errors -- the problem, ironically, is
     /// not the `DROP(_X)` itself, but the (spurious) unwind pathways
     /// that it creates. See #64391 for an example.
index 612bed639bfb1f383232e5a8ca2a3e8d8daaf174..8aa422252be7ebd90be679d7edf37e3c535bf430 100644 (file)
@@ -1007,7 +1007,7 @@ pub(super) fn new<'p>(pcx: PatCtxt<'_, 'p, 'tcx>) -> Self {
             {
                 // `usize`/`isize` are not allowed to be matched exhaustively unless the
                 // `precise_pointer_size_matching` feature is enabled. So we treat those types like
-                // `#[non_exhaustive]` enums by returning a special unmatcheable constructor.
+                // `#[non_exhaustive]` enums by returning a special unmatchable constructor.
                 smallvec![NonExhaustive]
             }
             &ty::Int(ity) => {
@@ -1650,7 +1650,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                     }
 
                     // Without `cx`, we can't know which field corresponds to which, so we can't
-                    // get the names of the fields. Instead we just display everything as a suple
+                    // get the names of the fields. Instead we just display everything as a simple
                     // struct, which should be good enough.
                     write!(f, "(")?;
                     for p in self.iter_fields() {
index 176723ab28b676905d58445e753f7c0167a9c2f3..15bb5adf8ba19a2768836a0a11ce5f8397cc9f82 100644 (file)
@@ -62,7 +62,7 @@
 //!
 //! Note: we will often abbreviate "constructor" as "ctor".
 //!
-//! The idea that powers everything that is done in this file is the following: a (matcheable)
+//! The idea that powers everything that is done in this file is the following: a (matchable)
 //! value is made from a constructor applied to a number of subvalues. Examples of constructors are
 //! `Some`, `None`, `(,)` (the 2-tuple constructor), `Foo {..}` (the constructor for a struct
 //! `Foo`), and `2` (the constructor for the number `2`). This is natural when we think of
@@ -71,7 +71,7 @@
 //! Some of the ctors listed above might feel weird: `None` and `2` don't take any arguments.
 //! That's ok: those are ctors that take a list of 0 arguments; they are the simplest case of
 //! ctors. We treat `2` as a ctor because `u64` and other number types behave exactly like a huge
-//! `enum`, with one variant for each number. This allows us to see any matcheable value as made up
+//! `enum`, with one variant for each number. This allows us to see any matchable value as made up
 //! from a tree of ctors, each having a set number of children. For example: `Foo { bar: None,
 //! baz: Ok(0) }` is made from 4 different ctors, namely `Foo{..}`, `None`, `Ok` and `0`.
 //!
@@ -342,7 +342,7 @@ pub(super) struct PatCtxt<'a, 'p, 'tcx> {
     /// Whether the current pattern is the whole pattern as found in a match arm, or if it's a
     /// subpattern.
     pub(super) is_top_level: bool,
-    /// Wether the current pattern is from a `non_exhaustive` enum.
+    /// Whether the current pattern is from a `non_exhaustive` enum.
     pub(super) is_non_exhaustive: bool,
 }
 
index 84491d0c2ad198d092b32332d4fa56be41238937..f568121b2192c71bb779bbc2c58003db7fdff335 100644 (file)
@@ -860,7 +860,7 @@ fn open_drop(&mut self) -> BasicBlock {
             // and this is ok because `open_drop` here can only be reached
             // within that own generator's resume function.
             // This should only happen for the self argument on the resume function.
-            // It effetively only contains upvars until the generator transformation runs.
+            // It effectively only contains upvars until the generator transformation runs.
             // See librustc_body/transform/generator.rs for more details.
             ty::Generator(_, substs, _) => {
                 let tys: Vec<_> = substs.as_generator().upvar_tys().collect();
index 4871320fdb5c08e11e1cbae159cb00407eaab561..602ccec76a68cb7daa5471c78f4e0401fa63c9c6 100644 (file)
@@ -40,7 +40,7 @@
 ///
 /// This makes `MaybeLiveLocals` unsuitable for certain classes of optimization normally associated
 /// with a live variables analysis, notably dead-store elimination. It's a dirty hack, but it works
-/// okay for the generator state transform (currently the main consumuer of this analysis).
+/// okay for the generator state transform (currently the main consumer of this analysis).
 ///
 /// [`MaybeBorrowedLocals`]: super::MaybeBorrowedLocals
 /// [flow-test]: https://github.com/rust-lang/rust/blob/a08c47310c7d49cbdc5d7afb38408ba519967ecd/src/test/ui/mir-dataflow/liveness-ptr.rs
index 87c1060f55257b4fb840b838fc0d365266567250..d90ead3228c2dc7b7a804b6b25f4b0af03b9eb9b 100644 (file)
@@ -428,7 +428,7 @@ fn bottom_value(&self, _: &mir::Body<'tcx>) -> Self::Domain {
 
     // sets on_entry bits for Arg places
     fn initialize_start_block(&self, _: &mir::Body<'tcx>, state: &mut Self::Domain) {
-        // set all bits to 1 (uninit) before gathering counterevidence
+        // set all bits to 1 (uninit) before gathering counter-evidence
         state.insert_all();
 
         drop_flag_effects_for_function_entry(self.tcx, self.body, self.mdpe, |path, s| {
index 8de05990cdf1dca992db8d1985f5cab5a49f1a01..f5d82315c4e38db79274477a6bb5494bcc66b3bd 100644 (file)
@@ -149,7 +149,7 @@ fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, _location:
             self.check_mut_borrowing_layout_constrained_field(*place, context.is_mutating_use());
         }
 
-        // Some checks below need the extra metainfo of the local declaration.
+        // Some checks below need the extra meta info of the local declaration.
         let decl = &self.body.local_decls[place.local];
 
         // Check the base local: it might be an unsafe-to-access static. We only check derefs of the
index 4f5fc38917f4350c788807e40828fd053dfaa5d4..e1dbf90b5b9e7d0d10b3edc28b8f0801d1e8be20 100644 (file)
@@ -634,7 +634,7 @@ fn const_prop(&mut self, rvalue: &Rvalue<'tcx>, place: Place<'tcx>) -> Option<()
         }
     }
 
-    // Attempt to use albegraic identities to eliminate constant expressions
+    // Attempt to use algebraic identities to eliminate constant expressions
     fn eval_rvalue_with_identities(
         &mut self,
         rvalue: &Rvalue<'tcx>,
index da921904523c4b5a2ca0c9554df5fee2acd1383d..9d02f58ae65ee71578003a8621350b707a157534 100644 (file)
@@ -66,7 +66,7 @@ fn update_from_expression_operand(&mut self, operand_id: u32) {
                 // The operand ID is outside the known range of counter IDs and also outside the
                 // known range of expression IDs. In either case, the result of a missing operand
                 // (if and when used in an expression) will be zero, so from a computation
-                // perspective, it doesn't matter whether it is interepretted as a counter or an
+                // perspective, it doesn't matter whether it is interpreted as a counter or an
                 // expression.
                 //
                 // However, the `num_counters` and `num_expressions` query results are used to
index a36ba9300e4ff9bbbd9a97a31664c0aa0ebceee3..5e366d7fb7dde9c953e423a5b3531f3773e32473 100644 (file)
@@ -694,7 +694,7 @@ fn carve_out_span_for_closure(&mut self) {
     /// If prev.span() was split off to the right of a closure, prev.span().lo() will be
     /// greater than prev_original_span.lo(). The actual span of `prev_original_span` is
     /// not as important as knowing that `prev()` **used to have the same span** as `curr(),
-    /// which means their sort order is still meaningful for determinating the dominator
+    /// which means their sort order is still meaningful for determining the dominator
     /// relationship.
     ///
     /// When two `CoverageSpan`s have the same `Span`, dominated spans can be discarded; but if
@@ -726,7 +726,7 @@ fn hold_pending_dups_unless_dominated(&mut self) {
                 self.prev()
             );
             self.cutoff_prev_at_overlapping_curr();
-        // If one span dominates the other, assocate the span with the code from the dominated
+        // If one span dominates the other, associate the span with the code from the dominated
         // block only (`curr`), and discard the overlapping portion of the `prev` span. (Note
         // that if `prev.span` is wider than `prev_original_span`, a `CoverageSpan` will still
         // be created for `prev`s block, for the non-overlapping portion, left of `curr.span`.)
index d72e8d16105879d9761accce0e9f4fac7783fcb0..5bde0c01412ac3106ff9009af281b1d20b158786 100644 (file)
@@ -260,7 +260,7 @@ fn may_hoist<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, place: Place<'tcx>) ->
     for (place, proj) in place.iter_projections() {
         match proj {
             // Dereferencing in the computation of `place` might cause issues from one of two
-            // cateogires. First, the referrent might be invalid. We protect against this by
+            // categories. First, the referent might be invalid. We protect against this by
             // dereferencing references only (not pointers). Second, the use of a reference may
             // invalidate other references that are used later (for aliasing reasons). Consider
             // where such an invalidated reference may appear:
index ad96bf544cbd339b41a1f95dd665cc2b5a0baa78..04b5c4e0919588480d5d31f8770a84c8b1ea4585 100644 (file)
@@ -500,7 +500,7 @@ fn locals_live_across_suspend_points<'tcx>(
                 // The `liveness` variable contains the liveness of MIR locals ignoring borrows.
                 // This is correct for movable generators since borrows cannot live across
                 // suspension points. However for immovable generators we need to account for
-                // borrows, so we conseratively assume that all borrowed locals are live until
+                // borrows, so we conservatively assume that all borrowed locals are live until
                 // we find a StorageDead statement referencing the locals.
                 // To do this we just union our `liveness` result with `borrowed_locals`, which
                 // contains all the locals which has been borrowed before this suspension point.
index 23e5f0b4f30c3a394de5fab5b0f449b472fd1661..f9ca4a00c989ce85f2b2ba5d41c7ab7a2b9acf2e 100644 (file)
@@ -698,7 +698,7 @@ fn make_call_args(
             // The `closure_ref` in our example above.
             let closure_ref_arg = iter::once(self_);
 
-            // The `tmp0`, `tmp1`, and `tmp2` in our example abonve.
+            // The `tmp0`, `tmp1`, and `tmp2` in our example above.
             let tuple_tmp_args = tuple_tys.iter().enumerate().map(|(i, ty)| {
                 // This is e.g., `tuple_tmp.0` in our example above.
                 let tuple_field = Operand::Move(tcx.mk_place_field(tuple, Field::new(i), ty));
index de93ab7059f87ecd29db70a4f46b25aa8bc46266..ea1ec6249bca49bf9ee418c9f0f1b21fda25a05b 100644 (file)
@@ -8,7 +8,7 @@
 use rustc_session::Limit;
 
 // FIXME: check whether it is cheaper to precompute the entire call graph instead of invoking
-// this query riddiculously often.
+// this query ridiculously often.
 #[instrument(level = "debug", skip(tcx, root, target))]
 crate fn mir_callgraph_reachable<'tcx>(
     tcx: TyCtxt<'tcx>,
index ec25f298d48e0aefe62ddadba2daf99f78100f30..444b4126e88fc15960b16025e0451a7339161a1b 100644 (file)
@@ -64,7 +64,7 @@ fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut mir::Body<'tcx>) {
         let (renamed_decl, ret_decl) =
             body.local_decls.pick2_mut(returned_local, mir::RETURN_PLACE);
 
-        // Sometimes, the return place is assigned a local of a different but coercable type, for
+        // Sometimes, the return place is assigned a local of a different but coercible type, for
         // example `&mut T` instead of `&T`. Overwriting the `LocalInfo` for the return place means
         // its type may no longer match the return type of its function. This doesn't cause a
         // problem in codegen because these two types are layout-compatible, but may be unexpected.
index 77fb092d5806f31c95a10be67d9bae9be2b08cee..03b9ecc959695f126e77db8a5b28c52d817b65ac 100644 (file)
@@ -36,7 +36,7 @@ fn is_nop_landing_pad(
                 | StatementKind::AscribeUserType(..)
                 | StatementKind::Coverage(..)
                 | StatementKind::Nop => {
-                    // These are all nops in a landing pad
+                    // These are all noops in a landing pad
                 }
 
                 StatementKind::Assign(box (place, Rvalue::Use(_) | Rvalue::Discriminant(_))) => {
index d7fb706311434b8bcfd3a8509f2919fb26cf008e..efa45883eab4b13155443b41880227cc89d40e1c 100644 (file)
@@ -12,7 +12,7 @@
 /// that point.
 ///
 /// This is redundant with drop elaboration, but we need to do it prior to const-checking, and
-/// running const-checking after drop elaboration makes it opimization dependent, causing issues
+/// running const-checking after drop elaboration makes it optimization dependent, causing issues
 /// like [#90770].
 ///
 /// [#90770]: https://github.com/rust-lang/rust/issues/90770
index 39f78e9555e2f6a0d660624dd0094901c0c99d28..921a11a3a06d2d660c89ec7f7c825855c8983e23 100644 (file)
@@ -2,7 +2,7 @@
 //!
 //! When the MIR is built, we check `needs_drop` before emitting a `Drop` for a place. This pass is
 //! useful because (unlike MIR building) it runs after type checking, so it can make use of
-//! `Reveal::All` to provide more precies type information.
+//! `Reveal::All` to provide more precise type information.
 
 use crate::MirPass;
 use rustc_middle::mir::*;
index ce4b45062e8de7d0ca9ab61351245ea7cb7c07b4..70e2e8d75e8188d291cd624934661df54758da79 100644 (file)
@@ -72,7 +72,7 @@ struct ArmIdentityInfo<'tcx> {
     /// (StorageLive index,, StorageDead index, Local)
     storage_stmts: Vec<(usize, usize, Local)>,
 
-    /// The statements that should be removed (turned into nops)
+    /// The statements that should be removed (turned into noops)
     stmts_to_remove: Vec<usize>,
 
     /// Indices of debug variables that need to be adjusted to point to
index 681271be7beb9be54bf9425cab8c835372bbf2eb..c4ffb19f87a91a6595a193c858b0c4fdbd47496b 100644 (file)
@@ -501,7 +501,7 @@ fn mono_item_visibility<'tcx>(
         // * First is weak lang items. These are basically mechanisms for
         //   libcore to forward-reference symbols defined later in crates like
         //   the standard library or `#[panic_handler]` definitions. The
-        //   definition of these weak lang items needs to be referenceable by
+        //   definition of these weak lang items needs to be referencable by
         //   libcore, so we're no longer a candidate for internalization.
         //   Removal of these functions can't be done by LLVM but rather must be
         //   done by the linker as it's a non-local decision.
index 48b6951f10ef0751b8230b4d6e65154b67696d5c..8ddfdc632f73c49885a211e4a938359f09145349 100644 (file)
@@ -65,7 +65,7 @@ fn unused_generic_params<'tcx>(
     mark_used_by_default_parameters(tcx, def_id, generics, &mut unused_parameters);
     debug!(?unused_parameters, "(after default)");
 
-    // Visit MIR and accumululate used generic parameters.
+    // Visit MIR and accumulate used generic parameters.
     let body = match tcx.hir().body_const_context(def_id.expect_local()) {
         // Const functions are actually called and should thus be considered for polymorphization
         // via their runtime MIR.
index 534fd0d4816dd98ea1b1911c629dc2c3cecc5c7f..8f64d6d732fab357640c4af025fa79118676c8e8 100644 (file)
@@ -203,7 +203,7 @@ pub(super) fn diagnostic(&self) -> &'a Handler {
         &self.sess.span_diagnostic
     }
 
-    /// Relace `self` with `snapshot.parser` and extend `unclosed_delims` with `snapshot.unclosed_delims`.
+    /// Replace `self` with `snapshot.parser` and extend `unclosed_delims` with `snapshot.unclosed_delims`.
     /// This is to avoid losing unclosed delims errors `create_snapshot_for_diagnostic` clears.
     pub(super) fn restore_snapshot(&mut self, snapshot: SnapshotParser<'a>) {
         *self = snapshot.parser;
index 148e0a24ec304f5b38793a7f2a07224d21dd3979..abcf9ab204759d25ce524533884f43a9422c5bd4 100644 (file)
@@ -276,7 +276,7 @@ pub(super) fn parse_assoc_expr_with(
                 lhs = self.parse_assoc_op_ascribe(lhs, lhs_span)?;
                 continue;
             } else if op == AssocOp::DotDot || op == AssocOp::DotDotEq {
-                // If we didn’t have to handle `x..`/`x..=`, it would be pretty easy to
+                // If we did not have to handle `x..`/`x..=`, it would be pretty easy to
                 // generalise it to the Fixity::None code.
                 lhs = self.parse_range_expr(prec, lhs, op, cur_op_span)?;
                 break;
index 5d244ef9118a64e61cfce9d79edde016f2f53bf9..b242c1e050dc0a97be01cc0a428a1aba584462c8 100644 (file)
@@ -150,7 +150,7 @@ pub struct Parser<'a> {
     pub current_closure: Option<ClosureSpans>,
 }
 
-/// Stores span informations about a closure.
+/// Stores span information about a closure.
 #[derive(Clone)]
 pub struct ClosureSpans {
     pub whole_closure: Span,
index a6a2cbc277c208c98643d87fb80d82f202f703ad..00bac26a16a98bd3fa17cfc86e1d1b14fab0c690 100644 (file)
@@ -729,7 +729,7 @@ fn integer(&mut self) -> Option<usize> {
 
 /// Finds the indices of all characters that have been processed and differ between the actual
 /// 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.
+/// in order to properly synthesise the intra-string `Span`s for error diagnostics.
 fn find_skips_from_snippet(
     snippet: Option<string::String>,
     str_style: Option<usize>,
index 0e04a2cfb11adf68ba2217ab1a52cf3317362df5..9e352fa5cc6736f066c0df47cbb83266a3fd015a 100644 (file)
@@ -99,7 +99,7 @@ fn visit_item<'hir>(&mut self, item: &'hir hir::Item<'hir>) {
                         } = *trait_item
                         {
                             // we can ignore functions that do not have default bodies:
-                            // if those are unimplemented it will be catched by typeck.
+                            // if those are unimplemented it will be caught by typeck.
                             if !defaultness.has_value()
                                 || self
                                     .tcx
index fdf93e5893247aa94bc69cef4af37127b8dd80e4..36c1739ebc56cb3640e1fd8ce72717e18165efaf 100644 (file)
@@ -291,7 +291,7 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
     // like AddAssign is implemented).
 
     // For primitive types (which, despite having a trait impl, don't actually
-    // end up calling it), the evluation order is right-to-left. For example,
+    // end up calling it), the evaluation order is right-to-left. For example,
     // the following code snippet:
     //
     //    let y = &mut 0;
index 09be1dac6f1638e33abbfd353a477492cb03b656..170972e0e7d267a62cd16c4df5c5b1332ebc5601 100644 (file)
@@ -144,7 +144,7 @@ fn annotate<F>(
         }
 
         if !self.tcx.features().staged_api {
-            // Propagate unstability.  This can happen even for non-staged-api crates in case
+            // Propagate instability.  This can happen even for non-staged-api crates in case
             // -Zforce-unstable-if-unmarked is set.
             if let Some(stab) = self.parent_stab {
                 if inherit_deprecation.yes() && stab.level.is_unstable() {
@@ -344,7 +344,7 @@ fn visit_item(&mut self, i: &'tcx Item<'tcx>) {
         match i.kind {
             // Inherent impls and foreign modules serve only as containers for other items,
             // they don't have their own stability. They still can be annotated as unstable
-            // and propagate this unstability to children, but this annotation is completely
+            // and propagate this instability to children, but this annotation is completely
             // optional. They inherit stability from their parents when unannotated.
             hir::ItemKind::Impl(hir::Impl { of_trait: None, .. })
             | hir::ItemKind::ForeignMod { .. } => {
@@ -557,7 +557,7 @@ fn nested_visit_map(&mut self) -> Self::Map {
     fn visit_item(&mut self, i: &'tcx Item<'tcx>) {
         // Inherent impls and foreign modules serve only as containers for other items,
         // they don't have their own stability. They still can be annotated as unstable
-        // and propagate this unstability to children, but this annotation is completely
+        // and propagate this instability to children, but this annotation is completely
         // optional. They inherit stability from their parents when unannotated.
         if !matches!(
             i.kind,
index 1f286d557ca0baf5dfdae0138e4c92d802e1a575..cc64dd2af2c3c969baaea62afece4456992ac5ac 100644 (file)
@@ -559,9 +559,9 @@ fn update_macro_reachable_def(
                 }
             }
 
-            // Hygine isn't really implemented for `macro_rules!` macros at the
+            // Hygiene isn't really implemented for `macro_rules!` macros at the
             // moment. Accordingly, marking them as reachable is unwise. `macro` macros
-            // have normal  hygine, so we can treat them like other items without type
+            // have normal hygiene, so we can treat them like other items without type
             // privacy and mark them reachable.
             DefKind::Macro(_) => {
                 let item = self.tcx.hir().expect_item(def_id);
@@ -1539,7 +1539,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
                             // 3. mentioned in the associated types of the impl
                             //
                             // Those in 1. can only occur if the trait is in
-                            // this crate and will've been warned about on the
+                            // this crate and will have been warned about on the
                             // trait definition (there's no need to warn twice
                             // so we don't check the methods).
                             //
@@ -1999,7 +1999,7 @@ fn visibility(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Visibility {
                 }
                 // - AST lowering may clone `use` items and the clones don't
                 //   get their entries in the resolver's visibility table.
-                // - AST lowering also creates opaque type items with inherited visibilies.
+                // - AST lowering also creates opaque type items with inherited visibilities.
                 //   Visibility on them should have no effect, but to avoid the visibility
                 //   query failing on some items, we provide it for opaque types as well.
                 Node::Item(hir::Item {
index 7fd20b45e77cd7ff465595569081d08f8455b0a8..1f8d87a7e913fc3ced081d5b717174b3ac14ef7a 100644 (file)
@@ -7,7 +7,7 @@
 //! The serialisation is performed on-demand when each node is emitted. Using this
 //! scheme, we do not need to keep the current graph in memory.
 //!
-//! The deserisalisation is performed manually, in order to convert from the stored
+//! The deserialization is performed manually, in order to convert from the stored
 //! sequence of NodeInfos to the different arrays in SerializedDepGraph.  Since the
 //! node and edge count are stored at the end of the file, all the arrays can be
 //! pre-allocated with the right length.
index d1685006881d5c3aa783b865ec55ce0c54b58a54..6c7d4afea67ee240578fc85d272bf1494a58d641 100644 (file)
@@ -1603,7 +1603,7 @@ pub(crate) fn check_for_module_export_macro(
                 // Remove the `removal_span`.
                 corrections.push((removal_span, "".to_string()));
 
-                // Find the span after the crate name and if it has nested imports immediatately
+                // Find the span after the crate name and if it has nested imports immediately
                 // after the crate name already.
                 //   ie. `use a::b::{c, d};`
                 //               ^^^^^^^^^
index 4f0dad13b5bbeed1540b9d0d3d3ac59ab05ed967..253b604bd232e9ee9e7237d021ac86c421230442 100644 (file)
@@ -74,7 +74,7 @@ pub enum ImportKind<'a> {
     /// In the case where the `Import` was expanded from a "nested" use tree,
     /// this id is the ID of the leaf tree. For example:
     ///
-    /// ```ignore (pacify the mercilous tidy)
+    /// ```ignore (pacify the merciless tidy)
     /// use foo::bar::{a, b}
     /// ```
     ///
index c8ca51348cc7199ffeb60e76d6fd016ae80b32d7..b05ec6549976e8a8a18aa6c5da6e77e5e57b8526 100644 (file)
@@ -2151,7 +2151,7 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
                             // but if we make a mistake elsewhere, mainly by keeping something in
                             // `missing_named_lifetime_spots` that we shouldn't, like associated
                             // `const`s or making a mistake in the AST lowering we would provide
-                            // non-sensical suggestions. Guard against that by skipping these.
+                            // nonsensical suggestions. Guard against that by skipping these.
                             // (#74264)
                             continue;
                         }
index bcae735bb7e5aa7c133b9cbae3c0668fbb241db9..afb19d7df9fce035b0e1730829f643a364a335ef 100644 (file)
@@ -261,7 +261,7 @@ enum Scope<'a> {
         s: ScopeRef<'a>,
     },
 
-    /// When we have nested trait refs, we concanetate late bound vars for inner
+    /// When we have nested trait refs, we concatenate late bound vars for inner
     /// trait refs from outer ones. But we also need to include any HRTB
     /// lifetimes encountered when identifying the trait that an associated type
     /// is declared on.
@@ -282,8 +282,8 @@ enum BinderScopeType {
     /// Any non-concatenating binder scopes.
     Normal,
     /// Within a syntactic trait ref, there may be multiple poly trait refs that
-    /// are nested (under the `associcated_type_bounds` feature). The binders of
-    /// the innner poly trait refs are extended from the outer poly trait refs
+    /// are nested (under the `associated_type_bounds` feature). The binders of
+    /// the inner poly trait refs are extended from the outer poly trait refs
     /// and don't increase the late bound depth. If you had
     /// `T: for<'a>  Foo<Bar: for<'b> Baz<'a, 'b>>`, then the `for<'b>` scope
     /// would be `Concatenating`. This also used in trait refs in where clauses
@@ -2930,7 +2930,7 @@ fn visit_generic_args(
                 path_span: Span,
                 generic_args: &'v hir::GenericArgs<'v>,
             ) {
-                // parenthesized args enter a new elison scope
+                // parenthesized args enter a new elision scope
                 if generic_args.parenthesized {
                     return;
                 }
index 19eeae4cf233ba238c386074af156becf4350707..48675fa88270adf3ec06b2f80a825c97138a213e 100644 (file)
@@ -506,7 +506,7 @@ pub fn name(&self) -> Option<Symbol> {
 /// program) if all but one of them come from glob imports.
 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
 struct BindingKey {
-    /// The identifier for the binding, aways the `normalize_to_macros_2_0` version of the
+    /// The identifier for the binding, always the `normalize_to_macros_2_0` version of the
     /// identifier.
     ident: Ident,
     ns: Namespace,
index dc94ba49a5400b7b64640229519bb37dc942e880..3a90908c0df0ac387898fb83564c09f45b46e031 100644 (file)
@@ -69,7 +69,7 @@ pub enum MacroRulesScope<'a> {
 /// The reason is that we update scopes with value `MacroRulesScope::Invocation(invoc_id)`
 /// in-place after `invoc_id` gets expanded.
 /// This helps to avoid uncontrollable growth of `macro_rules!` scope chains,
-/// which usually grow lineraly with the number of macro invocations
+/// which usually grow linearly with the number of macro invocations
 /// in a module (including derives) and hurt performance.
 pub(crate) type MacroRulesScopeRef<'a> = Interned<'a, Cell<MacroRulesScope<'a>>>;
 
index 51f73ac2eb199f5d8cc518c28310116f40dd7f98..1eb575e0db2a606dfdba520f48ce3563c4172700 100644 (file)
@@ -1437,7 +1437,7 @@ fn visit_local(&mut self, l: &'tcx hir::Local<'tcx>) {
         self.process_macro_use(l.span);
         self.process_var_decl(&l.pat);
 
-        // Just walk the initialiser and type (don't want to walk the pattern again).
+        // Just walk the initializer and type (don't want to walk the pattern again).
         walk_list!(self, visit_ty, &l.ty);
         walk_list!(self, visit_expr, &l.init);
     }
index 86adfa7a18cdf7f5573a7067833566d6c298c847..937e0cf045ad25d61aba2936baa364f4f1cf1edf 100644 (file)
@@ -1177,7 +1177,7 @@ pub struct HygieneEncodeContext {
     /// that we don't accidentally try to encode any more `SyntaxContexts`
     serialized_ctxts: Lock<FxHashSet<SyntaxContext>>,
     /// The `SyntaxContexts` that we have serialized (e.g. as a result of encoding `Spans`)
-    /// in the most recent 'round' of serializnig. Serializing `SyntaxContextData`
+    /// in the most recent 'round' of serializing. Serializing `SyntaxContextData`
     /// may cause us to serialize more `SyntaxContext`s, so serialize in a loop
     /// until we reach a fixed point.
     latest_ctxts: Lock<FxHashSet<SyntaxContext>>,
index 84dbad846dd29c445e4283fee48feedc7333f36e..f66c3ab15b04aa48dac2452f2b66c04bc163c00f 100644 (file)
@@ -1637,7 +1637,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 /// hygiene data, most importantly name of the crate it refers to.
 /// As a result we print `$crate` as `crate` if it refers to the local crate
 /// and as `::other_crate_name` if it refers to some other crate.
-/// Note, that this is only done if the ident token is printed from inside of AST pretty-pringing,
+/// Note, that this is only done if the ident token is printed from inside of AST pretty-printing,
 /// but not otherwise. Pretty-printing is the only way for proc macros to discover token contents,
 /// so we should not perform this lossy conversion if the top level call to the pretty-printer was
 /// done for a token stream or a single token.
@@ -1812,7 +1812,7 @@ fn to_stable_hash_key(&self, _: &CTX) -> String {
 // revisited after further improvements to `indexmap`.
 //
 // This type is private to prevent accidentally constructing more than one
-// `Interner` on the same thread, which makes it easy to mixup `Symbol`s
+// `Interner` on the same thread, which makes it easy to mix up `Symbol`s
 // between `Interner`s.
 #[derive(Default)]
 struct InternerInner {
index 601b3e7d33b87ff15aed15e538357bc38a308cdc..72709d31021b2238c4313741d228b7b6cacb1e02 100644 (file)
@@ -159,7 +159,7 @@ fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, in_registers_max: S
             // Unions and are always treated as a series of 64-bit integer chunks
         }
         abi::FieldsShape::Arbitrary { .. } => {
-            // Stuctures with floating point numbers need special care.
+            // Structures with floating point numbers need special care.
 
             let mut data = parse_structure(
                 cx,
index 5af3a6b41e2cbd49e879300a0c6fc22fa0aad1a3..cc3c31538a46e01f8229777b0016978109f08194 100644 (file)
@@ -49,7 +49,7 @@ pub fn target() -> Target {
     //        setLibcallCallingConv(RTLIB::UREM_I64, CallingConv::X86_StdCall);
     //        setLibcallCallingConv(RTLIB::MUL_I64, CallingConv::X86_StdCall);
     //      }
-    //   The compiler intrisics should be implemented by compiler-builtins.
+    //   The compiler intrinsics should be implemented by compiler-builtins.
     //   Unfortunately, compiler-builtins has not provided those intrinsics yet. Such as:
     //      i386/divdi3.S
     //      i386/lshrdi3.S
@@ -64,7 +64,7 @@ pub fn target() -> Target {
     //   2. Implement Intrinsics.
     //   We evaluated all options.
     //   #2 is hard because we need implement the intrinsics (_aulldiv) generated
-    //   from the other intrinscis (__udivdi3) implementation with the same
+    //   from the other intrinsics (__udivdi3) implementation with the same
     //   functionality (udivmod_inner). If we let _aulldiv() call udivmod_inner!(),
     //   then we are in loop. We may have to find another way to implement udivmod_inner!().
     //   #1.2 may break the existing usage.
@@ -73,7 +73,7 @@ pub fn target() -> Target {
     //   It uses cdecl, EAX/ECX/EDX as volatile register, and EAX/EDX as return value.
     //   We also checked the LLVM X86TargetLowering, the differences between -gnu and -msvc
     //   is fmodf(f32), longjmp() and TLS. None of them impacts the UEFI code.
-    // As a result, we choose -gnu for i686 version before those intrisics are implemented in
+    // As a result, we choose -gnu for i686 version before those intrinsics are implemented in
     // compiler-builtins. After compiler-builtins implements all required intrinsics, we may
     // remove -gnu and use the default one.
     Target {
index f2ca28ba5f9351245b209a0c67b12b4620b3d955..61e234251ec31b717ebc67127b714c133cde7ad6 100644 (file)
@@ -1147,7 +1147,7 @@ pub struct TargetOptions {
     /// Linker arguments used in addition to `late_link_args` if at least one
     /// Rust dependency is dynamically linked.
     pub late_link_args_dynamic: LinkArgs,
-    /// Linker arguments used in addition to `late_link_args` if aall Rust
+    /// Linker arguments used in addition to `late_link_args` if all Rust
     /// dependencies are statically linked.
     pub late_link_args_static: LinkArgs,
     /// Linker arguments that are unconditionally passed *after* any
@@ -1255,7 +1255,7 @@ pub struct TargetOptions {
     /// handling COFF object files with more than 2<sup>15</sup> sections. Since each weak
     /// symbol needs its own COMDAT section, weak linkage implies a large
     /// number sections that easily exceeds the given limit for larger
-    /// codebases. Consequently we want a way to disallow weak linkage on some
+    /// codebase. Consequently we want a way to disallow weak linkage on some
     /// platforms.
     pub allows_weak_linkage: bool,
     /// Whether the linker support rpaths or not. Defaults to false.
index 71aa279144bb943433a09154351071b0e4f58c0b..e1a23b213f0f8a9fd609a4c6b3220b5ed8bd93b4 100644 (file)
@@ -109,7 +109,7 @@ pub fn options() -> TargetOptions {
         crt_objects_fallback: Some(CrtObjectsFallback::Wasm),
 
         // This has no effect in LLVM 8 or prior, but in LLVM 9 and later when
-        // PIC code is implemented this has quite a drastric effect if it stays
+        // PIC code is implemented this has quite a drastic effect if it stays
         // at the default, `pic`. In an effort to keep wasm binaries as minimal
         // as possible we're defaulting to `static` for now, but the hope is
         // that eventually we can ship a `pic`-compatible standard library which
index 06287f00faddb00c717c816f8808bb750aa1bf49..4b949ff8b95de3710ffd4fcd18fdf40d68f7122f 100644 (file)
@@ -139,7 +139,7 @@ fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
         match *r {
             // Ignore bound regions and `'static` regions that appear in the
             // type, we only need to remap regions that reference lifetimes
-            // from the function declaraion.
+            // from the function declaration.
             // This would ignore `'r` in a type like `for<'r> fn(&'r u32)`.
             ty::ReLateBound(..) | ty::ReStatic => return r,
 
index 4b6784aee9782c0066287e8df29e08f52c199f3e..249205f8b12b4a26f9322528b0e591e1513712e4 100644 (file)
@@ -46,8 +46,8 @@ pub fn codegen_fulfill_obligation<'tcx>(
             Ok(Some(selection)) => selection,
             Ok(None) => {
                 // Ambiguity can happen when monomorphizing during trans
-                // expands to some humongo type that never occurred
-                // statically -- this humongo type can then overflow,
+                // expands to some humongous type that never occurred
+                // statically -- this humongous type can then overflow,
                 // leading to an ambiguous result. So report this as an
                 // overflow bug, since I believe this is the only case
                 // where ambiguity can result.
index ec4f8084e212d437047b24f1f74731afdc9b63ce..40c3f4047ae6efc1732354fa2bb795b13e12fc61 100644 (file)
@@ -114,7 +114,7 @@ pub fn overlapping_impls<F1, F2, R>(
     }
 
     // In the case where we detect an error, run the check again, but
-    // this time tracking intercrate ambuiguity causes for better
+    // this time tracking intercrate ambiguity causes for better
     // diagnostics. (These take time and can lead to false errors.)
     tcx.infer_ctxt().enter(|infcx| {
         let selcx = &mut SelectionContext::intercrate(&infcx);
@@ -762,7 +762,7 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
         ty::Foreign(did) => def_id_is_local(did, in_crate),
         ty::Opaque(..) => {
             // This merits some explanation.
-            // Normally, opaque types are not involed when performing
+            // Normally, opaque types are not involved when performing
             // coherence checking, since it is illegal to directly
             // implement a trait on an opaque type. However, we might
             // end up looking at an opaque type during coherence checking
index d114515eca1564a8a3f96ea70cb5fe076546335f..2b9cc75f1b7531e840e351cdac73af183e31e00f 100644 (file)
@@ -408,7 +408,7 @@ fn check_unop(op: mir::UnOp) -> bool {
     }
 
     /// Builds the abstract const by walking the thir and bailing out when
-    /// encountering an unspported operation.
+    /// encountering an unsupported operation.
     fn build(mut self) -> Result<&'tcx [Node<'tcx>], ErrorGuaranteed> {
         debug!("Abstractconstbuilder::build: body={:?}", &*self.body);
         self.recurse_build(self.body_id)?;
@@ -701,7 +701,7 @@ struct ConstUnifyCtxt<'tcx> {
 
 impl<'tcx> ConstUnifyCtxt<'tcx> {
     // Substitutes generics repeatedly to allow AbstractConsts to unify where a
-    // ConstKind::Unevalated could be turned into an AbstractConst that would unify e.g.
+    // ConstKind::Unevaluated could be turned into an AbstractConst that would unify e.g.
     // Param(N) should unify with Param(T), substs: [Unevaluated("T2", [Unevaluated("T3", [Param(N)])])]
     #[inline]
     #[instrument(skip(self), level = "debug")]
index 39da99ac252933860659f9f8a7b9a17153d30be0..505d78d800a3a388a5db1e528a2e16e13ecc008d 100644 (file)
@@ -230,7 +230,7 @@ fn suggest_restriction<'tcx>(
     {
         // We know we have an `impl Trait` that doesn't satisfy a required projection.
 
-        // Find all of the ocurrences of `impl Trait` for `Trait` in the function arguments'
+        // Find all of the occurrences of `impl Trait` for `Trait` in the function arguments'
         // types. There should be at least one, but there might be *more* than one. In that
         // case we could just ignore it and try to identify which one needs the restriction,
         // but instead we choose to suggest replacing all instances of `impl Trait` with `T`
index 1b8628344671db5a577f57a66e68bcc836ae2034..c004848c6c86f1ac913e25b9ea2ce7278dcaa381 100644 (file)
@@ -61,7 +61,7 @@ pub struct FulfillmentContext<'tcx> {
     // Should this fulfillment context register type-lives-for-region
     // obligations on its parent infcx? In some cases, region
     // obligations are either already known to hold (normalization) or
-    // hopefully verifed elsewhere (type-impls-bound), and therefore
+    // hopefully verified elsewhere (type-impls-bound), and therefore
     // should not be checked.
     //
     // Note that if we are normalizing a type that we already
index 88750f272c8d3a0c7aa29e03960a8e1cb2addc44..8240f5c542a617fb1f325679d01140de108e746d 100644 (file)
@@ -539,7 +539,7 @@ fn prepare_vtable_segments<'tcx, T>(
     // the main traversal loop:
     // basically we want to cut the inheritance directed graph into a few non-overlapping slices of nodes
     // that each node is emitted after all its descendents have been emitted.
-    // so we convert the directed graph into a tree by skipping all previously visted nodes using a visited set.
+    // so we convert the directed graph into a tree by skipping all previously visited nodes using a visited set.
     // this is done on the fly.
     // Each loop run emits a slice - it starts by find a "childless" unvisited node, backtracking upwards, and it
     // stops after it finds a node that has a next-sibling node.
index d4ec677a0b1c55602601c8edf29222e865e29562..6bba6b19b90ae8e6173478e07bd2c7832d992427 100644 (file)
@@ -1566,7 +1566,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
                 // fn bar<T:SomeTrait<Foo=usize>>(...) { ... }
                 // ```
                 //
-                // Doesn't the `T : Sometrait<Foo=usize>` predicate help
+                // Doesn't the `T : SomeTrait<Foo=usize>` predicate help
                 // resolve `T::Foo`? And of course it does, but in fact
                 // that single predicate is desugared into two predicates
                 // in the compiler: a trait predicate (`T : SomeTrait`) and a
@@ -1989,7 +1989,7 @@ fn confirm_impl_candidate<'cx, 'tcx>(
 // Get obligations corresponding to the predicates from the where-clause of the
 // associated type itself.
 // Note: `feature(generic_associated_types)` is required to write such
-// predicates, even for non-generic associcated types.
+// predicates, even for non-generic associated types.
 fn assoc_ty_own_obligations<'cx, 'tcx>(
     selcx: &mut SelectionContext<'cx, 'tcx>,
     obligation: &ProjectionTyObligation<'tcx>,
index 8997a7895abea9eef3a1c76345116a2d8ed7b816..25cc6e9f9f2f178d127653fc104c3133a9b61a0b 100644 (file)
@@ -58,7 +58,7 @@ fn dropck_outlives(&self, ty: Ty<'tcx>) -> InferOk<'tcx, Vec<GenericArg<'tcx>>>
             return InferOk { value: kinds, obligations };
         }
 
-        // Errors and ambiuity in dropck occur in two cases:
+        // Errors and ambiguity in dropck occur in two cases:
         // - unresolved inference variables at the end of typeck
         // - non well-formed types where projections cannot be resolved
         // Either of these should have created an error before.
index b13646ba1a0c27e4a24154c0836d5acbb5b51349..56bdeafeecae4d1d875d769a855c9d9a8797d2cc 100644 (file)
@@ -23,7 +23,7 @@ pub(crate) fn update<'tcx, T>(
             ..tpred.trait_ref
         };
 
-        // Then contstruct a new obligation with Self = () added
+        // Then construct a new obligation with Self = () added
         // to the ParamEnv, and see if it holds.
         let o = rustc_infer::traits::Obligation::new(
             ObligationCause::dummy(),
index 42f17721f9b545c7f8dfd321f28238f06062a9ba..1271b679d5cec0577f9608ead0ceef12403014b6 100644 (file)
@@ -562,7 +562,7 @@ fn evaluate_predicate_recursively<'o>(
                                 {
                                     // If the result is something that we can cache, then mark this
                                     // entry as 'complete'. This will allow us to skip evaluating the
-                                    // suboligations at all the next time we evaluate the projection
+                                    // subobligations at all the next time we evaluate the projection
                                     // predicate.
                                     self.infcx
                                         .inner
@@ -751,7 +751,7 @@ fn evaluate_trait_predicate_recursively<'o>(
                     // provisional caches entries and inserting them into the evaluation cache
                     //
                     // This ensures that when a query reads this entry from the evaluation cache,
-                    // it will end up (transitively) dependening on all of the incr-comp dependencies
+                    // it will end up (transitively) depending on all of the incr-comp dependencies
                     // created during the evaluation of this trait. For example, evaluating a trait
                     // will usually require us to invoke `type_of(field_def_id)` to determine the
                     // constituent types, and we want any queries reading from this evaluation
@@ -1475,7 +1475,7 @@ fn where_clause_may_apply<'o>(
     /// `No` if it does not. Return `Ambiguous` in the case that the projection type is a GAT,
     /// and applying this env_predicate constrains any of the obligation's GAT substitutions.
     ///
-    /// This behavior is a somewhat of a hack to prevent overconstraining inference variables
+    /// This behavior is a somewhat of a hack to prevent over-constraining inference variables
     /// in cases like #91762.
     pub(super) fn match_projection_projections(
         &mut self,
@@ -1729,7 +1729,7 @@ fn candidate_should_be_dropped_in_favor_of(
                             // marker trait impls.
                             //
                             // Without this restriction, we could end up accidentally
-                            // constrainting inference variables based on an arbitrarily
+                            // constraining inference variables based on an arbitrarily
                             // chosen trait impl.
                             //
                             // Imagine we have the following code:
@@ -1758,7 +1758,7 @@ fn candidate_should_be_dropped_in_favor_of(
                             // some other means (e.g. type-checking of a function). We will
                             // then be in a position to drop marker trait candidates
                             // without constraining inference variables (since there are
-                            // none left to constrin)
+                            // none left to constrain)
                             // 2) Be left with some unconstrained inference variables. We
                             // will then correctly report an inference error, since the
                             // existence of multiple marker trait impls tells us nothing
@@ -2518,7 +2518,7 @@ struct ProvisionalEvaluationCache<'tcx> {
     /// - `A B C` and we add a cache for the result of C (DFN 2)
     /// - Then we have a stack `A B D` where `D` has DFN 3
     /// - We try to solve D by evaluating E: `A B D E` (DFN 4)
-    /// - `E` generates various cache entries which have cyclic dependices on `B`
+    /// - `E` generates various cache entries which have cyclic dependencies on `B`
     ///   - `A B D E F` and so forth
     ///   - the DFN of `F` for example would be 5
     /// - then we determine that `E` is in error -- we will then clear
index 4f65bf989de0847180e91e68b5df5dba528df922..1a10b07cc2706fa28038dc04960ebfab847c212c 100644 (file)
@@ -345,7 +345,7 @@ pub(crate) fn complain_about_missing_associated_types(
             if potential_assoc_types.len() == assoc_items.len() {
                 // Only suggest when the amount of missing associated types equals the number of
                 // extra type arguments present, as that gives us a relatively high confidence
-                // that the user forgot to give the associtated type's name. The canonical
+                // that the user forgot to give the associated type's name. The canonical
                 // example would be trying to use `Iterator<isize>` instead of
                 // `Iterator<Item = isize>`.
                 for (potential, item) in iter::zip(&potential_assoc_types, assoc_items) {
index b04d304d2ca15f930c43097b4300058531c794b3..46e8d3f71d0bbe536e2e9614e1015b6eec34b225 100644 (file)
@@ -290,7 +290,7 @@ pub fn ast_path_substs_for_ty(
     /// 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.
-    /// Constraints on associated typess are created from `create_assoc_bindings_for_generic_args`.
+    /// Constraints on associated types are created from `create_assoc_bindings_for_generic_args`.
     ///
     /// Example:
     ///
@@ -1435,7 +1435,7 @@ trait here instead: `trait NewTrait: {} {{}}`",
                         // If the projection output contains `Self`, force the user to
                         // elaborate it explicitly to avoid a lot of complexity.
                         //
-                        // The "classicaly useful" case is the following:
+                        // The "classically useful" case is the following:
                         // ```
                         //     trait MyTrait: FnMut() -> <Self as MyTrait>::MyOutput {
                         //         type MyOutput;
@@ -1768,7 +1768,7 @@ fn one_bound_for_assoc_type<I>(
     // Will fail except for `T::A` and `Self::A`; i.e., if `qself_ty`/`qself_def` are not a type
     // parameter or `Self`.
     // NOTE: When this function starts resolving `Trait::AssocTy` successfully
-    // it should also start reportint the `BARE_TRAIT_OBJECTS` lint.
+    // it should also start reporting the `BARE_TRAIT_OBJECTS` lint.
     pub fn associated_path_to_ty(
         &self,
         hir_ref_id: hir::HirId,
index 2f5f804c56f78dee26659656d3f26753f83fe5ce..320be9b44d4410df41d770523ff6364fae58e2e9 100644 (file)
@@ -721,7 +721,7 @@ fn deduce_future_output_from_projection(
             return None;
         }
 
-        // The `Future` trait has only one associted item, `Output`,
+        // The `Future` trait has only one associated item, `Output`,
         // so check that this is what we see.
         let output_assoc_item = self.tcx.associated_item_def_ids(future_trait)[0];
         if output_assoc_item != predicate.projection_ty.item_def_id {
index 2f973a54f88a7b621ff734ba5257df1c64b4e62f..34fc177de6de0d31841b3df893f49649ba7e7e5b 100644 (file)
@@ -18,7 +18,7 @@
 //!
 //! ## Subtle note
 //!
-//! When infering the generic arguments of functions, the argument
+//! When inferring the generic arguments of functions, the argument
 //! order is relevant, which can lead to the following edge case:
 //!
 //! ```rust
index 81cebaef3aa9283f240a140b9d5e92e87ecb7d23..82641a489f66a949267e103c1a53319aef73cde9 100644 (file)
@@ -590,7 +590,7 @@ fn check_expr_break(
                 let opt_coerce_to = {
                     // We should release `enclosing_breakables` before the `check_expr_with_hint`
                     // below, so can't move this block of code to the enclosing scope and share
-                    // `ctxt` with the second `encloding_breakables` borrow below.
+                    // `ctxt` with the second `enclosing_breakables` borrow below.
                     let mut enclosing_breakables = self.enclosing_breakables.borrow_mut();
                     match enclosing_breakables.opt_find_breakable(target_id) {
                         Some(ctxt) => ctxt.coerce.as_ref().map(|coerce| coerce.expected_ty()),
@@ -793,7 +793,7 @@ fn check_expr_return(
         self.tcx.types.never
     }
 
-    /// `explicit_return` is `true` if we're checkng an explicit `return expr`,
+    /// `explicit_return` is `true` if we're checking an explicit `return expr`,
     /// and `false` if we're checking a trailing expression.
     pub(super) fn check_return_expr(
         &self,
@@ -1126,7 +1126,7 @@ fn check_method_call(
         let method = match self.lookup_method(rcvr_t, segment, span, expr, rcvr, args) {
             Ok(method) => {
                 // We could add a "consider `foo::<params>`" suggestion here, but I wasn't able to
-                // trigger this codepath causing `structuraly_resolved_type` to emit an error.
+                // trigger this codepath causing `structurally_resolved_type` to emit an error.
 
                 self.write_method_call(expr.hir_id, method);
                 Ok(method)
index b7b45929e1463c46604a6937fd6501a3eb597b69..4d3fdea1fc373959e96c71496fd8f0129ff3689c 100644 (file)
@@ -158,7 +158,7 @@ pub(in super::super) fn check_argument_types(
                 }
                 _ => {
                     // Otherwise, there's a mismatch, so clear out what we're expecting, and set
-                    // our input typs to err_args so we don't blow up the error messages
+                    // our input types to err_args so we don't blow up the error messages
                     struct_span_err!(
                         tcx.sess,
                         call_span,
index 4fa7ed82c6a8456891c77c42ff8a224685e8c724..800232d9549b8e46eb4a1ed05eb5d5ed236e5484 100644 (file)
@@ -206,7 +206,7 @@ struct DropRangesBuilder {
     /// NodeInfo struct for more details, but this information includes things
     /// such as the set of control-flow successors, which variables are dropped
     /// or reinitialized, and whether each variable has been inferred to be
-    /// known-dropped or potentially reintiialized at each point.
+    /// known-dropped or potentially reinitialized at each point.
     nodes: IndexVec<PostOrderId, NodeInfo>,
     /// We refer to values whose drop state we are tracking by the HirId of
     /// where they are defined. Within a NodeInfo, however, we store the
index f4dd4cc010d3c82f2a2b96518ba4557af37d5fd9..75a8ad8a159b52c658f829c03ab4030a11316e10 100644 (file)
@@ -50,7 +50,7 @@ pub(super) fn build_control_flow_graph<'tcx>(
 ///
 /// 1. Moving a variable `a` counts as a move of the whole variable.
 /// 2. Moving a partial path like `a.b.c` is ignored.
-/// 3. Reinitializing through a field (e.g. `a.b.c = 5`) counds as a reinitialization of all of
+/// 3. Reinitializing through a field (e.g. `a.b.c = 5`) counts as a reinitialization of all of
 ///    `a`.
 ///
 /// Some examples:
index 5d91b3b46a176928427d9958b1bea7cf2dcccdce..e3782fe5911df50cd2f383c1bf4d94ef41d16388 100644 (file)
@@ -713,7 +713,7 @@ fn assemble_inherent_impl_probe(&mut self, impl_def_id: DefId) {
             // FIXME Postponing the normalization of the return type likely only hides a deeper bug,
             // which might be caused by the `param_env` itself. The clauses of the `param_env`
             // maybe shouldn't include `Param`s, but rather fresh variables or be canonicalized,
-            // see isssue #89650
+            // see issue #89650
             let cause = traits::ObligationCause::misc(self.span, self.body_id);
             let selcx = &mut traits::SelectionContext::new(self.fcx);
             let traits::Normalized { value: xform_self_ty, obligations } =
@@ -1658,7 +1658,7 @@ fn collapse_candidates_to_trait_pick(
     }
 
     /// Similarly to `probe_for_return_type`, this method attempts to find the best matching
-    /// candidate method where the method name may have been misspelt. Similarly to other
+    /// candidate method where the method name may have been misspelled. Similarly to other
     /// Levenshtein based suggestions, we provide at most one such suggestion.
     fn probe_for_lev_candidate(&mut self) -> Result<Option<ty::AssocItem>, MethodError<'tcx>> {
         debug!("probing for method names similar to {:?}", self.method_name);
index e1d6b5d2bd425672b7a07ded2a29a4a2cc09b14e..b05f0e4d3c38934204b367851bca6c12282a65a1 100644 (file)
@@ -270,7 +270,7 @@ pub fn report_method_error(
                         (None, true) => "variant",
                     }
                 };
-                // FIXME(eddyb) this intendation is probably unnecessary.
+                // FIXME(eddyb) this indentation is probably unnecessary.
                 let mut err = {
                     // Suggest clamping down the type if the method that is being attempted to
                     // be used exists at all, and the type is an ambiguous numeric type
@@ -279,7 +279,7 @@ pub fn report_method_error(
                         .into_iter()
                         .filter_map(|info| self.associated_value(info.def_id, item_name));
                     // There are methods that are defined on the primitive types and won't be
-                    // found when exploring `all_traits`, but we also need them to be acurate on
+                    // found when exploring `all_traits`, but we also need them to be accurate on
                     // our suggestions (#47759).
                     let found_assoc = |ty: Ty<'tcx>| {
                         simplify_type(tcx, ty, TreatParams::AsPlaceholders)
index b6111793678aa84349b98ca7573fb09b24390a1a..bf0bf2ed59b5b616a2b9f3d08086547b26643c0c 100644 (file)
@@ -665,7 +665,7 @@ fn missing_items_must_implement_one_of_err(
     err.emit();
 }
 
-/// Resugar `ty::GenericPredicates` in a way suitable to be used in structured suggestions.
+/// Re-sugar `ty::GenericPredicates` in a way suitable to be used in structured suggestions.
 fn bounds_from_generic_predicates<'tcx>(
     tcx: TyCtxt<'tcx>,
     predicates: ty::GenericPredicates<'tcx>,
index 9b37985ce49329026dde73a4a15ced77df9d31d3..811833bca803143c606d07afed124be1d015d00a 100644 (file)
@@ -852,7 +852,7 @@ fn lookup_op_method(
 }
 
 // Binary operator categories. These categories summarize the behavior
-// with respect to the builtin operationrs supported.
+// with respect to the builtin operations supported.
 enum BinOpCategory {
     /// &&, || -- cannot be overridden
     Shortcircuit,
index d66230acb8bda7bf45d5a392b6d1d8c700b02526..464a2cd9524839df7175bf37b1d6e492238b1f26 100644 (file)
@@ -308,7 +308,7 @@ fn calc_adjust_mode(&self, pat: &'tcx Pat<'tcx>, opt_path_res: Option<Res>) -> A
                 // In the `ValueNS`, we have `SelfCtor(..) | Ctor(_, Const), _)` remaining which
                 // could successfully compile. The former being `Self` requires a unit struct.
                 // In either case, and unlike constants, the pattern itself cannot be
-                // a reference type wherefore peeling doesn't give up any expressivity.
+                // a reference type wherefore peeling doesn't give up any expressiveness.
                 _ => AdjustMode::Peel,
             },
             // When encountering a `& mut? pat` pattern, reset to "by value".
@@ -460,7 +460,7 @@ fn check_pat_range(
                 // The early check here is not for correctness, but rather better
                 // diagnostics (e.g. when `&str` is being matched, `expected` will
                 // be peeled to `str` while ty here is still `&str`, if we don't
-                // err ealy here, a rather confusing unification error will be
+                // err early here, a rather confusing unification error will be
                 // emitted instead).
                 let fail =
                     !(ty.is_numeric() || ty.is_char() || ty.is_ty_var() || ty.references_error());
@@ -1343,7 +1343,7 @@ fn check_struct_pat_fields(
         match (inexistent_fields_err, unmentioned_err) {
             (Some(mut i), Some(mut u)) => {
                 if let Some(mut e) = self.error_tuple_variant_as_struct_pat(pat, fields, variant) {
-                    // We don't want to show the inexistent fields error when this was
+                    // We don't want to show the nonexistent fields error when this was
                     // `Foo { a, b }` when it should have been `Foo(a, b)`.
                     i.delay_as_bug();
                     u.delay_as_bug();
index 70bc46c5123b6d21a3b1c813e5175ad9faed9a81..0b343a5f905c467bbef1c2366bc097a307aac262 100644 (file)
@@ -304,7 +304,7 @@ fn analyze_closure(
         );
 
         // Build a tuple (U0..Un) of the final upvar types U0..Un
-        // and unify the upvar tupe type in the closure with it:
+        // and unify the upvar tuple type in the closure with it:
         let final_tupled_upvars_type = self.tcx.mk_tup(final_upvar_tys.iter());
         self.demand_suptype(span, substs.tupled_upvars_ty(), final_tupled_upvars_type);
 
@@ -545,7 +545,7 @@ fn compute_min_captures(
             // capture information.
             //
             // - if descendant is found, remove it from the list, and update the current place's
-            // capture information to account for the descendants's capture kind.
+            // capture information to account for the descendant's capture kind.
             //
             // We can never be in a case where the list contains both an ancestor and a descendant
             // Also there can only be ancestor but in case of descendants there might be
@@ -661,7 +661,7 @@ fn compute_min_captures(
         // Now that we have the minimized list of captures, sort the captures by field id.
         // This causes the closure to capture the upvars in the same order as the fields are
         // declared which is also the drop order. Thus, in situations where we capture all the
-        // fields of some type, the obserable drop order will remain the same as it previously
+        // fields of some type, the observable drop order will remain the same as it previously
         // was even though we're dropping each capture individually.
         // See https://github.com/rust-lang/project-rfc-2229/issues/42 and
         // `src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs`.
@@ -1396,7 +1396,7 @@ fn has_significant_drop_outside_of_captures(
             // Observations:
             // - `captured_by_move_projs` is not empty. Therefore we can call
             //   `captured_by_move_projs.first().unwrap()` safely.
-            // - All entries in `captured_by_move_projs` have atleast one projection.
+            // - All entries in `captured_by_move_projs` have at least one projection.
             //   Therefore we can call `captured_by_move_projs.first().unwrap().first().unwrap()` safely.
 
             // We don't capture derefs in case of move captures, which would have be applied to
@@ -1612,7 +1612,7 @@ fn determine_capture_mutability(
                 // We don't capture derefs of raw ptrs
                 ty::RawPtr(_) => unreachable!(),
 
-                // Derefencing a mut-ref allows us to mut the Place if we don't deref
+                // Dereferencing a mut-ref allows us to mut the Place if we don't deref
                 // an immut-ref after on top of this.
                 ty::Ref(.., hir::Mutability::Mut) => is_mutbl = hir::Mutability::Mut,
 
@@ -1873,7 +1873,7 @@ fn restrict_precision_for_unsafe<'tcx>(
         }
 
         if proj.ty.is_union() {
-            // Don't capture preicse fields of a union.
+            // Don't capture precise fields of a union.
             truncate_place_to_len_and_update_capture_kind(&mut place, &mut curr_mode, i + 1);
             break;
         }
@@ -1885,7 +1885,7 @@ fn restrict_precision_for_unsafe<'tcx>(
 /// Truncate projections so that following rules are obeyed by the captured `place`:
 /// - No Index projections are captured, since arrays are captured completely.
 /// - No unsafe block is required to capture `place`
-/// Returns the truncated place and updated cature mode.
+/// Returns the truncated place and updated capture mode.
 fn restrict_capture_precision<'tcx>(
     place: Place<'tcx>,
     curr_mode: ty::UpvarCapture,
@@ -2059,7 +2059,7 @@ fn migration_suggestion_for_2229(
 /// It is the caller's duty to figure out which path_expr_id to use.
 ///
 /// If both the CaptureKind and Expression are considered to be equivalent,
-/// then `CaptureInfo` A is preferred. This can be useful in cases where we want to priortize
+/// then `CaptureInfo` A is preferred. This can be useful in cases where we want to prioritize
 /// expressions reported back to the user as part of diagnostics based on which appears earlier
 /// in the closure. This can be achieved simply by calling
 /// `determine_capture_info(existing_info, current_info)`. This works out because the
index 250576bff048f8e40a8d2d873ebd2ee7fc50204e..5b3aee7428829ea6259156a485f10c87372d3fe8 100644 (file)
@@ -510,7 +510,7 @@ fn gather_gat_bounds<'tcx, T: TypeFoldable<'tcx>>(
 
     for (region_a, region_a_idx) in &regions {
         // Ignore `'static` lifetimes for the purpose of this lint: it's
-        // because we know it outlives everything and so doesn't give meaninful
+        // because we know it outlives everything and so doesn't give meaningful
         // clues
         if let ty::ReStatic = **region_a {
             continue;
@@ -677,9 +677,9 @@ fn resolve_regions_with_wf_tys<'tcx>(
 struct GATSubstCollector<'tcx> {
     tcx: TyCtxt<'tcx>,
     gat: DefId,
-    // Which region appears and which parameter index its subsituted for
+    // Which region appears and which parameter index its substituted for
     regions: FxHashSet<(ty::Region<'tcx>, usize)>,
-    // Which params appears and which parameter index its subsituted for
+    // Which params appears and which parameter index its substituted for
     types: FxHashSet<(Ty<'tcx>, usize)>,
 }
 
index ecbd1e463491b9f960c3c0f97214ba63662707d4..9d5c8d5ec3b2101370642454a64509555ecb1611 100644 (file)
@@ -209,7 +209,7 @@ fn fix_index_builtin_expr(&mut self, e: &hir::Expr<'_>) {
             if let Some(ty::Ref(_, base_ty, _)) = base_ty {
                 let index_ty = typeck_results.expr_ty_adjusted_opt(index).unwrap_or_else(|| {
                     // When encountering `return [0][0]` outside of a `fn` body we would attempt
-                    // to access an unexistend index. We assume that more relevant errors will
+                    // to access an nonexistent index. We assume that more relevant errors will
                     // already have been emitted, so we only gate on this with an ICE if no
                     // error has been emitted. (#64638)
                     self.fcx.tcx.ty_error_with_message(
index 6a4c5d4a6c7ea34d168d5b2d2f680b552537c965..93b74027ba3176597a9284bcb49b2c3a52e7c80c 100644 (file)
@@ -2928,7 +2928,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
                     // The `#[target_feature]` attribute is allowed on
                     // WebAssembly targets on all functions, including safe
                     // ones. Other targets require that `#[target_feature]` is
-                    // only applied to unsafe funtions (pending the
+                    // only applied to unsafe functions (pending the
                     // `target_feature_11` feature) because on most targets
                     // execution of instructions that are not supported is
                     // considered undefined behavior. For WebAssembly which is a
index 95d1b6a15f51ab8b8f81826dac40bf424071e49d..cb32e88588af2578e120f324bda8e199af18dc94 100644 (file)
@@ -43,7 +43,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<
         // In the above code we would call this query with the def_id of 3 and
         // the parent_node we match on would be the hir node for Self::Assoc<3>
         //
-        // `Self::Assoc<3>` cant be resolved without typchecking here as we
+        // `Self::Assoc<3>` cant be resolved without typechecking here as we
         // didnt write <Self as Foo>::Assoc<3>. If we did then another match
         // arm would handle this.
         //
index 7b709b302f630a0b0369f32c5f9c9f84acf4e7fc..b4b438a561a21266c3308786de770270ac9f85a6 100644 (file)
@@ -173,7 +173,7 @@ struct EraseAllBoundRegions<'tcx> {
 // `ItemCtxt::to_ty`. To make things simpler, we just erase all
 // of them, regardless of depth. At worse, this will give
 // us an inaccurate span for an error message, but cannot
-// lead to unsoundess (we call `delay_span_bug` at the start
+// lead to unsoundness (we call `delay_span_bug` at the start
 // of `diagnostic_hir_wf_check`).
 impl<'tcx> TypeFolder<'tcx> for EraseAllBoundRegions<'tcx> {
     fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
index 16049089151c40f44d9239f22c5d8d5c74a13f91..8b376e26dee9759417939c737c77737a5468a368 100644 (file)
@@ -187,7 +187,7 @@ fn enforce_impl_params_are_constrained(
 
     // (*) This is a horrible concession to reality. I think it'd be
     // better to just ban unconstrained lifetimes outright, but in
-    // practice people do non-hygenic macros like:
+    // practice people do non-hygienic macros like:
     //
     // ```
     // macro_rules! __impl_slice_eq1 {
index d0f1db67c6e50aec605c507adc168002a8a5e958..a117ed68ff7d019d829cc1b71f3a00ef646ffe6a 100644 (file)
@@ -484,7 +484,7 @@ fn suggest_adding_lifetime_args(&self, err: &mut Diagnostic) {
         let msg = format!("add missing {} argument{}", self.kind(), pluralize!(num_missing_args));
 
         // we first try to get lifetime name suggestions from scope or elision information. If none is
-        // available we use the parameter defintions
+        // available we use the parameter definitions
         let suggested_args = if let Some(hir_id) = self.path_segment.hir_id {
             if let Some(lifetimes_in_scope) = self.tcx.lifetime_scope(hir_id) {
                 match lifetimes_in_scope {
@@ -587,7 +587,7 @@ fn suggest_adding_type_and_const_args(&self, err: &mut Diagnostic) {
                     (gen_args_span.shrink_to_lo(), true)
                 } else {
                     let arg_span = self.gen_args.args[sugg_offset - 1].span();
-                    // If we came here then inferred lifetimes's spans can only point
+                    // If we came here then inferred lifetime's spans can only point
                     // to either the opening bracket or to the space right after.
                     // Both of these spans have an `hi` lower than or equal to the span
                     // of the generics excluding the brackets.