Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 9bacd78

Browse files
authored
Rollup merge of rust-lang#129875 - Sajjon:sajjon_fix_typos_batch_1, r=compiler-errors,jieyouxu
chore: Fix typos in 'compiler' (batch 1) Batch 1/3: Fixes typos in `compiler` (See [issue](rust-lang#129874) tracking all PRs with typos fixes)
2 parents c67c646 + ac69544 commit 9bacd78

File tree

35 files changed

+44
-44
lines changed

35 files changed

+44
-44
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_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
}

compiler/rustc_const_eval/src/interpret/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
827827

828828
let (size, align) = if nested {
829829
// Nested anonymous statics are untyped, so let's get their
830-
// size and alignment from the allocaiton itself. This always
830+
// size and alignment from the allocation itself. This always
831831
// succeeds, as the query is fed at DefId creation time, so no
832832
// evaluation actually occurs.
833833
let alloc = self.tcx.eval_static_initializer(def_id).unwrap();

compiler/rustc_const_eval/src/interpret/place.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ pub(super) enum Place<Prov: Provenance = CtfeProvenance> {
186186
/// `Local` places always refer to the current stack frame, so they are unstable under
187187
/// function calls/returns and switching betweens stacks of different threads!
188188
/// We carry around the address of the `locals` buffer of the correct stack frame as a sanity
189-
/// chec to be able to catch some cases of using a dangling `Place`.
189+
/// check to be able to catch some cases of using a dangling `Place`.
190190
///
191191
/// This variant shall not be used for unsized types -- those must always live in memory.
192192
Local { local: mir::Local, offset: Option<Size>, locals_addr: usize },

compiler/rustc_const_eval/src/interpret/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Manages the low-level pushing and popping of stack frames and the (de)allocation of local variables.
2-
//! For hadling of argument passing and return values, see the `call` module.
2+
//! For handling of argument passing and return values, see the `call` module.
33
use std::cell::Cell;
44
use std::{fmt, mem};
55

0 commit comments

Comments
 (0)