Skip to content

Commit 331e7c3

Browse files
authored
Rollup merge of rust-lang#110153 - DaniPopes:compiler-typos, r=Nilstrieb
Fix typos in compiler I ran [`typos -w compiler`](https://github.com/crate-ci/typos) to fix typos in the `compiler` directory. Refs rust-lang#110150
2 parents 661b33f + 40f12c6 commit 331e7c3

File tree

70 files changed

+138
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+138
-136
lines changed

compiler/rustc_ast/src/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl FormatArguments {
9494
}
9595
if !matches!(arg.kind, FormatArgumentKind::Captured(..)) {
9696
// This is an explicit argument.
97-
// Make sure that all arguments so far are explcit.
97+
// Make sure that all arguments so far are explicit.
9898
assert_eq!(
9999
self.num_explicit_args,
100100
self.arguments.len(),

compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub struct AsyncNonMoveClosureNotSupported {
137137

138138
#[derive(Diagnostic, Clone, Copy)]
139139
#[diag(ast_lowering_functional_record_update_destructuring_assignment)]
140-
pub struct FunctionalRecordUpdateDestructuringAssignemnt {
140+
pub struct FunctionalRecordUpdateDestructuringAssignment {
141141
#[primary_span]
142142
#[suggestion(code = "", applicability = "machine-applicable")]
143143
pub span: Span,

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::errors::{
22
AsyncGeneratorsNotSupported, AsyncNonMoveClosureNotSupported, AwaitOnlyInAsyncFnAndBlocks,
3-
BaseExpressionDoubleDot, ClosureCannotBeStatic, FunctionalRecordUpdateDestructuringAssignemnt,
3+
BaseExpressionDoubleDot, ClosureCannotBeStatic, FunctionalRecordUpdateDestructuringAssignment,
44
GeneratorTooManyParameters, InclusiveRangeWithNoEnd, NotSupportedForLifetimeBinderAsyncClosure,
55
UnderscoreExprLhsAssign,
66
};
@@ -434,7 +434,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
434434
// `if let pat = val` or `if foo && let pat = val`, as we _do_ want `val` to live beyond the
435435
// condition in this case.
436436
//
437-
// In order to mantain the drop behavior for the non `let` parts of the condition,
437+
// In order to maintain the drop behavior for the non `let` parts of the condition,
438438
// we still wrap them in terminating scopes, e.g. `if foo && let pat = val` essentially
439439
// gets transformed into `if { let _t = foo; _t } && let pat = val`
440440
match &cond.kind {
@@ -1232,7 +1232,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12321232
);
12331233
let fields_omitted = match &se.rest {
12341234
StructRest::Base(e) => {
1235-
self.tcx.sess.emit_err(FunctionalRecordUpdateDestructuringAssignemnt {
1235+
self.tcx.sess.emit_err(FunctionalRecordUpdateDestructuringAssignment {
12361236
span: e.span,
12371237
});
12381238
true

compiler/rustc_borrowck/src/constraints/graph.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::{
1313
/// The construct graph organizes the constraints by their end-points.
1414
/// It can be used to view a `R1: R2` constraint as either an edge `R1
1515
/// -> R2` or `R2 -> R1` depending on the direction type `D`.
16-
pub(crate) struct ConstraintGraph<D: ConstraintGraphDirecton> {
16+
pub(crate) struct ConstraintGraph<D: ConstraintGraphDirection> {
1717
_direction: D,
1818
first_constraints: IndexVec<RegionVid, Option<OutlivesConstraintIndex>>,
1919
next_constraints: IndexVec<OutlivesConstraintIndex, Option<OutlivesConstraintIndex>>,
@@ -25,7 +25,7 @@ pub(crate) type ReverseConstraintGraph = ConstraintGraph<Reverse>;
2525

2626
/// Marker trait that controls whether a `R1: R2` constraint
2727
/// represents an edge `R1 -> R2` or `R2 -> R1`.
28-
pub(crate) trait ConstraintGraphDirecton: Copy + 'static {
28+
pub(crate) trait ConstraintGraphDirection: Copy + 'static {
2929
fn start_region(c: &OutlivesConstraint<'_>) -> RegionVid;
3030
fn end_region(c: &OutlivesConstraint<'_>) -> RegionVid;
3131
fn is_normal() -> bool;
@@ -38,7 +38,7 @@ pub(crate) trait ConstraintGraphDirecton: Copy + 'static {
3838
#[derive(Copy, Clone, Debug)]
3939
pub(crate) struct Normal;
4040

41-
impl ConstraintGraphDirecton for Normal {
41+
impl ConstraintGraphDirection for Normal {
4242
fn start_region(c: &OutlivesConstraint<'_>) -> RegionVid {
4343
c.sup
4444
}
@@ -59,7 +59,7 @@ impl ConstraintGraphDirecton for Normal {
5959
#[derive(Copy, Clone, Debug)]
6060
pub(crate) struct Reverse;
6161

62-
impl ConstraintGraphDirecton for Reverse {
62+
impl ConstraintGraphDirection for Reverse {
6363
fn start_region(c: &OutlivesConstraint<'_>) -> RegionVid {
6464
c.sub
6565
}
@@ -73,7 +73,7 @@ impl ConstraintGraphDirecton for Reverse {
7373
}
7474
}
7575

76-
impl<D: ConstraintGraphDirecton> ConstraintGraph<D> {
76+
impl<D: ConstraintGraphDirection> ConstraintGraph<D> {
7777
/// Creates a "dependency graph" where each region constraint `R1:
7878
/// R2` is treated as an edge `R1 -> R2`. We use this graph to
7979
/// construct SCCs for region inference but also for error
@@ -133,15 +133,15 @@ impl<D: ConstraintGraphDirecton> ConstraintGraph<D> {
133133
}
134134
}
135135

136-
pub(crate) struct Edges<'s, 'tcx, D: ConstraintGraphDirecton> {
136+
pub(crate) struct Edges<'s, 'tcx, D: ConstraintGraphDirection> {
137137
graph: &'s ConstraintGraph<D>,
138138
constraints: &'s OutlivesConstraintSet<'tcx>,
139139
pointer: Option<OutlivesConstraintIndex>,
140140
next_static_idx: Option<usize>,
141141
static_region: RegionVid,
142142
}
143143

144-
impl<'s, 'tcx, D: ConstraintGraphDirecton> Iterator for Edges<'s, 'tcx, D> {
144+
impl<'s, 'tcx, D: ConstraintGraphDirection> Iterator for Edges<'s, 'tcx, D> {
145145
type Item = OutlivesConstraint<'tcx>;
146146

147147
fn next(&mut self) -> Option<Self::Item> {
@@ -174,13 +174,13 @@ impl<'s, 'tcx, D: ConstraintGraphDirecton> Iterator for Edges<'s, 'tcx, D> {
174174
/// This struct brings together a constraint set and a (normal, not
175175
/// reverse) constraint graph. It implements the graph traits and is
176176
/// usd for doing the SCC computation.
177-
pub(crate) struct RegionGraph<'s, 'tcx, D: ConstraintGraphDirecton> {
177+
pub(crate) struct RegionGraph<'s, 'tcx, D: ConstraintGraphDirection> {
178178
set: &'s OutlivesConstraintSet<'tcx>,
179179
constraint_graph: &'s ConstraintGraph<D>,
180180
static_region: RegionVid,
181181
}
182182

183-
impl<'s, 'tcx, D: ConstraintGraphDirecton> RegionGraph<'s, 'tcx, D> {
183+
impl<'s, 'tcx, D: ConstraintGraphDirection> RegionGraph<'s, 'tcx, D> {
184184
/// Creates a "dependency graph" where each region constraint `R1:
185185
/// R2` is treated as an edge `R1 -> R2`. We use this graph to
186186
/// construct SCCs for region inference but also for error
@@ -202,35 +202,37 @@ impl<'s, 'tcx, D: ConstraintGraphDirecton> RegionGraph<'s, 'tcx, D> {
202202
}
203203
}
204204

205-
pub(crate) struct Successors<'s, 'tcx, D: ConstraintGraphDirecton> {
205+
pub(crate) struct Successors<'s, 'tcx, D: ConstraintGraphDirection> {
206206
edges: Edges<'s, 'tcx, D>,
207207
}
208208

209-
impl<'s, 'tcx, D: ConstraintGraphDirecton> Iterator for Successors<'s, 'tcx, D> {
209+
impl<'s, 'tcx, D: ConstraintGraphDirection> Iterator for Successors<'s, 'tcx, D> {
210210
type Item = RegionVid;
211211

212212
fn next(&mut self) -> Option<Self::Item> {
213213
self.edges.next().map(|c| D::end_region(&c))
214214
}
215215
}
216216

217-
impl<'s, 'tcx, D: ConstraintGraphDirecton> graph::DirectedGraph for RegionGraph<'s, 'tcx, D> {
217+
impl<'s, 'tcx, D: ConstraintGraphDirection> graph::DirectedGraph for RegionGraph<'s, 'tcx, D> {
218218
type Node = RegionVid;
219219
}
220220

221-
impl<'s, 'tcx, D: ConstraintGraphDirecton> graph::WithNumNodes for RegionGraph<'s, 'tcx, D> {
221+
impl<'s, 'tcx, D: ConstraintGraphDirection> graph::WithNumNodes for RegionGraph<'s, 'tcx, D> {
222222
fn num_nodes(&self) -> usize {
223223
self.constraint_graph.first_constraints.len()
224224
}
225225
}
226226

227-
impl<'s, 'tcx, D: ConstraintGraphDirecton> graph::WithSuccessors for RegionGraph<'s, 'tcx, D> {
227+
impl<'s, 'tcx, D: ConstraintGraphDirection> graph::WithSuccessors for RegionGraph<'s, 'tcx, D> {
228228
fn successors(&self, node: Self::Node) -> <Self as graph::GraphSuccessors<'_>>::Iter {
229229
self.outgoing_regions(node)
230230
}
231231
}
232232

233-
impl<'s, 'tcx, D: ConstraintGraphDirecton> graph::GraphSuccessors<'_> for RegionGraph<'s, 'tcx, D> {
233+
impl<'s, 'tcx, D: ConstraintGraphDirection> graph::GraphSuccessors<'_>
234+
for RegionGraph<'s, 'tcx, D>
235+
{
234236
type Item = RegionVid;
235237
type Iter = Successors<'s, 'tcx, D>;
236238
}

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2600,7 +2600,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
26002600
self.implicit_region_bound,
26012601
self.param_env,
26022602
location.to_locations(),
2603-
DUMMY_SP, // irrelevant; will be overrided.
2603+
DUMMY_SP, // irrelevant; will be overridden.
26042604
ConstraintCategory::Boring, // same as above.
26052605
&mut self.borrowck_context.constraints,
26062606
)

compiler/rustc_builtin_macros/src/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct MacroInput {
4242
fmtstr: P<Expr>,
4343
args: FormatArguments,
4444
/// Whether the first argument was a string literal or a result from eager macro expansion.
45-
/// If it's not a string literal, we disallow implicit arugment capturing.
45+
/// If it's not a string literal, we disallow implicit argument capturing.
4646
///
4747
/// This does not correspond to whether we can treat spans to the literal normally, as the whole
4848
/// invocation might be the result of another macro expansion, in which case this flag may still be true.

compiler/rustc_codegen_ssa/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ codegen_ssa_msvc_missing_linker = the msvc targets depend on the msvc linker but
141141
142142
codegen_ssa_check_installed_visual_studio = please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.
143143
144-
codegen_ssa_unsufficient_vs_code_product = VS Code is a different product, and is not sufficient.
144+
codegen_ssa_insufficient_vs_code_product = VS Code is a different product, and is not sufficient.
145145
146146
codegen_ssa_processing_dymutil_failed = processing debug info with `dsymutil` failed: {$status}
147147
.note = {$output}

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ fn link_natively<'a>(
923923
if sess.target.is_like_msvc && linker_not_found {
924924
sess.emit_note(errors::MsvcMissingLinker);
925925
sess.emit_note(errors::CheckInstalledVisualStudio);
926-
sess.emit_note(errors::UnsufficientVSCodeProduct);
926+
sess.emit_note(errors::InsufficientVSCodeProduct);
927927
}
928928
sess.abort_if_errors();
929929
}

compiler/rustc_codegen_ssa/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ pub struct MsvcMissingLinker;
405405
pub struct CheckInstalledVisualStudio;
406406

407407
#[derive(Diagnostic)]
408-
#[diag(codegen_ssa_unsufficient_vs_code_product)]
409-
pub struct UnsufficientVSCodeProduct;
408+
#[diag(codegen_ssa_insufficient_vs_code_product)]
409+
pub struct InsufficientVSCodeProduct;
410410

411411
#[derive(Diagnostic)]
412412
#[diag(codegen_ssa_processing_dymutil_failed)]

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub(crate) fn turn_into_const_value<'tcx>(
205205
let cid = key.value;
206206
let def_id = cid.instance.def.def_id();
207207
let is_static = tcx.is_static(def_id);
208-
// This is just accessing an already computed constant, so no need to check alginment here.
208+
// This is just accessing an already computed constant, so no need to check alignment here.
209209
let ecx = mk_eval_cx(
210210
tcx,
211211
tcx.def_span(key.value.instance.def_id()),

0 commit comments

Comments
 (0)