Skip to content

Commit 270a41c

Browse files
authored
Rollup merge of rust-lang#94960 - codehorseman:master, r=oli-obk
Fix many spelling mistakes Signed-off-by: codehorseman <[email protected]>
2 parents 5eb3433 + 01dbfb3 commit 270a41c

File tree

59 files changed

+86
-86
lines changed

Some content is hidden

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

59 files changed

+86
-86
lines changed

compiler/rustc_ast_lowering/src/item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(super) struct ItemLowerer<'a, 'lowering, 'hir> {
2626
}
2727

2828
/// When we have a ty alias we *may* have two where clauses. To give the best diagnostics, we set the span
29-
/// to the where clause that is prefered, if it exists. Otherwise, it sets the span to the other where
29+
/// to the where clause that is preferred, if it exists. Otherwise, it sets the span to the other where
3030
/// clause if it exists.
3131
fn add_ty_alias_where_clause(
3232
generics: &mut ast::Generics,

compiler/rustc_lint_defs/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3695,7 +3695,7 @@ declare_lint! {
36953695
/// ### Explanation
36963696
///
36973697
/// A duplicated attribute may erroneously originate from a copy-paste and the effect of it
3698-
/// being duplicated may not be obvious or desireable.
3698+
/// being duplicated may not be obvious or desirable.
36993699
///
37003700
/// For instance, doubling the `#[test]` attributes registers the test to be run twice with no
37013701
/// change to its environment.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<T: HasDataLayout> PointerArithmetic for T {}
9999
/// mostly opaque; the `Machine` trait extends it with some more operations that also have access to
100100
/// some global state.
101101
/// We don't actually care about this `Debug` bound (we use `Provenance::fmt` to format the entire
102-
/// pointer), but `derive` adds some unecessary bounds.
102+
/// pointer), but `derive` adds some unnecessary bounds.
103103
pub trait Provenance: Copy + fmt::Debug {
104104
/// Says whether the `offset` field of `Pointer`s with this provenance is the actual physical address.
105105
/// If `true, ptr-to-int casts work by simply discarding the provenance.

compiler/rustc_middle/src/ty/query.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ rustc_query_append! { [define_callbacks!][<'tcx>] }
337337
mod sealed {
338338
use super::{DefId, LocalDefId};
339339

340-
/// An analogue of the `Into` trait that's intended only for query paramaters.
340+
/// An analogue of the `Into` trait that's intended only for query parameters.
341341
///
342342
/// This exists to allow queries to accept either `DefId` or `LocalDefId` while requiring that the
343343
/// user call `to_def_id` to convert between them everywhere else.

compiler/rustc_middle/src/ty/subst.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn ty_slice_as_generic_args<'a, 'tcx>(ts: &'a [Ty<'tcx>]) -> &'a [GenericArg
6161
}
6262

6363
impl<'tcx> List<Ty<'tcx>> {
64-
/// Allows to freely switch betwen `List<Ty<'tcx>>` and `List<GenericArg<'tcx>>`.
64+
/// Allows to freely switch between `List<Ty<'tcx>>` and `List<GenericArg<'tcx>>`.
6565
///
6666
/// As lists are interned, `List<Ty<'tcx>>` and `List<GenericArg<'tcx>>` have
6767
/// be interned together, see `intern_type_list` for more details.

compiler/rustc_middle/src/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ impl<'tcx> TyCtxt<'tcx> {
486486
}
487487

488488
/// Given the `DefId`, returns the `DefId` of the innermost item that
489-
/// has its own type-checking context or "inference enviornment".
489+
/// has its own type-checking context or "inference environment".
490490
///
491491
/// For example, a closure has its own `DefId`, but it is type-checked
492492
/// with the containing item. Similarly, an inline const block has its

compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
527527
ty::RawPtr(pointee) if pointee.ty.is_sized(tcx.at(span), param_env) => {
528528
PatKind::Constant { value: cv }
529529
}
530-
// FIXME: these can have very suprising behaviour where optimization levels or other
530+
// FIXME: these can have very surprising behaviour where optimization levels or other
531531
// compilation choices change the runtime behaviour of the match.
532532
// See https://github.com/rust-lang/rust/issues/70861 for examples.
533533
ty::FnPtr(..) | ty::RawPtr(..) => {

compiler/rustc_mir_transform/src/check_unsafety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl<'tcx> Visitor<'tcx> for UnsafetyChecker<'_, 'tcx> {
156156
// temporary holding the static pointer to avoid duplicate errors
157157
// <https://github.com/rust-lang/rust/pull/78068#issuecomment-731753506>.
158158
if decl.internal && place.projection.first() == Some(&ProjectionElem::Deref) {
159-
// If the projection root is an artifical local that we introduced when
159+
// If the projection root is an artificial local that we introduced when
160160
// desugaring `static`, give a more specific error message
161161
// (avoid the general "raw pointer" clause below, that would only be confusing).
162162
if let Some(box LocalInfo::StaticRef { def_id, .. }) = decl.local_info {

compiler/rustc_mir_transform/src/const_debuginfo.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn find_optimization_oportunities<'tcx>(body: &Body<'tcx>) -> Vec<(Local, Consta
6060
}
6161
}
6262

63-
let mut eligable_locals = Vec::new();
63+
let mut eligible_locals = Vec::new();
6464
for (local, mutating_uses) in visitor.local_mutating_uses.drain_enumerated(..) {
6565
if mutating_uses != 1 || !locals_to_debuginfo.contains(local) {
6666
continue;
@@ -78,13 +78,13 @@ fn find_optimization_oportunities<'tcx>(body: &Body<'tcx>) -> Vec<(Local, Consta
7878
&bb.statements[location.statement_index].kind
7979
{
8080
if let Some(local) = p.as_local() {
81-
eligable_locals.push((local, *c));
81+
eligible_locals.push((local, *c));
8282
}
8383
}
8484
}
8585
}
8686

87-
eligable_locals
87+
eligible_locals
8888
}
8989

9090
impl Visitor<'_> for LocalUseVisitor {

compiler/rustc_mir_transform/src/early_otherwise_branch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ fn verify_candidate_branch<'tcx>(
359359
if branch.statements.len() != 1 {
360360
return false;
361361
}
362-
// ...assign the descriminant of `place` in that statement
362+
// ...assign the discriminant of `place` in that statement
363363
let StatementKind::Assign(boxed) = &branch.statements[0].kind else {
364364
return false
365365
};

compiler/rustc_mir_transform/src/simplify_try.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ fn optimization_applies<'tcx>(
362362
return false;
363363
} else if last_assigned_to != opt_info.local_tmp_s1 {
364364
trace!(
365-
"NO: end of assignemnt chain does not match written enum temp: {:?} != {:?}",
365+
"NO: end of assignment chain does not match written enum temp: {:?} != {:?}",
366366
last_assigned_to,
367367
opt_info.local_tmp_s1
368368
);

compiler/rustc_parse/src/parser/item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ impl<'a> Parser<'a> {
19701970
// We use an over-approximation here.
19711971
// `const const`, `fn const` won't parse, but we're not stepping over other syntax either.
19721972
// `pub` is added in case users got confused with the ordering like `async pub fn`,
1973-
// only if it wasn't preceeded by `default` as `default pub` is invalid.
1973+
// only if it wasn't preceded by `default` as `default pub` is invalid.
19741974
let quals: &[Symbol] = if check_pub {
19751975
&[kw::Pub, kw::Const, kw::Async, kw::Unsafe, kw::Extern]
19761976
} else {

compiler/rustc_resolve/src/late/lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2002,7 +2002,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
20022002
if !matches!(opaque.origin, hir::OpaqueTyOrigin::AsyncFn(..)) {
20032003
continue 'lifetimes;
20042004
}
2005-
// We want to do this only if the liftime identifier is already defined
2005+
// We want to do this only if the lifetime identifier is already defined
20062006
// in the async function that generated this. Otherwise it could be
20072007
// an opaque type defined by the developer and we still want this
20082008
// lint to fail compilation

compiler/rustc_session/src/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ top_level_options!(
223223
/// `true` if we're emitting a JSON blob containing the unused externs
224224
json_unused_externs: bool [UNTRACKED],
225225

226-
/// `true` if we're emitting a JSON job containg a future-incompat report for lints
226+
/// `true` if we're emitting a JSON job containing a future-incompat report for lints
227227
json_future_incompat: bool [TRACKED],
228228

229229
pretty: Option<PpMode> [UNTRACKED],

compiler/rustc_session/src/parse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub struct SymbolGallery {
6969

7070
impl SymbolGallery {
7171
/// Insert a symbol and its span into symbol gallery.
72-
/// If the symbol has occurred before, ignore the new occurrance.
72+
/// If the symbol has occurred before, ignore the new occurrence.
7373
pub fn insert(&self, symbol: Symbol, span: Span) {
7474
self.symbols.lock().entry(symbol).or_insert(span);
7575
}

compiler/rustc_session/src/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ pub enum NativeLibKind {
2929
/// Dynamic library (e.g. `libfoo.so` on Linux)
3030
/// or an import library corresponding to a dynamic library (e.g. `foo.lib` on Windows/MSVC).
3131
Dylib {
32-
/// Whether the dynamic library will be linked only if it satifies some undefined symbols
32+
/// Whether the dynamic library will be linked only if it satisfies some undefined symbols
3333
as_needed: Option<bool>,
3434
},
3535
/// Dynamic library (e.g. `foo.dll` on Windows) without a corresponding import library.
3636
RawDylib,
3737
/// A macOS-specific kind of dynamic libraries.
3838
Framework {
39-
/// Whether the framework will be linked only if it satifies some undefined symbols
39+
/// Whether the framework will be linked only if it satisfies some undefined symbols
4040
as_needed: Option<bool>,
4141
},
4242
/// The library kind wasn't specified, `Dylib` is currently used as a default.

compiler/rustc_symbol_mangling/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ fn compute_symbol_name<'tcx>(
226226

227227
// If we're dealing with an instance of a function that's inlined from
228228
// another crate but we're marking it as globally shared to our
229-
// compliation (aka we're not making an internal copy in each of our
229+
// compilation (aka we're not making an internal copy in each of our
230230
// codegen units) then this symbol may become an exported (but hidden
231231
// visibility) symbol. This means that multiple crates may do the same
232232
// and we want to be sure to avoid any symbol conflicts here.

compiler/rustc_target/src/abi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ impl Niche {
11051105

11061106
// Extend the range of valid values being reserved by moving either `v.start` or `v.end` bound.
11071107
// Given an eventual `Option<T>`, we try to maximize the chance for `None` to occupy the niche of zero.
1108-
// This is accomplished by prefering enums with 2 variants(`count==1`) and always taking the shortest path to niche zero.
1108+
// This is accomplished by preferring enums with 2 variants(`count==1`) and always taking the shortest path to niche zero.
11091109
// Having `None` in niche zero can enable some special optimizations.
11101110
//
11111111
// Bound selection criteria:

compiler/rustc_trait_selection/src/traits/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ fn prepare_vtable_segments<'tcx, T>(
538538

539539
// the main traversal loop:
540540
// basically we want to cut the inheritance directed graph into a few non-overlapping slices of nodes
541-
// that each node is emited after all its descendents have been emitted.
541+
// that each node is emitted after all its descendents have been emitted.
542542
// so we convert the directed graph into a tree by skipping all previously visted nodes using a visited set.
543543
// this is done on the fly.
544544
// Each loop run emits a slice - it starts by find a "childless" unvisited node, backtracking upwards, and it
@@ -553,10 +553,10 @@ fn prepare_vtable_segments<'tcx, T>(
553553
// Starting point 0 stack [D]
554554
// Loop run #0: Stack after diving in is [D B A], A is "childless"
555555
// after this point, all newly visited nodes won't have a vtable that equals to a prefix of this one.
556-
// Loop run #0: Emiting the slice [B A] (in reverse order), B has a next-sibling node, so this slice stops here.
556+
// Loop run #0: Emitting the slice [B A] (in reverse order), B has a next-sibling node, so this slice stops here.
557557
// Loop run #0: Stack after exiting out is [D C], C is the next starting point.
558558
// Loop run #1: Stack after diving in is [D C], C is "childless", since its child A is skipped(already emitted).
559-
// Loop run #1: Emiting the slice [D C] (in reverse order). No one has a next-sibling node.
559+
// Loop run #1: Emitting the slice [D C] (in reverse order). No one has a next-sibling node.
560560
// Loop run #1: Stack after exiting out is []. Now the function exits.
561561

562562
loop {

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
719719
// TraitA+Kx+'a -> TraitB+Ky+'b (trait upcasting coercion).
720720
(&ty::Dynamic(ref data_a, r_a), &ty::Dynamic(ref data_b, r_b)) => {
721721
// See `assemble_candidates_for_unsizing` for more info.
722-
// We already checked the compatiblity of auto traits within `assemble_candidates_for_unsizing`.
722+
// We already checked the compatibility of auto traits within `assemble_candidates_for_unsizing`.
723723
let principal_a = data_a.principal().unwrap();
724724
source_trait_ref = principal_a.with_self_ty(tcx, source);
725725
upcast_trait_ref = util::supertraits(tcx, source_trait_ref).nth(idx).unwrap();
@@ -823,7 +823,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
823823
// Trait+Kx+'a -> Trait+Ky+'b (auto traits and lifetime subtyping).
824824
(&ty::Dynamic(ref data_a, r_a), &ty::Dynamic(ref data_b, r_b)) => {
825825
// See `assemble_candidates_for_unsizing` for more info.
826-
// We already checked the compatiblity of auto traits within `assemble_candidates_for_unsizing`.
826+
// We already checked the compatibility of auto traits within `assemble_candidates_for_unsizing`.
827827
let iter = data_a
828828
.principal()
829829
.map(|b| b.map_bound(ty::ExistentialPredicate::Trait))
@@ -1084,7 +1084,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
10841084
| ty::Foreign(_) => {}
10851085

10861086
// These types are built-in, so we can fast-track by registering
1087-
// nested predicates for their constituient type(s)
1087+
// nested predicates for their constituent type(s)
10881088
ty::Array(ty, _) | ty::Slice(ty) => {
10891089
stack.push(ty);
10901090
}

compiler/rustc_trait_selection/src/traits/select/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
553553
match project::poly_project_and_unify_type(self, &project_obligation) {
554554
Ok(Ok(Some(mut subobligations))) => {
555555
'compute_res: {
556-
// If we've previously marked this projection as 'complete', thne
556+
// If we've previously marked this projection as 'complete', then
557557
// use the final cached result (either `EvaluatedToOk` or
558558
// `EvaluatedToOkModuloRegions`), and skip re-evaluating the
559559
// sub-obligations.

compiler/rustc_ty_utils/src/needs_drop.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ enum DtorType {
181181
/// "significant" / "insignificant".
182182
Insignificant,
183183

184-
/// Type has a `Drop` implentation.
184+
/// Type has a `Drop` implantation.
185185
Significant,
186186
}
187187

188188
// This is a helper function for `adt_drop_tys` and `adt_significant_drop_tys`.
189-
// Depending on the implentation of `adt_has_dtor`, it is used to check if the
189+
// Depending on the implantation of `adt_has_dtor`, it is used to check if the
190190
// ADT has a destructor or if the ADT only has a significant destructor. For
191191
// understanding significant destructor look at `adt_significant_drop_tys`.
192192
fn drop_tys_helper<'tcx>(
@@ -295,7 +295,7 @@ fn adt_drop_tys<'tcx>(
295295
.map(|components| tcx.intern_type_list(&components))
296296
}
297297
// If `def_id` refers to a generic ADT, the queries above and below act as if they had been handed
298-
// a `tcx.make_ty(def, identity_substs)` and as such it is legal to substitue the generic parameters
298+
// a `tcx.make_ty(def, identity_substs)` and as such it is legal to substitute the generic parameters
299299
// of the ADT into the outputted `ty`s.
300300
fn adt_significant_drop_tys(
301301
tcx: TyCtxt<'_>,

compiler/rustc_typeck/src/astconv/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
126126
"the precise format of `Fn`-family traits' type parameters is subject to change",
127127
);
128128
// Do not suggest the other syntax if we are in trait impl:
129-
// the desugaring would contain an associated type constrait.
129+
// the desugaring would contain an associated type constraint.
130130
if !is_impl {
131131
let args = trait_segment
132132
.args

compiler/rustc_typeck/src/astconv/generics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
429429
let param_counts = gen_params.own_counts();
430430

431431
// Subtracting from param count to ensure type params synthesized from `impl Trait`
432-
// cannot be explictly specified even with `explicit_generic_args_with_impl_trait`
432+
// cannot be explicitly specified even with `explicit_generic_args_with_impl_trait`
433433
// feature enabled.
434434
let synth_type_param_count = if tcx.features().explicit_generic_args_with_impl_trait {
435435
gen_params

compiler/rustc_typeck/src/check/generator_interior.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,11 @@ pub struct SuspendCheckData<'a, 'tcx> {
486486
}
487487

488488
// Returns whether it emitted a diagnostic or not
489-
// Note that this fn and the proceding one are based on the code
489+
// Note that this fn and the proceeding one are based on the code
490490
// for creating must_use diagnostics
491491
//
492492
// Note that this technique was chosen over things like a `Suspend` marker trait
493-
// as it is simpler and has precendent in the compiler
493+
// as it is simpler and has precedent in the compiler
494494
pub fn check_must_not_suspend_ty<'tcx>(
495495
fcx: &FnCtxt<'_, 'tcx>,
496496
ty: Ty<'tcx>,

compiler/rustc_typeck/src/check/method/prelude2021.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
379379
}
380380

381381
/// Creates a string version of the `expr` that includes explicit adjustments.
382-
/// Returns the string and also a bool indicating whther this is a *precise*
382+
/// Returns the string and also a bool indicating whether this is a *precise*
383383
/// suggestion.
384384
fn adjust_expr(
385385
&self,

compiler/rustc_typeck/src/check/upvar.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13711371
// represents the case of the path being completely captured by the variable.
13721372
//
13731373
// eg. If `a.b` is captured and we are processing `a.b`, then we can't have the closure also
1374-
// capture `a.b.c`, because that voilates min capture.
1374+
// capture `a.b.c`, because that violates min capture.
13751375
let is_completely_captured = captured_by_move_projs.iter().any(|projs| projs.is_empty());
13761376

13771377
assert!(!is_completely_captured || (captured_by_move_projs.len() == 1));
@@ -1411,7 +1411,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14111411
ty::RawPtr(..) => unreachable!(),
14121412

14131413
ty::Adt(def, substs) => {
1414-
// Multi-varaint enums are captured in entirety,
1414+
// Multi-variant enums are captured in entirety,
14151415
// which would've been handled in the case of single empty slice in `captured_by_move_projs`.
14161416
assert_eq!(def.variants().len(), 1);
14171417

@@ -2208,8 +2208,8 @@ fn determine_place_ancestry_relation<'tcx>(
22082208
}
22092209
}
22102210

2211-
/// Reduces the precision of the captured place when the precision doesn't yeild any benefit from
2212-
/// borrow checking prespective, allowing us to save us on the size of the capture.
2211+
/// Reduces the precision of the captured place when the precision doesn't yield any benefit from
2212+
/// borrow checking perspective, allowing us to save us on the size of the capture.
22132213
///
22142214
///
22152215
/// Fields that are read through a shared reference will always be read via a shared ref or a copy,

compiler/rustc_typeck/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ fn check_fn_or_method<'fcx, 'tcx>(
14691469
},
14701470
)
14711471
}));
1472-
// Manually call `normalize_assocaited_types_in` on the other types
1472+
// Manually call `normalize_associated_types_in` on the other types
14731473
// in `FnSig`. This ensures that if the types of these fields
14741474
// ever change to include projections, we will start normalizing
14751475
// them automatically.

compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
323323
.skip(self.params_offset + self.num_provided_type_or_const_args())
324324
.take(num_params_to_take)
325325
.map(|param| match param.kind {
326-
// This is being infered from the item's inputs, no need to set it.
326+
// This is being inferred from the item's inputs, no need to set it.
327327
ty::GenericParamDefKind::Type { .. } if is_used_in_input(param.def_id) => {
328328
"_".to_string()
329329
}

0 commit comments

Comments
 (0)