Skip to content

Commit 999fd56

Browse files
authored
Rollup merge of #66798 - bwignall:typo, r=varkor
Fix spelling typos Should be non-semantic. Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos.
2 parents d1cc4c3 + 16fabd8 commit 999fd56

File tree

32 files changed

+37
-37
lines changed

32 files changed

+37
-37
lines changed

src/bootstrap/compile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Step for Std {
113113
}
114114
}
115115

116-
/// Copies third pary objects needed by various targets.
116+
/// Copies third party objects needed by various targets.
117117
fn copy_third_party_objects(builder: &Builder<'_>, compiler: &Compiler, target: Interned<String>)
118118
-> Vec<PathBuf>
119119
{

src/liballoc/collections/btree/node.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ impl<'a, K: 'a, V: 'a, Type> NodeRef<marker::Immut<'a>, K, V, Type> {
596596
// (We might be one-past-the-end, but that is allowed by LLVM.)
597597
// Getting the pointer is tricky though. `NodeHeader` does not have a `keys`
598598
// field because we want its size to not depend on the alignment of `K`
599-
// (needed becuase `as_header` should be safe). We cannot call `as_leaf`
599+
// (needed because `as_header` should be safe). We cannot call `as_leaf`
600600
// because we might be the shared root.
601601
// For this reason, `NodeHeader` has this `K2` parameter (that's usually `()`
602602
// and hence just adds a size-0-align-1 field, not affecting layout).

src/liballoc/tests/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ fn drain_filter_consumed_panic() {
985985
};
986986
let drain = data.drain_filter(filter);
987987

988-
// NOTE: The DrainFilter is explictly consumed
988+
// NOTE: The DrainFilter is explicitly consumed
989989
drain.for_each(drop);
990990
});
991991

src/liballoc/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2839,7 +2839,7 @@ pub struct DrainFilter<'a, T, F>
28392839
old_len: usize,
28402840
/// The filter test predicate.
28412841
pred: F,
2842-
/// A flag that indicates a panic has occured in the filter test prodicate.
2842+
/// A flag that indicates a panic has occurred in the filter test prodicate.
28432843
/// This is used as a hint in the drop implmentation to prevent consumption
28442844
/// of the remainder of the `DrainFilter`. Any unprocessed items will be
28452845
/// backshifted in the `vec`, but no further items will be dropped or

src/libcore/hint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub fn spin_loop() {
113113
pub fn black_box<T>(dummy: T) -> T {
114114
// We need to "use" the argument in some way LLVM can't introspect, and on
115115
// targets that support it we can typically leverage inline assembly to do
116-
// this. LLVM's intepretation of inline assembly is that it's, well, a black
116+
// this. LLVM's interpretation of inline assembly is that it's, well, a black
117117
// box. This isn't the greatest implementation since it probably deoptimizes
118118
// more than we want, but it's so far good enough.
119119
unsafe {

src/libcore/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ extern "rust-intrinsic" {
12791279
/// undefined behavior when `x + y > T::max_value()` or `x + y < T::min_value()`.
12801280
pub fn unchecked_add<T>(x: T, y: T) -> T;
12811281

1282-
/// Returns the result of an unchecked substraction, resulting in
1282+
/// Returns the result of an unchecked subtraction, resulting in
12831283
/// undefined behavior when `x - y > T::max_value()` or `x - y < T::min_value()`.
12841284
pub fn unchecked_sub<T>(x: T, y: T) -> T;
12851285

src/libpanic_unwind/dwarf/eh.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub unsafe fn find_eh_action(lsda: *const u8, context: &EHContext<'_>, foreign_e
130130
fn interpret_cs_action(cs_action: u64, lpad: usize, foreign_exception: bool) -> EHAction {
131131
if cs_action == 0 {
132132
// If cs_action is 0 then this is a cleanup (Drop::drop). We run these
133-
// for both Rust panics and foriegn exceptions.
133+
// for both Rust panics and foreign exceptions.
134134
EHAction::Cleanup(lpad)
135135
} else if foreign_exception {
136136
// catch_unwind should not catch foreign exceptions, only Rust panics.

src/librustc/mir/interpret/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ pub fn struct_error<'tcx>(tcx: TyCtxtAt<'tcx>, msg: &str) -> DiagnosticBuilder<'
185185
}
186186

187187
/// Packages the kind of error we got from the const code interpreter
188-
/// up with a Rust-level backtrace of where the error occured.
188+
/// up with a Rust-level backtrace of where the error occurred.
189189
/// Thsese should always be constructed by calling `.into()` on
190190
/// a `InterpError`. In `librustc_mir::interpret`, we have `throw_err_*`
191191
/// macros for this.

src/librustc/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ impl<T: Decodable> rustc_serialize::UseSpecializedDecodable for ClearCrossCrate<
443443
/// Grouped information about the source code origin of a MIR entity.
444444
/// Intended to be inspected by diagnostics and debuginfo.
445445
/// Most passes can work with it as a whole, within a single function.
446-
// The unoffical Cranelift backend, at least as of #65828, needs `SourceInfo` to implement `Eq` and
446+
// The unofficial Cranelift backend, at least as of #65828, needs `SourceInfo` to implement `Eq` and
447447
// `Hash`. Please ping @bjorn3 if removing them.
448448
#[derive(Copy, Clone, Debug, Eq, PartialEq, RustcEncodable, RustcDecodable, Hash, HashStable)]
449449
pub struct SourceInfo {

src/librustc/traits/auto_trait.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ impl AutoTraitFinder<'tcx> {
461461
// The old predicate has a region variable where the new
462462
// predicate has some other kind of region. An region
463463
// variable isn't something we can actually display to a user,
464-
// so we choose ther new predicate (which doesn't have a region
464+
// so we choose their new predicate (which doesn't have a region
465465
// varaible).
466466
//
467467
// In both cases, we want to remove the old predicate,
@@ -703,7 +703,7 @@ impl AutoTraitFinder<'tcx> {
703703
// that we could add to our ParamEnv that would 'fix' this kind
704704
// of error, as it's not caused by an unimplemented type.
705705
//
706-
// 2. We succesfully project the predicate (Ok(Some(_))), generating
706+
// 2. We successfully project the predicate (Ok(Some(_))), generating
707707
// some subobligations. We then process these subobligations
708708
// like any other generated sub-obligations.
709709
//
@@ -770,7 +770,7 @@ impl AutoTraitFinder<'tcx> {
770770
Ok(None) => {
771771
// It's ok not to make progress when hvave no inference variables -
772772
// in that case, we were only performing unifcation to check if an
773-
// error occured (which would indicate that it's impossible for our
773+
// error occurred (which would indicate that it's impossible for our
774774
// type to implement the auto trait).
775775
// However, we should always make progress (either by generating
776776
// subobligations or getting an error) when we started off with

src/librustc/ty/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl<'tcx> TyS<'tcx> {
1515
}
1616
}
1717

18-
/// Whether the type is succinctly representable as a type instead of just refered to with a
18+
/// Whether the type is succinctly representable as a type instead of just referred to with a
1919
/// description in error messages. This is used in the main error message.
2020
pub fn is_simple_ty(&self) -> bool {
2121
match self.kind {
@@ -28,7 +28,7 @@ impl<'tcx> TyS<'tcx> {
2828
}
2929
}
3030

31-
/// Whether the type is succinctly representable as a type instead of just refered to with a
31+
/// Whether the type is succinctly representable as a type instead of just referred to with a
3232
/// description in error messages. This is used in the primary span label. Beyond what
3333
/// `is_simple_ty` includes, it also accepts ADTs with no type arguments and references to
3434
/// ADTs with no type arguments.

src/librustc/ty/print/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ thread_local! {
5454
}
5555

5656
/// Avoids running any queries during any prints that occur
57-
/// during the closure. This may alter the apperance of some
57+
/// during the closure. This may alter the appearance of some
5858
/// types (e.g. forcing verbose printing for opaque types).
5959
/// This method is used during some queries (e.g. `predicates_of`
6060
/// for opaque types), to ensure that any debug printing that

src/librustc_data_structures/stable_hasher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl Hasher for StableHasher {
149149
///
150150
/// That second condition is usually not required for hash functions
151151
/// (e.g. `Hash`). In practice this means that `hash_stable` must feed any
152-
/// information into the hasher that a `PartialEq` comparision takes into
152+
/// information into the hasher that a `PartialEq` comparison takes into
153153
/// account. See [#49300](https://github.com/rust-lang/rust/issues/49300)
154154
/// for an example where violating this invariant has caused trouble in the
155155
/// past.

src/librustc_error_codes/error_codes/E0307.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This error indicates that the `self` parameter in a method has an invalid
2-
"reciever type".
2+
"receiver type".
33

44
Methods take a special first parameter, of which there are three variants:
55
`self`, `&self`, and `&mut self`. These are syntactic sugar for

src/librustc_mir/borrow_check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
951951
self.check_access_for_conflict(location, place_span, sd, rw, flow_state);
952952

953953
if let (Activation(_, borrow_idx), true) = (kind.1, conflict_error) {
954-
// Suppress this warning when there's an error being emited for the
954+
// Suppress this warning when there's an error being emitted for the
955955
// same borrow: fixing the error is likely to fix the warning.
956956
self.reservation_warnings.remove(&borrow_idx);
957957
}

src/librustc_mir/build/matches/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
488488
/// Given that we are performing `test` against `test_place`, this job
489489
/// sorts out what the status of `candidate` will be after the test. See
490490
/// `test_candidates` for the usage of this function. The returned index is
491-
/// the index that this candiate should be placed in the
491+
/// the index that this candidate should be placed in the
492492
/// `target_candidates` vec. The candidate may be modified to update its
493493
/// `match_pairs`.
494494
///

src/librustc_mir/const_eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn op_to_const<'tcx>(
5555
ecx: &CompileTimeEvalContext<'_, 'tcx>,
5656
op: OpTy<'tcx>,
5757
) -> &'tcx ty::Const<'tcx> {
58-
// We do not have value optmizations for everything.
58+
// We do not have value optimizations for everything.
5959
// Only scalars and slices, since they are very common.
6060
// Note that further down we turn scalars of undefined bits back to `ByRef`. These can result
6161
// from scalar unions that are initialized with one of their zero sized variants. We could

src/librustc_mir/interpret/machine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub trait Machine<'mir, 'tcx>: Sized {
9595
type PointerTag: ::std::fmt::Debug + Copy + Eq + Hash + 'static;
9696

9797
/// Machines can define extra (non-instance) things that represent values of function pointers.
98-
/// For example, Miri uses this to return a fucntion pointer from `dlsym`
98+
/// For example, Miri uses this to return a function pointer from `dlsym`
9999
/// that can later be called to execute the right thing.
100100
type ExtraFnVal: ::std::fmt::Debug + Copy;
101101

src/librustc_mir/transform/promote_consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl<'tcx> Visitor<'tcx> for Collector<'_, 'tcx> {
185185

186186
// Ignore drops, if the temp gets promoted,
187187
// then it's constant and thus drop is noop.
188-
// Non-uses are also irrelevent.
188+
// Non-uses are also irrelevant.
189189
if context.is_drop() || !context.is_use() {
190190
debug!(
191191
"visit_local: context.is_drop={:?} context.is_use={:?}",

src/librustc_parse/parser/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1515,11 +1515,11 @@ impl<'a> Parser<'a> {
15151515
}
15161516
}
15171517

1518-
/// Replace duplicated recovered parameters with `_` pattern to avoid unecessary errors.
1518+
/// Replace duplicated recovered parameters with `_` pattern to avoid unnecessary errors.
15191519
///
15201520
/// This is necessary because at this point we don't know whether we parsed a function with
15211521
/// anonymous parameters or a function with names but no types. In order to minimize
1522-
/// unecessary errors, we assume the parameters are in the shape of `fn foo(a, b, c)` where
1522+
/// unnecessary errors, we assume the parameters are in the shape of `fn foo(a, b, c)` where
15231523
/// the parameters are *names* (so we don't emit errors about not being able to find `b` in
15241524
/// the local scope), but if we find the same name multiple times, like in `fn foo(i8, i8)`,
15251525
/// we deduplicate them to not complain about duplicated parameter names.

src/librustc_parse/parser/item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ impl<'a> Parser<'a> {
20122012

20132013
let mut params: Vec<_> = params.into_iter().filter_map(|x| x).collect();
20142014

2015-
// Replace duplicated recovered params with `_` pattern to avoid unecessary errors.
2015+
// Replace duplicated recovered params with `_` pattern to avoid unnecessary errors.
20162016
self.deduplicate_recovered_params_names(&mut params);
20172017

20182018
if c_variadic && params.len() <= 1 {

src/librustc_target/spec/i686_unknown_uefi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn target() -> TargetResult {
3232
// Backgound and Problem:
3333
// If we use i686-unknown-windows, the LLVM IA32 MSVC generates compiler intrinsic
3434
// _alldiv, _aulldiv, _allrem, _aullrem, _allmul, which will cause undefined symbol.
35-
// A real issue is __aulldiv() is refered by __udivdi3() - udivmod_inner!(), from
35+
// A real issue is __aulldiv() is referred by __udivdi3() - udivmod_inner!(), from
3636
// https://github.com/rust-lang-nursery/compiler-builtins.
3737
// As result, rust-lld generates link error finally.
3838
// Root-cause:

src/librustc_typeck/check/demand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
434434
segment.ident.name,
435435
) {
436436
// If this expression had a clone call when suggesting borrowing
437-
// we want to suggest removing it because it'd now be unecessary.
437+
// we want to suggest removing it because it'd now be unnecessary.
438438
sugg_sp = arg.span;
439439
}
440440
}

src/librustc_typeck/check/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
550550
}
551551
// Here we want to prevent struct constructors from returning unsized types.
552552
// There were two cases this happened: fn pointer coercion in stable
553-
// and usual function call in presense of unsized_locals.
553+
// and usual function call in presence of unsized_locals.
554554
// Also, as we just want to check sizedness, instead of introducing
555555
// placeholder lifetimes with probing, we just replace higher lifetimes
556556
// with fresh vars.

src/librustc_typeck/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ fn receiver_is_valid<'fcx, 'tcx>(
934934
debug!("receiver_is_valid: type `{:?}` does not deref to `{:?}`",
935935
receiver_ty, self_ty);
936936
// If he receiver already has errors reported due to it, consider it valid to avoid
937-
// unecessary errors (#58712).
937+
// unnecessary errors (#58712).
938938
return receiver_ty.references_error();
939939
}
940940
}

src/libstd/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub trait Error: Debug + Display {
206206
TypeId::of::<Self>()
207207
}
208208

209-
/// Returns a stack backtrace, if available, of where this error ocurred.
209+
/// Returns a stack backtrace, if available, of where this error occurred.
210210
///
211211
/// This function allows inspecting the location, in code, of where an error
212212
/// happened. The returned `Backtrace` contains information about the stack

src/libstd/sys/unix/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ cfg_has_statx! {{
128128
// It is a trick to call `statx` with NULL pointers to check if the syscall
129129
// is available. According to the manual, it is expected to fail with EFAULT.
130130
// We do this mainly for performance, since it is nearly hundreds times
131-
// faster than a normal successfull call.
131+
// faster than a normal successful call.
132132
let err = cvt(statx(0, ptr::null(), 0, libc::STATX_ALL, ptr::null_mut()))
133133
.err()
134134
.and_then(|e| e.raw_os_error());
@@ -1223,7 +1223,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
12231223
// The code below ensures that `FreeOnDrop` is never a null pointer
12241224
unsafe {
12251225
// `copyfile_state_free` returns -1 if the `to` or `from` files
1226-
// cannot be closed. However, this is not considerd this an
1226+
// cannot be closed. However, this is not considered this an
12271227
// error.
12281228
copyfile_state_free(self.0);
12291229
}

src/libstd/sys/wasm/fast_thread_local.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pub unsafe fn register_dtor(_t: *mut u8, _dtor: unsafe extern fn(*mut u8)) {
44
// FIXME: right now there is no concept of "thread exit", but this is likely
55
// going to show up at some point in the form of an exported symbol that the
6-
// wasm runtime is oging to be expected to call. For now we basically just
6+
// wasm runtime is going to be expected to call. For now we basically just
77
// ignore the arguments, but if such a function starts to exist it will
88
// likely look like the OSX implementation in `unix/fast_thread_local.rs`
99
}

src/libsyntax_expand/mbe/macro_rules.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ fn generic_extension<'cx>(
190190

191191
// Take a snapshot of the state of pre-expansion gating at this point.
192192
// This is used so that if a matcher is not `Success(..)`ful,
193-
// then the spans which became gated when parsing the unsucessful matcher
193+
// then the spans which became gated when parsing the unsuccessful matcher
194194
// are not recorded. On the first `Success(..)`ful matcher, the spans are merged.
195195
let mut gated_spans_snaphot = mem::take(&mut *cx.parse_sess.gated_spans.spans.borrow_mut());
196196

src/test/rustdoc/issue-66159.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// The issue was an ICE which meant that we never actually generated the docs
66
// so if we have generated the docs, we're okay.
7-
// Since we don't generate the docs for the auxilliary files, we can't actually
7+
// Since we don't generate the docs for the auxiliary files, we can't actually
88
// verify that the struct is linked correctly.
99

1010
// @has issue_66159/index.html

src/test/ui/layout/homogeneous-aggr-zero-sized-c-struct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Show that `homogeneous_aggregate` code ignores zero-length C
44
// arrays. This matches the recent C standard, though not the
5-
// behavior of all older compilers, which somtimes consider `T[0]` to
5+
// behavior of all older compilers, which sometimes consider `T[0]` to
66
// be a "flexible array member" (see discussion on #56877 for
77
// details).
88

src/test/ui/traits/trait-object-with-self-in-projection-output-repeated-supertrait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![crate_name = "trait_test"]
55

66
// Regression test related to #56288. Check that a supertrait projection (of
7-
// `Output`) that references `Self` is ok if there is another occurence of
7+
// `Output`) that references `Self` is ok if there is another occurrence of
88
// the same supertrait that specifies the projection explicitly, even if
99
// the projection's associated type is not explicitly specified in the object type.
1010
//

0 commit comments

Comments
 (0)