Skip to content

Commit 26e49a1

Browse files
committed
chore: Fix typos in 'compiler' (batch 1)
1 parent 78d5c04 commit 26e49a1

File tree

38 files changed

+52
-52
lines changed

38 files changed

+52
-52
lines changed

compiler/rustc_ast_lowering/src/delegation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
7272
fn has_self(&self, def_id: DefId, span: Span) -> bool {
7373
if let Some(local_sig_id) = def_id.as_local() {
7474
// The value may be missing due to recursive delegation.
75-
// Error will be emmited later during HIR ty lowering.
75+
// Error will be emitted later during HIR ty lowering.
7676
self.resolver.delegation_fn_sigs.get(&local_sig_id).map_or(false, |sig| sig.has_self)
7777
} else {
7878
match self.tcx.def_kind(def_id) {
@@ -139,7 +139,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
139139
fn param_count(&self, sig_id: DefId) -> (usize, bool /*c_variadic*/) {
140140
if let Some(local_sig_id) = sig_id.as_local() {
141141
// Map may be filled incorrectly due to recursive delegation.
142-
// Error will be emmited later during HIR ty lowering.
142+
// Error will be emitted later during HIR ty lowering.
143143
match self.resolver.delegation_fn_sigs.get(&local_sig_id) {
144144
Some(sig) => (sig.param_count, sig.c_variadic),
145145
None => (0, false),

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
11791179
for field in &variant.fields {
11801180
// In practice unless there are more than one field with the same type, we'll be
11811181
// suggesting a single field at a type, because we don't aggregate multiple borrow
1182-
// checker errors involving the functional record update sytnax into a single one.
1182+
// checker errors involving the functional record update syntax into a single one.
11831183
let field_ty = field.ty(self.infcx.tcx, args);
11841184
let ident = field.ident(self.infcx.tcx);
11851185
if field_ty == ty && fields.iter().all(|field| field.ident.name != ident.name) {

compiler/rustc_borrowck/src/type_check/liveness/trace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl<'a, 'me, 'typeck, 'flow, 'tcx> LivenessResults<'a, 'me, 'typeck, 'flow, 'tc
218218
// This collect is more necessary than immediately apparent
219219
// because these facts go into `add_drop_live_facts_for()`,
220220
// which also writes to `all_facts`, and so this is genuinely
221-
// a simulatneous overlapping mutable borrow.
221+
// a simultaneous overlapping mutable borrow.
222222
// FIXME for future hackers: investigate whether this is
223223
// actually necessary; these facts come from Polonius
224224
// and probably maybe plausibly does not need to go back in.

compiler/rustc_codegen_gcc/src/debuginfo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> {
5151
}
5252

5353
/// Generate the `debug_context` in an MIR Body.
54-
/// # Souce of Origin
54+
/// # Source of Origin
5555
/// Copied from `create_scope_map.rs` of rustc_codegen_llvm
5656
fn compute_mir_scopes<'gcc, 'tcx>(
5757
cx: &CodegenCx<'gcc, 'tcx>,
@@ -86,7 +86,7 @@ fn compute_mir_scopes<'gcc, 'tcx>(
8686
/// Update the `debug_context`, adding new scope to it,
8787
/// if it's not added as is denoted in `instantiated`.
8888
///
89-
/// # Souce of Origin
89+
/// # Source of Origin
9090
/// Copied from `create_scope_map.rs` of rustc_codegen_llvm
9191
/// FIXME(tempdragon/?): Add Scope Support Here.
9292
fn make_mir_scope<'gcc, 'tcx>(

compiler/rustc_codegen_gcc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl Deref for SyncContext {
357357

358358
unsafe impl Send for SyncContext {}
359359
// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "-Zno-parallel-llvm".
360-
// TODO: disable it here by returing false in CodegenBackend::supports_parallel().
360+
// TODO: disable it here by returning false in CodegenBackend::supports_parallel().
361361
unsafe impl Sync for SyncContext {}
362362

363363
impl WriteBackendMethods for GccCodegenBackend {

compiler/rustc_codegen_gcc/tools/generate_intrinsics.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def convert_to_string(content):
4545
return content
4646

4747

48-
def extract_instrinsics_from_llvm(llvm_path, intrinsics):
48+
def extract_intrinsics_from_llvm(llvm_path, intrinsics):
4949
command = ["llvm-tblgen", "llvm/IR/Intrinsics.td"]
5050
cwd = os.path.join(llvm_path, "llvm/include")
5151
print("=> Running command `{}` from `{}`".format(command, cwd))
@@ -88,7 +88,7 @@ def append_translation(json_data, p, array):
8888
append_intrinsic(array, content[1], content[3])
8989

9090

91-
def extract_instrinsics_from_llvmint(llvmint, intrinsics):
91+
def extract_intrinsics_from_llvmint(llvmint, intrinsics):
9292
archs = [
9393
"AMDGPU",
9494
"aarch64",
@@ -152,9 +152,9 @@ def update_intrinsics(llvm_path, llvmint, llvmint2):
152152
intrinsics_llvmint = {}
153153
all_intrinsics = {}
154154

155-
extract_instrinsics_from_llvm(llvm_path, intrinsics_llvm)
156-
extract_instrinsics_from_llvmint(llvmint, intrinsics_llvmint)
157-
extract_instrinsics_from_llvmint(llvmint2, intrinsics_llvmint)
155+
extract_intrinsics_from_llvm(llvm_path, intrinsics_llvm)
156+
extract_intrinsics_from_llvmint(llvmint, intrinsics_llvmint)
157+
extract_intrinsics_from_llvmint(llvmint2, intrinsics_llvmint)
158158

159159
intrinsics = {}
160160
# We give priority to translations from LLVM over the ones from llvmint.

compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ fn prepare_usage_sets<'tcx>(tcx: TyCtxt<'tcx>) -> UsageSets<'tcx> {
422422
(instance.def_id(), body)
423423
});
424424

425-
// Functions whose coverage statments were found inlined into other functions.
425+
// Functions whose coverage statements were found inlined into other functions.
426426
let mut used_via_inlining = FxHashSet::default();
427427
// Functions that were instrumented, but had all of their coverage statements
428428
// removed by later MIR transforms (e.g. UnreachablePropagation).

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
701701
match ty.kind() {
702702
ty::Int(ity) => {
703703
// FIXME: directly extract the bits from a valtree instead of evaluating an
704-
// alreay evaluated `Const` in order to get the bits.
704+
// already evaluated `Const` in order to get the bits.
705705
let bits = ct.eval_bits(tcx, ty::ParamEnv::reveal_all());
706706
let val = Integer::from_int_ty(&tcx, *ity).size().sign_extend(bits) as i128;
707707
write!(output, "{val}")

compiler/rustc_const_eval/src/interpret/call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use super::{
2020
};
2121
use crate::fluent_generated as fluent;
2222

23-
/// An argment passed to a function.
23+
/// An argument passed to a function.
2424
#[derive(Clone, Debug)]
2525
pub enum FnArg<'tcx, Prov: Provenance = CtfeProvenance> {
2626
/// Pass a copy of the given operand.
@@ -123,7 +123,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
123123
self.tcx.has_attr(def.did(), sym::rustc_nonnull_optimization_guaranteed)
124124
};
125125
let inner = self.unfold_transparent(inner, /* may_unfold */ |def| {
126-
// Stop at NPO tpyes so that we don't miss that attribute in the check below!
126+
// Stop at NPO types so that we don't miss that attribute in the check below!
127127
def.is_struct() && !is_npo(def)
128128
});
129129
Ok(match inner.ty.kind() {

compiler/rustc_const_eval/src/interpret/eval_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
574574
// be computed as the type references non-existing names.
575575
// See <https://github.com/rust-lang/rust/issues/124348>.
576576
} else {
577-
// Looks like the const is not captued by `required_consts`, that's bad.
577+
// Looks like the const is not captured by `required_consts`, that's bad.
578578
span_bug!(span, "interpret const eval failure of {val:?} which is not in required_consts");
579579
}
580580
}

0 commit comments

Comments
 (0)