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

Commit 364135a

Browse files
authored
Rollup merge of rust-lang#129877 - Sajjon:sajjon_fix_typos_batch_2, r=fee1-dead
chore: Fix typos in 'compiler' (batch 2) Batch 2/3: Fixes typos in `compiler` (See [issue](rust-lang#129874) tracking all PRs with typos fixes)
2 parents 9bacd78 + 00de006 commit 364135a

File tree

34 files changed

+54
-54
lines changed

34 files changed

+54
-54
lines changed

compiler/rustc_lint/src/context/diagnostics/check_cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ pub(super) fn unexpected_cfg_value(
267267
// encouraged to do so.
268268
let can_suggest_adding_value = !sess.psess.check_config.well_known_names.contains(&name)
269269
// Except when working on rustc or the standard library itself, in which case we want to
270-
// suggest adding these cfgs to the "normal" place because of bootstraping reasons. As a
270+
// suggest adding these cfgs to the "normal" place because of bootstrapping reasons. As a
271271
// basic heuristic, we use the "cheat" unstable feature enable method and the
272272
// non-ui-testing enabled option.
273273
|| (matches!(sess.psess.unstable_features, rustc_feature::UnstableFeatures::Cheat)

compiler/rustc_middle/src/mir/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl<'tcx> Const<'tcx> {
240240
match self {
241241
Const::Ty(ty, ct) => {
242242
match ct.kind() {
243-
// Dont use the outter ty as on invalid code we can wind up with them not being the same.
243+
// Dont use the outer ty as on invalid code we can wind up with them not being the same.
244244
// this then results in allowing const eval to add `1_i64 + 1_usize` in cases where the mir
245245
// was originally `({N: usize} + 1_usize)` under `generic_const_exprs`.
246246
ty::ConstKind::Value(ty, _) => ty,

compiler/rustc_middle/src/mir/interpret/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ pub type EvalToAllocationRawResult<'tcx> = Result<ConstAlloc<'tcx>, ErrorHandled
9191
pub type EvalStaticInitializerRawResult<'tcx> = Result<ConstAllocation<'tcx>, ErrorHandled>;
9292
pub type EvalToConstValueResult<'tcx> = Result<ConstValue<'tcx>, ErrorHandled>;
9393
/// `Ok(Err(ty))` indicates the constant was fine, but the valtree couldn't be constructed
94-
/// because the value containts something of type `ty` that is not valtree-compatible.
94+
/// because the value contains something of type `ty` that is not valtree-compatible.
9595
/// The caller can then show an appropriate error; the query does not have the
96-
/// necssary context to give good user-facing errors for this case.
96+
/// necessary context to give good user-facing errors for this case.
9797
pub type EvalToValTreeResult<'tcx> = Result<Result<ValTree<'tcx>, Ty<'tcx>>, ErrorHandled>;
9898

9999
#[cfg(target_pointer_width = "64")]
@@ -231,7 +231,7 @@ pub enum CheckInAllocMsg {
231231
pub enum CheckAlignMsg {
232232
/// The accessed pointer did not have proper alignment.
233233
AccessedPtr,
234-
/// The access ocurred with a place that was based on a misaligned pointer.
234+
/// The access occurred with a place that was based on a misaligned pointer.
235235
BasedOn,
236236
}
237237

compiler/rustc_middle/src/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ rustc_queries! {
327327
}
328328
}
329329

330-
/// Returns the list of bounds that are required to be satsified
330+
/// Returns the list of bounds that are required to be satisfied
331331
/// by a implementation or definition. For associated types, these
332332
/// must be satisfied for an implementation to be well-formed,
333333
/// and for opaque types, these are required to be satisfied by

compiler/rustc_middle/src/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ impl<'tcx> TyCtxt<'tcx> {
14751475
/// provides a `TyCtxt`.
14761476
///
14771477
/// By only providing the `TyCtxt` inside of the closure we enforce that the type
1478-
/// context and any interned alue (types, args, etc.) can only be used while `ty::tls`
1478+
/// context and any interned value (types, args, etc.) can only be used while `ty::tls`
14791479
/// has a valid reference to the context, to allow formatting values that need it.
14801480
pub fn create_global_ctxt(
14811481
s: &'tcx Session,

compiler/rustc_middle/src/ty/instance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct Instance<'tcx> {
3838
pub args: GenericArgsRef<'tcx>,
3939
}
4040

41-
/// Describes why a `ReifyShim` was created. This is needed to distingish a ReifyShim created to
41+
/// Describes why a `ReifyShim` was created. This is needed to distinguish a ReifyShim created to
4242
/// adjust for things like `#[track_caller]` in a vtable from a `ReifyShim` created to produce a
4343
/// function pointer from a vtable entry.
4444
/// Currently, this is only used when KCFI is enabled, as only KCFI needs to treat those two

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ impl<'tcx> TyCtxt<'tcx> {
18191819
self.get_attrs(did, attr).next().is_some()
18201820
}
18211821

1822-
/// Determines whether an item is annotated with a multi-segement attribute
1822+
/// Determines whether an item is annotated with a multi-segment attribute
18231823
pub fn has_attrs_with_path(self, did: impl Into<DefId>, attrs: &[Symbol]) -> bool {
18241824
self.get_attrs_by_path(did.into(), attrs).next().is_some()
18251825
}

compiler/rustc_middle/src/ty/sty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ impl<'tcx> Ty<'tcx> {
19301930

19311931
/// Returns `true` when the outermost type cannot be further normalized,
19321932
/// resolved, or instantiated. This includes all primitive types, but also
1933-
/// things like ADTs and trait objects, sice even if their arguments or
1933+
/// things like ADTs and trait objects, since even if their arguments or
19341934
/// nested types may be further simplified, the outermost [`TyKind`] or
19351935
/// type constructor remains the same.
19361936
pub fn is_known_rigid(self) -> bool {

compiler/rustc_mir_transform/src/dead_store_elimination.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn eliminate<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
3232
let borrowed_locals = borrowed_locals(body);
3333

3434
// If the user requests complete debuginfo, mark the locals that appear in it as live, so
35-
// we don't remove assignements to them.
35+
// we don't remove assignments to them.
3636
let mut always_live = debuginfo_locals(body);
3737
always_live.union(&borrowed_locals);
3838

compiler/rustc_mir_transform/src/dest_prop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//! not contain any indirection through a pointer or any indexing projections.
3939
//!
4040
//! * `p` and `q` must have the **same type**. If we replace a local with a subtype or supertype,
41-
//! we may end up with a differnet vtable for that local. See the `subtyping-impacts-selection`
41+
//! we may end up with a different vtable for that local. See the `subtyping-impacts-selection`
4242
//! tests for an example where that causes issues.
4343
//!
4444
//! * We need to make sure that the goal of "merging the memory" is actually structurally possible

0 commit comments

Comments
 (0)