Skip to content

Commit b32223f

Browse files
committed
Auto merge of #100707 - dzvon:fix-typo, r=davidtwco
Fix a bunch of typo This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2 parents aa857eb + 1770693 commit b32223f

File tree

140 files changed

+171
-171
lines changed

Some content is hidden

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

140 files changed

+171
-171
lines changed

RELEASES.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ Compatibility Notes
14421442
- [Mixing Option and Result via `?` is no longer permitted in closures for inferred types.][86831]
14431443
- [Previously unsound code is no longer permitted where different constructors in branches
14441444
could require different lifetimes.][85574]
1445-
- As previously mentioned the [`std::arch` instrinsics now uses stricter const checking][83278]
1445+
- As previously mentioned the [`std::arch` intrinsics now uses stricter const checking][83278]
14461446
than before and may reject some previously accepted code.
14471447
- [`i128` multiplication on Cortex M0+ platforms currently unconditionally causes overflow
14481448
when compiled with `codegen-units = 1`.][86063]
@@ -2520,7 +2520,7 @@ Compatibility Notes
25202520
- [Fixed a regression parsing `{} && false` in tail expressions.][74650]
25212521
- [Added changes to how proc-macros are expanded in `macro_rules!` that should
25222522
help to preserve more span information.][73084] These changes may cause
2523-
compiliation errors if your macro was unhygenic or didn't correctly handle
2523+
compilation errors if your macro was unhygenic or didn't correctly handle
25242524
`Delimiter::None`.
25252525
- [Moved support for the CloudABI target to tier 3.][75568]
25262526
- [`linux-gnu` targets now require minimum kernel 2.6.32 and glibc 2.11.][74163]

compiler/rustc_ast_lowering/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11791179
) -> hir::Ty<'hir> {
11801180
// Check whether we should interpret this as a bare trait object.
11811181
// This check mirrors the one in late resolution. We only introduce this special case in
1182-
// the rare occurence we need to lower `Fresh` anonymous lifetimes.
1182+
// the rare occurrence we need to lower `Fresh` anonymous lifetimes.
11831183
// The other cases when a qpath should be opportunistically made a trait object are handled
11841184
// by `ty_path`.
11851185
if qself.is_none()

compiler/rustc_ast_passes/src/ast_validation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ pub(crate) enum ForbiddenLetReason {
18001800
NotSupportedOr(Span),
18011801
/// A let chain with invalid parentheses
18021802
///
1803-
/// For exemple, `let 1 = 1 && (expr && expr)` is allowed
1803+
/// For example, `let 1 = 1 && (expr && expr)` is allowed
18041804
/// but `(let 1 = 1 && (let 1 = 1 && (let 1 = 1))) && let a = 1` is not
18051805
NotSupportedParentheses(Span),
18061806
}

compiler/rustc_codegen_cranelift/src/abi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
342342

343343
let ret_place = codegen_place(fx, destination);
344344

345-
// Handle special calls like instrinsics and empty drop glue.
345+
// Handle special calls like intrinsics and empty drop glue.
346346
let instance = if let ty::FnDef(def_id, substs) = *fn_ty.kind() {
347347
let instance = ty::Instance::resolve(fx.tcx, ty::ParamEnv::reveal_all(), def_id, substs)
348348
.unwrap()

compiler/rustc_codegen_cranelift/src/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool {
5959
ErrorHandled::TooGeneric => {
6060
span_bug!(
6161
constant.span,
62-
"codgen encountered polymorphic constant: {:?}",
62+
"codegen encountered polymorphic constant: {:?}",
6363
err
6464
);
6565
}

compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
203203
sym::transmute => {
204204
crate::base::codegen_panic(fx, "Transmuting to uninhabited type.", source_info);
205205
}
206-
_ => unimplemented!("unsupported instrinsic {}", intrinsic),
206+
_ => unimplemented!("unsupported intrinsic {}", intrinsic),
207207
}
208208
return;
209209
};

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ pub fn linking_symbol_name_for_instance_in_crate<'tcx>(
540540
.map(|fnabi| (fnabi.conv, &fnabi.args[..]))
541541
.unwrap_or((Conv::Rust, &[]));
542542

543-
// Decorate symbols with prefices, suffices and total number of bytes of arguments.
543+
// Decorate symbols with prefixes, suffixes and total number of bytes of arguments.
544544
// Reference: https://docs.microsoft.com/en-us/cpp/build/reference/decorated-names?view=msvc-170
545545
let (prefix, suffix) = match conv {
546546
Conv::X86Fastcall => ("@", "@"),

compiler/rustc_codegen_ssa/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
191191
// errored or at least linted
192192
ErrorHandled::Reported(_) | ErrorHandled::Linted => {}
193193
ErrorHandled::TooGeneric => {
194-
span_bug!(const_.span, "codgen encountered polymorphic constant: {:?}", err)
194+
span_bug!(const_.span, "codegen encountered polymorphic constant: {:?}", err)
195195
}
196196
}
197197
}

compiler/rustc_const_eval/src/interpret/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
320320
let (a_offset, b_offset) =
321321
match (self.ptr_try_get_alloc_id(a), self.ptr_try_get_alloc_id(b)) {
322322
(Err(a), Err(b)) => {
323-
// Neither poiner points to an allocation.
323+
// Neither pointer points to an allocation.
324324
// If these are inequal or null, this *will* fail the deref check below.
325325
(a, b)
326326
}

compiler/rustc_const_eval/src/interpret/memory.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
437437
msg,
438438
})
439439
}
440-
// Ensure we never consider the null pointer dereferencable.
440+
// Ensure we never consider the null pointer dereferenceable.
441441
if M::Provenance::OFFSET_IS_ADDR {
442442
assert_ne!(ptr.addr(), Size::ZERO);
443443
}
@@ -914,7 +914,7 @@ impl<'tcx, 'a, Prov: Provenance, Extra> AllocRefMut<'a, 'tcx, Prov, Extra> {
914914
self.write_scalar(alloc_range(offset, self.tcx.data_layout().pointer_size), val)
915915
}
916916

917-
/// Mark the entire referenced range as uninitalized
917+
/// Mark the entire referenced range as uninitialized
918918
pub fn write_uninit(&mut self) -> InterpResult<'tcx> {
919919
Ok(self
920920
.alloc

compiler/rustc_const_eval/src/interpret/projection.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! This file implements "place projections"; basically a symmetric API for 3 types: MPlaceTy, OpTy, PlaceTy.
22
//!
3-
//! OpTy and PlaceTy genrally work by "let's see if we are actually an MPlaceTy, and do something custom if not".
3+
//! OpTy and PlaceTy generally work by "let's see if we are actually an MPlaceTy, and do something custom if not".
44
//! For PlaceTy, the custom thing is basically always to call `force_allocation` and then use the MPlaceTy logic anyway.
55
//! For OpTy, the custom thing on field pojections has to be pretty clever (since `Operand::Immediate` can have fields),
66
//! but for array/slice operations it only has to worry about `Operand::Uninit`. That makes the value part trivial,

compiler/rustc_const_eval/src/interpret/terminator.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
217217
// When comparing the PassMode, we have to be smart about comparing the attributes.
218218
let arg_attr_compat = |a1: &ArgAttributes, a2: &ArgAttributes| {
219219
// There's only one regular attribute that matters for the call ABI: InReg.
220-
// Everything else is things like noalias, dereferencable, nonnull, ...
220+
// Everything else is things like noalias, dereferenceable, nonnull, ...
221221
// (This also applies to pointee_size, pointee_align.)
222222
if a1.regular.contains(ArgAttribute::InReg) != a2.regular.contains(ArgAttribute::InReg)
223223
{
@@ -556,7 +556,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
556556
.tcx
557557
.struct_tail_erasing_lifetimes(receiver_place.layout.ty, self.param_env);
558558
let ty::Dynamic(data, ..) = receiver_tail.kind() else {
559-
span_bug!(self.cur_span(), "dyanmic call on non-`dyn` type {}", receiver_tail)
559+
span_bug!(self.cur_span(), "dynamic call on non-`dyn` type {}", receiver_tail)
560560
};
561561

562562
// Get the required information from the vtable.

compiler/rustc_const_eval/src/interpret/traits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
3232
Ok(vtable_ptr.into())
3333
}
3434

35-
/// Returns a high-level representation of the entires of the given vtable.
35+
/// Returns a high-level representation of the entries of the given vtable.
3636
pub fn get_vtable_entries(
3737
&self,
3838
vtable: Pointer<Option<M::Provenance>>,

compiler/rustc_data_structures/src/fingerprint.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl Fingerprint {
2929
// quality hash values, let's still combine the two values because the
3030
// Fingerprints in DefPathHash have the StableCrateId portion which is
3131
// the same for all DefPathHashes from the same crate. Combining the
32-
// two halfs makes sure we get a good quality hash in such cases too.
32+
// two halves makes sure we get a good quality hash in such cases too.
3333
self.0.wrapping_mul(3).wrapping_add(self.1)
3434
}
3535

@@ -120,7 +120,7 @@ impl FingerprintHasher for crate::unhash::Unhasher {
120120
// quality hash values, let's still combine the two values because the
121121
// Fingerprints in DefPathHash have the StableCrateId portion which is
122122
// the same for all DefPathHashes from the same crate. Combining the
123-
// two halfs makes sure we get a good quality hash in such cases too.
123+
// two halves makes sure we get a good quality hash in such cases too.
124124
//
125125
// Since `Unhasher` is used only in the context of HashMaps, it is OK
126126
// to combine the two components in an order-independent way (which is

compiler/rustc_expand/src/mbe/macro_parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ impl TtParser {
430430
}
431431
}
432432
MatcherLoc::Delimited => {
433-
// Entering the delimeter is trivial.
433+
// Entering the delimiter is trivial.
434434
mp.idx += 1;
435435
self.cur_mps.push(mp);
436436
}

compiler/rustc_expand/src/mbe/macro_rules.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ impl<'tt> TokenSet<'tt> {
976976
self.maybe_empty = false;
977977
}
978978

979-
// Adds `tok` to the set for `self`, marking sequence as non-empy.
979+
// Adds `tok` to the set for `self`, marking sequence as non-empty.
980980
fn add_one(&mut self, tt: TtHandle<'tt>) {
981981
if !self.tokens.contains(&tt) {
982982
self.tokens.push(tt);

compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ fn ty_to_string<'tcx>(infcx: &InferCtxt<'_, 'tcx>, ty: Ty<'tcx>) -> String {
199199
}
200200

201201
/// We don't want to directly use `ty_to_string` for closures as their type isn't really
202-
/// something users are familar with. Directly printing the `fn_sig` of closures also
202+
/// something users are familiar with. Directly printing the `fn_sig` of closures also
203203
/// doesn't work as they actually use the "rust-call" API.
204204
fn closure_as_fn_str<'tcx>(infcx: &InferCtxt<'_, 'tcx>, ty: Ty<'tcx>) -> String {
205205
let ty::Closure(_, substs) = ty.kind() else { unreachable!() };

compiler/rustc_infer/src/infer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13331333
/// `resolve_vars_if_possible` as well as `fully_resolve`.
13341334
///
13351335
/// Make sure to call [`InferCtxt::process_registered_region_obligations`]
1336-
/// first, or preferrably use [`InferCtxt::check_region_obligations_and_report_errors`]
1336+
/// first, or preferably use [`InferCtxt::check_region_obligations_and_report_errors`]
13371337
/// to do both of these operations together.
13381338
pub fn resolve_regions_and_report_errors(
13391339
&self,

compiler/rustc_infer/src/infer/undo_log.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl Default for InferCtxtUndoLogs<'_> {
100100
}
101101

102102
/// The UndoLogs trait defines how we undo a particular kind of action (of type T). We can undo any
103-
/// action that is convertable into an UndoLog (per the From impls above).
103+
/// action that is convertible into an UndoLog (per the From impls above).
104104
impl<'tcx, T> UndoLogs<T> for InferCtxtUndoLogs<'tcx>
105105
where
106106
UndoLog<'tcx>: From<T>,

compiler/rustc_interface/src/interface.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub fn parse_check_cfg(specs: Vec<String>) -> CheckCfg {
176176
let ident = arg.ident().expect("multi-segment cfg key");
177177
names_valid.insert(ident.name.to_string());
178178
} else {
179-
error!("`names()` arguments must be simple identifers");
179+
error!("`names()` arguments must be simple identifiers");
180180
}
181181
}
182182
continue 'specs;
@@ -204,7 +204,7 @@ pub fn parse_check_cfg(specs: Vec<String>) -> CheckCfg {
204204
continue 'specs;
205205
} else {
206206
error!(
207-
"`values()` first argument must be a simple identifer"
207+
"`values()` first argument must be a simple identifier"
208208
);
209209
}
210210
} else if args.is_empty() {

compiler/rustc_lint/src/unused.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
268268
},
269269
ty::Closure(..) => {
270270
cx.struct_span_lint(UNUSED_MUST_USE, span, |lint| {
271-
// FIXME(davidtwco): this isn't properly translatable becauses of the
271+
// FIXME(davidtwco): this isn't properly translatable because of the
272272
// pre/post strings
273273
lint.build(fluent::lint::unused_closure)
274274
.set_arg("count", plural_len)
@@ -281,7 +281,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
281281
}
282282
ty::Generator(..) => {
283283
cx.struct_span_lint(UNUSED_MUST_USE, span, |lint| {
284-
// FIXME(davidtwco): this isn't properly translatable becauses of the
284+
// FIXME(davidtwco): this isn't properly translatable because of the
285285
// pre/post strings
286286
lint.build(fluent::lint::unused_generator)
287287
.set_arg("count", plural_len)
@@ -310,7 +310,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
310310
) -> bool {
311311
if let Some(attr) = cx.tcx.get_attr(def_id, sym::must_use) {
312312
cx.struct_span_lint(UNUSED_MUST_USE, span, |lint| {
313-
// FIXME(davidtwco): this isn't properly translatable becauses of the pre/post
313+
// FIXME(davidtwco): this isn't properly translatable because of the pre/post
314314
// strings
315315
let mut err = lint.build(fluent::lint::unused_def);
316316
err.set_arg("pre", descr_pre_path);

compiler/rustc_lint_defs/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3206,7 +3206,7 @@ declare_lint! {
32063206
/// [future-incompatible]: ../index.md#future-incompatible-lints
32073207
pub REPR_TRANSPARENT_EXTERNAL_PRIVATE_FIELDS,
32083208
Warn,
3209-
"tranparent type contains an external ZST that is marked #[non_exhaustive] or contains private fields",
3209+
"transparent type contains an external ZST that is marked #[non_exhaustive] or contains private fields",
32103210
@future_incompatible = FutureIncompatibleInfo {
32113211
reference: "issue #78586 <https://github.com/rust-lang/rust/issues/78586>",
32123212
};

compiler/rustc_middle/src/mir/basic_blocks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<'tcx> BasicBlocks<'tcx> {
8686
///
8787
/// You will only ever need this if you have also called [`BasicBlocks::as_mut_preserves_cfg`].
8888
/// All other methods that allow you to mutate the basic blocks also call this method
89-
/// themselves, thereby avoiding any risk of accidentaly cache invalidation.
89+
/// themselves, thereby avoiding any risk of accidentally cache invalidation.
9090
pub fn invalidate_cfg_cache(&mut self) {
9191
self.predecessor_cache.invalidate();
9292
self.switch_source_cache.invalidate();

compiler/rustc_middle/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ pub struct PlaceRef<'tcx> {
14571457
// Once we stop implementing `Ord` for `DefId`,
14581458
// this impl will be unnecessary. Until then, we'll
14591459
// leave this impl in place to prevent re-adding a
1460-
// dependnecy on the `Ord` impl for `DefId`
1460+
// dependency on the `Ord` impl for `DefId`
14611461
impl<'tcx> !PartialOrd for PlaceRef<'tcx> {}
14621462

14631463
impl<'tcx> Place<'tcx> {

compiler/rustc_middle/src/mir/syntax.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ pub enum StatementKind<'tcx> {
332332
/// First, all three operands are evaluated. `src` and `dest` must each be a reference, pointer,
333333
/// or `Box` pointing to the same type `T`. `count` must evaluate to a `usize`. Then, `src` and
334334
/// `dest` are dereferenced, and `count * size_of::<T>()` bytes beginning with the first byte of
335-
/// the `src` place are copied to the continguous range of bytes beginning with the first byte
335+
/// the `src` place are copied to the contiguous range of bytes beginning with the first byte
336336
/// of `dest`.
337337
///
338338
/// **Needs clarification**: In what order are operands computed and dereferenced? It should
@@ -378,7 +378,7 @@ pub enum FakeReadCause {
378378
/// Some(closure_def_id).
379379
/// Otherwise, the value of the optional LocalDefId will be None.
380380
//
381-
// We can use LocaDefId here since fake read statements are removed
381+
// We can use LocalDefId here since fake read statements are removed
382382
// before codegen in the `CleanupNonCodegenStatements` pass.
383383
ForMatchedPlace(Option<LocalDefId>),
384384

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ rustc_queries! {
11511151
/// Used by rustdoc.
11521152
query rendered_const(def_id: DefId) -> String {
11531153
storage(ArenaCacheSelector<'tcx>)
1154-
desc { |tcx| "rendering constant intializer of `{}`", tcx.def_path_str(def_id) }
1154+
desc { |tcx| "rendering constant initializer of `{}`", tcx.def_path_str(def_id) }
11551155
cache_on_disk_if { def_id.is_local() }
11561156
separate_provide_extern
11571157
}

compiler/rustc_middle/src/traits/specialization_graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl Node {
115115
matches!(self, Node::Trait(..))
116116
}
117117

118-
/// Trys to find the associated item that implements `trait_item_def_id`
118+
/// Tries to find the associated item that implements `trait_item_def_id`
119119
/// defined in this node.
120120
///
121121
/// If this returns `None`, the item can potentially still be found in

compiler/rustc_middle/src/ty/context.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1498,17 +1498,17 @@ impl<'tcx> TyCtxt<'tcx> {
14981498
// Create a dependency to the crate to be sure we re-execute this when the amount of
14991499
// definitions change.
15001500
self.ensure().hir_crate(());
1501-
// Leak a read lock once we start iterating on definitions, to prevent adding new onces
1501+
// Leak a read lock once we start iterating on definitions, to prevent adding new ones
15021502
// while iterating. If some query needs to add definitions, it should be `ensure`d above.
15031503
let definitions = self.definitions.leak();
15041504
definitions.iter_local_def_id()
15051505
}
15061506

15071507
pub fn def_path_table(self) -> &'tcx rustc_hir::definitions::DefPathTable {
1508-
// Create a dependency to the crate to be sure we reexcute this when the amount of
1508+
// Create a dependency to the crate to be sure we re-execute this when the amount of
15091509
// definitions change.
15101510
self.ensure().hir_crate(());
1511-
// Leak a read lock once we start iterating on definitions, to prevent adding new onces
1511+
// Leak a read lock once we start iterating on definitions, to prevent adding new ones
15121512
// while iterating. If some query needs to add definitions, it should be `ensure`d above.
15131513
let definitions = self.definitions.leak();
15141514
definitions.def_path_table()
@@ -1517,10 +1517,10 @@ impl<'tcx> TyCtxt<'tcx> {
15171517
pub fn def_path_hash_to_def_index_map(
15181518
self,
15191519
) -> &'tcx rustc_hir::def_path_hash_map::DefPathHashMap {
1520-
// Create a dependency to the crate to be sure we reexcute this when the amount of
1520+
// Create a dependency to the crate to be sure we re-execute this when the amount of
15211521
// definitions change.
15221522
self.ensure().hir_crate(());
1523-
// Leak a read lock once we start iterating on definitions, to prevent adding new onces
1523+
// Leak a read lock once we start iterating on definitions, to prevent adding new ones
15241524
// while iterating. If some query needs to add definitions, it should be `ensure`d above.
15251525
let definitions = self.definitions.leak();
15261526
definitions.def_path_hash_to_def_index_map()

0 commit comments

Comments
 (0)