From 5160f8f843e1dbd43cf341cc8aa5d917d22c98b9 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Wed, 30 Mar 2022 15:14:15 -0400 Subject: Spellchecking compiler comments 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. --- compiler/rustc_parse/src/parser/diagnostics.rs | 2 +- compiler/rustc_parse/src/parser/expr.rs | 2 +- compiler/rustc_parse/src/parser/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 534fd0d4816..8f64d6d732f 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -203,7 +203,7 @@ impl<'a> Parser<'a> { &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; diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 148e0a24ec3..abcf9ab2047 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -276,7 +276,7 @@ impl<'a> Parser<'a> { 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; diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 5d244ef9118..b242c1e050d 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -150,7 +150,7 @@ pub struct Parser<'a> { pub current_closure: Option, } -/// Stores span informations about a closure. +/// Stores span information about a closure. #[derive(Clone)] pub struct ClosureSpans { pub whole_closure: Span, -- cgit 1.4.1-3-g733a5 From a6dd6582540ad20e385bcf8326968aa94f33694b Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Wed, 30 Mar 2022 17:04:46 -0400 Subject: Addressed comments by @compiler-errors and @bjorn3 --- compiler/rustc_apfloat/src/ieee.rs | 2 +- compiler/rustc_codegen_cranelift/src/pretty_clif.rs | 2 +- compiler/rustc_infer/src/infer/outlives/components.rs | 2 +- compiler/rustc_infer/src/infer/region_constraints/leak_check.rs | 2 +- compiler/rustc_middle/src/mir/interpret/error.rs | 2 +- compiler/rustc_mir_build/src/build/matches/mod.rs | 2 +- compiler/rustc_mir_build/src/build/matches/test.rs | 2 +- compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs | 2 +- compiler/rustc_parse/src/parser/expr.rs | 2 +- compiler/rustc_passes/src/stability.rs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_apfloat/src/ieee.rs b/compiler/rustc_apfloat/src/ieee.rs index 193f3145dc1..3db8adb2a24 100644 --- a/compiler/rustc_apfloat/src/ieee.rs +++ b/compiler/rustc_apfloat/src/ieee.rs @@ -2646,7 +2646,7 @@ mod sig { // Convert the result having "2 * precision" significant-bits back to the one // having "precision" significant-bits. First, move the radix point from - // position "2*precision - 1" to "precision - 1". The exponent need to be + // poision "2*precision - 1" to "precision - 1". The exponent need to be // adjusted by "2*precision - 1" - "precision - 1" = "precision". *exp -= precision as ExpInt + 1; diff --git a/compiler/rustc_codegen_cranelift/src/pretty_clif.rs b/compiler/rustc_codegen_cranelift/src/pretty_clif.rs index 90024c5921a..ca7116b887d 100644 --- a/compiler/rustc_codegen_cranelift/src/pretty_clif.rs +++ b/compiler/rustc_codegen_cranelift/src/pretty_clif.rs @@ -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 = collocated u0:6 sig1 ; Instance { def: Item(DefId(0/0:31 ~ example[8787]::{{impl}}[1]::call_mut[0])), substs: [ReErased, ReErased] } +//! fn0 = colocated 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 diff --git a/compiler/rustc_infer/src/infer/outlives/components.rs b/compiler/rustc_infer/src/infer/outlives/components.rs index 291362a6180..5ea096f5cc2 100644 --- a/compiler/rustc_infer/src/infer/outlives/components.rs +++ b/compiler/rustc_infer/src/infer/outlives/components.rs @@ -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-rank regions, + // trait-ref. Therefore, if we see any higher-ranked regions, // we simply fallback to the most restrictive rule, which // requires that `Pi: 'a` for all `i`. ty::Projection(ref data) => { diff --git a/compiler/rustc_infer/src/infer/region_constraints/leak_check.rs b/compiler/rustc_infer/src/infer/region_constraints/leak_check.rs index 9ba52786259..397efe6ee83 100644 --- a/compiler/rustc_infer/src/infer/region_constraints/leak_check.rs +++ b/compiler/rustc_infer/src/infer/region_constraints/leak_check.rs @@ -243,7 +243,7 @@ impl<'me, 'tcx> LeakCheck<'me, 'tcx> { // Update minimum universe of scc1. self.scc_universes[scc1] = scc1_universe; - // At this point, `scc_placeholder[scc1]` stores the placeholder that + // At this point, `scc_placeholders[scc1]` stores the placeholder that // `scc1` must be equal to, if any. if let Some(scc1_placeholder) = self.scc_placeholders[scc1] { debug!( diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs index 22c5eadf887..492091a4f25 100644 --- a/compiler/rustc_middle/src/mir/interpret/error.rs +++ b/compiler/rustc_middle/src/mir/interpret/error.rs @@ -234,7 +234,7 @@ pub enum UndefinedBehaviorInfo<'tcx> { }, /// Something was divided by 0 (x / 0). DivisionByZero, - /// Something was "remaineded" by 0 (x % 0). + /// Something was "remainded" by 0 (x % 0). RemainderByZero, /// Signed division overflowed (INT_MIN / -1). DivisionOverflow, diff --git a/compiler/rustc_mir_build/src/build/matches/mod.rs b/compiler/rustc_mir_build/src/build/matches/mod.rs index 310fdf77b6f..219d101aa7c 100644 --- a/compiler/rustc_mir_build/src/build/matches/mod.rs +++ b/compiler/rustc_mir_build/src/build/matches/mod.rs @@ -444,7 +444,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // 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 descriptions + // We keep a stack of all of the bindings and type ascriptions // from the parent candidates that we visit, that also need to // be bound for each candidate. traverse_candidate( diff --git a/compiler/rustc_mir_build/src/build/matches/test.rs b/compiler/rustc_mir_build/src/build/matches/test.rs index 4b880876d3f..96069f05b40 100644 --- a/compiler/rustc_mir_build/src/build/matches/test.rs +++ b/compiler/rustc_mir_build/src/build/matches/test.rs @@ -234,7 +234,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }; TerminatorKind::if_(self.tcx, Operand::Copy(place), true_bb, false_bb) } else { - // The switch may be inexhaustible so we have a catch all block + // The switch may be inexhaustive 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( diff --git a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs index 8aa422252be..1fadd0c26fc 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs @@ -1650,7 +1650,7 @@ impl<'p, 'tcx> fmt::Debug for DeconstructedPat<'p, 'tcx> { } // 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 simple + // get the names of the fields. Instead we just display everything as a tuple // struct, which should be good enough. write!(f, "(")?; for p in self.iter_fields() { diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index abcf9ab2047..a970d180b1a 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -276,7 +276,7 @@ impl<'a> Parser<'a> { lhs = self.parse_assoc_op_ascribe(lhs, lhs_span)?; continue; } else if op == AssocOp::DotDot || op == AssocOp::DotDotEq { - // If we did not have to handle `x..`/`x..=`, it would be pretty easy to + // If we didn't 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; diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 170972e0e7d..84b4a803403 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -144,7 +144,7 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> { } if !self.tcx.features().staged_api { - // Propagate instability. This can happen even for non-staged-api crates in case + // Propagate unstability. 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() { -- cgit 1.4.1-3-g733a5