Skip to content

Commit 71120ef

Browse files
committed
Fix typos found by codespell.
1 parent a9fe312 commit 71120ef

File tree

99 files changed

+130
-130
lines changed

Some content is hidden

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

99 files changed

+130
-130
lines changed

src/ci/docker/scripts/musl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ shift
3232

3333
export CFLAGS="-fPIC $CFLAGS"
3434

35-
# FIXME: remove the patch when upate to 1.1.20
35+
# FIXME: remove the patch when updating to 1.1.20
3636
MUSL=musl-1.1.19
3737

3838
# may have been downloaded in a previous run

src/doc/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ minimum. It also includes exercises!
3434

3535
# Use Rust
3636

37-
Once you've gotten familliar with the language, these resources can help you
37+
Once you've gotten familiar with the language, these resources can help you
3838
when you're actually using it day-to-day.
3939

4040
## The Standard Library

src/doc/rustc/src/codegen-options/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ This option allows you to put extra data in each output filename.
153153
This flag lets you control how many threads are used when doing
154154
code generation.
155155

156-
Increasing paralellism may speed up compile times, but may also
156+
Increasing parallelism may speed up compile times, but may also
157157
produce slower code.
158158

159159
## remark

src/doc/rustc/src/lints/listing/deny-by-default.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mod m {
5656
pub struct S(u8);
5757
5858
fn f() {
59-
// this is trying to use S from the 'use' line, but becuase the `u8` is
59+
// this is trying to use S from the 'use' line, but because the `u8` is
6060
// not pub, it is private
6161
::S;
6262
}
@@ -103,7 +103,7 @@ This warning can always be fixed by removing the unused pattern in the
103103

104104
## mutable-transmutes
105105

106-
This lint catches transmuting from `&T` to `&mut T` becuase it is undefined
106+
This lint catches transmuting from `&T` to `&mut T` because it is undefined
107107
behavior. Some example code that triggers this lint:
108108

109109
```rust,ignore

src/doc/rustdoc/src/unstable-features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Unstable features
22

3-
Rustdoc is under active developement, and like the Rust compiler, some features are only available
3+
Rustdoc is under active development, and like the Rust compiler, some features are only available
44
on the nightly releases. Some of these are new and need some more testing before they're able to get
55
released to the world at large, and some of them are tied to features in the Rust compiler that are
66
themselves unstable. Several features here require a matching `#![feature(...)]` attribute to

src/doc/unstable-book/src/language-features/infer-outlives-requirements.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ The tracking issue for this feature is: [#44493]
66

77
------------------------
88
The `infer_outlives_requirements` feature indicates that certain
9-
outlives requirements can be infered by the compiler rather than
9+
outlives requirements can be inferred by the compiler rather than
1010
stating them explicitly.
1111

1212
For example, currently generic struct definitions that contain
1313
references, require where-clauses of the form T: 'a. By using
14-
this feature the outlives predicates will be infered, although
14+
this feature the outlives predicates will be inferred, although
1515
they may still be written explicitly.
1616

1717
```rust,ignore (pseudo-Rust)

src/doc/unstable-book/src/language-features/infer-static-outlives-requirements.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ The tracking issue for this feature is: [#44493]
66

77
------------------------
88
The `infer_static_outlives_requirements` feature indicates that certain
9-
`'static` outlives requirements can be infered by the compiler rather than
9+
`'static` outlives requirements can be inferred by the compiler rather than
1010
stating them explicitly.
1111

1212
Note: It is an accompanying feature to `infer_outlives_requirements`,
1313
which must be enabled to infer outlives requirements.
1414

1515
For example, currently generic struct definitions that contain
1616
references, require where-clauses of the form T: 'static. By using
17-
this feature the outlives predicates will be infered, although
17+
this feature the outlives predicates will be inferred, although
1818
they may still be written explicitly.
1919

2020
```rust,ignore (pseudo-Rust)

src/liballoc/raw_vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![unstable(feature = "raw_vec_internals", reason = "implemention detail", issue = "0")]
11+
#![unstable(feature = "raw_vec_internals", reason = "implementation detail", issue = "0")]
1212
#![doc(hidden)]
1313

1414
use core::cmp;

src/libcore/future/future_obj.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use task::{Context, Poll};
2727
/// - The `Future` trait is currently not object safe: The `Future::poll`
2828
/// method makes uses the arbitrary self types feature and traits in which
2929
/// this feature is used are currently not object safe due to current compiler
30-
/// limitations. (See tracking issue for arbitray self types for more
30+
/// limitations. (See tracking issue for arbitrary self types for more
3131
/// information #44874)
3232
pub struct LocalFutureObj<'a, T> {
3333
ptr: *mut (),
@@ -102,7 +102,7 @@ impl<'a, T> Drop for LocalFutureObj<'a, T> {
102102
/// - The `Future` trait is currently not object safe: The `Future::poll`
103103
/// method makes uses the arbitrary self types feature and traits in which
104104
/// this feature is used are currently not object safe due to current compiler
105-
/// limitations. (See tracking issue for arbitray self types for more
105+
/// limitations. (See tracking issue for arbitrary self types for more
106106
/// information #44874)
107107
pub struct FutureObj<'a, T>(LocalFutureObj<'a, T>);
108108

src/libcore/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2291,7 +2291,7 @@ impl<T: ?Sized> *mut T {
22912291
///
22922292
/// If we ever decide to make it possible to call the intrinsic with `a` that is not a
22932293
/// power-of-two, it will probably be more prudent to just change to a naive implementation rather
2294-
/// than trying to adapt this to accomodate that change.
2294+
/// than trying to adapt this to accommodate that change.
22952295
///
22962296
/// Any questions go to @nagisa.
22972297
#[lang="align_offset"]

src/libcore/slice/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ impl<T> [T] {
16801680
}
16811681
}
16821682

1683-
/// Function to calculate lenghts of the middle and trailing slice for `align_to{,_mut}`.
1683+
/// Function to calculate lengths of the middle and trailing slice for `align_to{,_mut}`.
16841684
fn align_to_offsets<U>(&self) -> (usize, usize) {
16851685
// What we gonna do about `rest` is figure out what multiple of `U`s we can put in a
16861686
// lowest number of `T`s. And how many `T`s we need for each such "multiple".
@@ -1740,7 +1740,7 @@ impl<T> [T] {
17401740
(us_len, ts_len)
17411741
}
17421742

1743-
/// Transmute the slice to a slice of another type, ensuring aligment of the types is
1743+
/// Transmute the slice to a slice of another type, ensuring alignment of the types is
17441744
/// maintained.
17451745
///
17461746
/// This method splits the slice into three distinct slices: prefix, correctly aligned middle
@@ -1792,7 +1792,7 @@ impl<T> [T] {
17921792
}
17931793
}
17941794

1795-
/// Transmute the slice to a slice of another type, ensuring aligment of the types is
1795+
/// Transmute the slice to a slice of another type, ensuring alignment of the types is
17961796
/// maintained.
17971797
///
17981798
/// This method splits the slice into three distinct slices: prefix, correctly aligned middle

src/libfmt_macros/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub struct Parser<'a> {
154154
style: Option<usize>,
155155
/// How many newlines have been seen in the string so far, to adjust the error spans
156156
seen_newlines: usize,
157-
/// Start and end byte offset of every successfuly parsed argument
157+
/// Start and end byte offset of every successfully parsed argument
158158
pub arg_places: Vec<(usize, usize)>,
159159
}
160160

src/libpanic_unwind/seh.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ mod imp {
142142

143143
#[repr(C)]
144144
pub struct _ThrowInfo {
145-
pub attribues: c_uint,
145+
pub attributes: c_uint,
146146
pub pnfnUnwind: imp::ptr_t,
147147
pub pForwardCompat: imp::ptr_t,
148148
pub pCatchableTypeArray: imp::ptr_t,
@@ -178,7 +178,7 @@ pub struct _TypeDescriptor {
178178
}
179179

180180
static mut THROW_INFO: _ThrowInfo = _ThrowInfo {
181-
attribues: 0,
181+
attributes: 0,
182182
pnfnUnwind: ptr!(0),
183183
pForwardCompat: ptr!(0),
184184
pCatchableTypeArray: ptr!(0),

src/libproc_macro/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//!
1313
//! This library, provided by the standard distribution, provides the types
1414
//! consumed in the interfaces of procedurally defined macro definitions such as
15-
//! function-like macros `#[proc_macro]`, macro attribures `#[proc_macro_attribute]` and
15+
//! function-like macros `#[proc_macro]`, macro attributes `#[proc_macro_attribute]` and
1616
//! custom derive attributes`#[proc_macro_derive]`.
1717
//!
1818
//! Note that this crate is intentionally bare-bones currently.

src/librustc/infer/canonical/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub mod query_result;
4949
mod substitute;
5050

5151
/// A "canonicalized" type `V` is one where all free inference
52-
/// variables have been rewriten to "canonical vars". These are
52+
/// variables have been rewritten to "canonical vars". These are
5353
/// numbered starting from 0 in order of first appearance.
5454
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcDecodable, RustcEncodable)]
5555
pub struct Canonical<'gcx, V> {

src/librustc/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
561561
value.push_highlighted("<");
562562
}
563563

564-
// Output the lifetimes fot the first type
564+
// Output the lifetimes for the first type
565565
let lifetimes = sub.regions()
566566
.map(|lifetime| {
567567
let s = lifetime.to_string();

src/librustc/infer/higher_ranked/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
527527
* we're not careful, it will succeed.
528528
*
529529
* The reason is that when we walk through the subtyping
530-
* algorith, we begin by replacing `'a` with a skolemized
530+
* algorithm, we begin by replacing `'a` with a skolemized
531531
* variable `'1`. We then have `fn(_#0t) <: fn(&'1 int)`. This
532532
* can be made true by unifying `_#0t` with `&'1 int`. In the
533533
* process, we create a fresh variable for the skolemized

src/librustc/mir/interpret/value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'tcx> ConstValue<'tcx> {
6868

6969
/// A `Value` represents a single self-contained Rust value.
7070
///
71-
/// A `Value` can either refer to a block of memory inside an allocation (`ByRef`) or to a primitve
71+
/// A `Value` can either refer to a block of memory inside an allocation (`ByRef`) or to a primitive
7272
/// value held directly, outside of any allocation (`Scalar`). For `ByRef`-values, we remember
7373
/// whether the pointer is supposed to be aligned or not (also see Place).
7474
///

src/librustc/mir/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -927,11 +927,11 @@ pub enum TerminatorKind<'tcx> {
927927
/// Drop(P, goto BB1, unwind BB2)
928928
/// }
929929
/// BB1 {
930-
/// // P is now unitialized
930+
/// // P is now uninitialized
931931
/// P <- V
932932
/// }
933933
/// BB2 {
934-
/// // P is now unitialized -- its dtor panicked
934+
/// // P is now uninitialized -- its dtor panicked
935935
/// P <- V
936936
/// }
937937
/// ```

src/librustc/mir/traversal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl<'a, 'tcx> Postorder<'a, 'tcx> {
171171
// (A, [C])]
172172
//
173173
// Now that the top of the stack has no successors we can traverse, each item will
174-
// be popped off during iteration until we get back to `A`. This yeilds [E, D, B].
174+
// be popped off during iteration until we get back to `A`. This yields [E, D, B].
175175
//
176176
// When we yield `B` and call `traverse_successor`, we push `C` to the stack, but
177177
// since we've already visited `E`, that child isn't added to the stack. The last

src/librustc/traits/auto_trait.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
264264
// The core logic responsible for computing the bounds for our synthesized impl.
265265
//
266266
// To calculate the bounds, we call SelectionContext.select in a loop. Like FulfillmentContext,
267-
// we recursively select the nested obligations of predicates we encounter. However, whenver we
267+
// we recursively select the nested obligations of predicates we encounter. However, whenever we
268268
// encounter an UnimplementedError involving a type parameter, we add it to our ParamEnv. Since
269269
// our goal is to determine when a particular type implements an auto trait, Unimplemented
270270
// errors tell us what conditions need to be met.
271271
//
272-
// This method ends up working somewhat similary to FulfillmentContext, but with a few key
272+
// This method ends up working somewhat similarly to FulfillmentContext, but with a few key
273273
// differences. FulfillmentContext works under the assumption that it's dealing with concrete
274274
// user code. According, it considers all possible ways that a Predicate could be met - which
275275
// isn't always what we want for a synthesized impl. For example, given the predicate 'T:
@@ -289,11 +289,11 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
289289
// we'll pick up any nested bounds, without ever inferring that 'T: IntoIterator' needs to
290290
// hold.
291291
//
292-
// One additonal consideration is supertrait bounds. Normally, a ParamEnv is only ever
292+
// One additional consideration is supertrait bounds. Normally, a ParamEnv is only ever
293293
// consutrcted once for a given type. As part of the construction process, the ParamEnv will
294294
// have any supertrait bounds normalized - e.g. if we have a type 'struct Foo<T: Copy>', the
295295
// ParamEnv will contain 'T: Copy' and 'T: Clone', since 'Copy: Clone'. When we construct our
296-
// own ParamEnv, we need to do this outselves, through traits::elaborate_predicates, or else
296+
// own ParamEnv, we need to do this ourselves, through traits::elaborate_predicates, or else
297297
// SelectionContext will choke on the missing predicates. However, this should never show up in
298298
// the final synthesized generics: we don't want our generated docs page to contain something
299299
// like 'T: Copy + Clone', as that's redundant. Therefore, we keep track of a separate

src/librustc/traits/error_reporting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
652652
}
653653

654654
// If this error is due to `!: Trait` not implemented but `(): Trait` is
655-
// implemented, and fallback has occured, then it could be due to a
655+
// implemented, and fallback has occurred, then it could be due to a
656656
// variable that used to fallback to `()` now falling back to `!`. Issue a
657657
// note informing about the change in behaviour.
658658
if trait_predicate.skip_binder().self_ty().is_never()

src/librustc/traits/query/dropck_outlives.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<'cx, 'gcx, 'tcx> At<'cx, 'gcx, 'tcx> {
8282
// Errors and ambiuity in dropck occur in two cases:
8383
// - unresolved inference variables at the end of typeck
8484
// - non well-formed types where projections cannot be resolved
85-
// Either of these should hvae created an error before.
85+
// Either of these should have created an error before.
8686
tcx.sess
8787
.delay_span_bug(span, "dtorck encountered internal error");
8888
return InferOk {

src/librustc/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ pub struct GlobalCtxt<'tcx> {
892892

893893
pub(crate) queries: query::Queries<'tcx>,
894894

895-
// Records the free variables refrenced by every closure
895+
// Records the free variables referenced by every closure
896896
// expression. Do not track deps for this, just recompute it from
897897
// scratch every time.
898898
freevars: FxHashMap<DefId, Lrc<Vec<hir::Freevar>>>,

src/librustc/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ impl UniverseIndex {
15031503

15041504
/// Creates a universe index from the given integer. Not to be
15051505
/// used lightly lest you pick a bad value. But sometimes we
1506-
/// convert universe indicies into integers and back for various
1506+
/// convert universe indices into integers and back for various
15071507
/// reasons.
15081508
pub fn from_u32(index: u32) -> Self {
15091509
UniverseIndex(index)

src/librustc/ty/query/job.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ where
262262
}
263263
}
264264

265-
// Visit the explict waiters which use condvars and are resumable
265+
// Visit the explicit waiters which use condvars and are resumable
266266
for (i, waiter) in query.latch.info.lock().waiters.iter().enumerate() {
267267
if let Some(ref waiter_query) = waiter.query {
268268
if visit(waiter.span, waiter_query.clone()).is_some() {

src/librustc_codegen_llvm/back/write.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ struct AssemblerCommand {
327327
/// Additional resources used by optimize_and_codegen (not module specific)
328328
#[derive(Clone)]
329329
pub struct CodegenContext {
330-
// Resouces needed when running LTO
330+
// Resources needed when running LTO
331331
pub time_passes: bool,
332332
pub lto: Lto,
333333
pub no_landing_pads: bool,
@@ -595,7 +595,7 @@ unsafe fn optimize(cgcx: &CodegenContext,
595595
-C passes=name-anon-globals to the compiler command line.");
596596
} else {
597597
bug!("We are using thin LTO buffers without running the NameAnonGlobals pass. \
598-
This will likely cause errors in LLVM and shoud never happen.");
598+
This will likely cause errors in LLVM and should never happen.");
599599
}
600600
}
601601
}

src/librustc_codegen_llvm/mir/block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ impl FunctionCx<'a, 'll, 'tcx> {
655655
llargs.push(b);
656656
return;
657657
}
658-
_ => bug!("codegen_argument: {:?} invalid for pair arugment", op)
658+
_ => bug!("codegen_argument: {:?} invalid for pair argument", op)
659659
}
660660
}
661661

src/librustc_data_structures/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//!
2727
//! `MTLock` is a mutex which disappears if cfg!(parallel_queries) is false.
2828
//!
29-
//! `MTRef` is a immutable refernce if cfg!(parallel_queries), and an mutable reference otherwise.
29+
//! `MTRef` is a immutable reference if cfg!(parallel_queries), and an mutable reference otherwise.
3030
//!
3131
//! `rustc_erase_owner!` erases a OwningRef owner into Erased or Erased + Send + Sync
3232
//! depending on the value of cfg!(parallel_queries).
@@ -432,7 +432,7 @@ impl<T> Once<T> {
432432
/// closures may concurrently be computing a value which the inner value should take.
433433
/// Only one of these closures are used to actually initialize the value.
434434
/// If some other closure already set the value, we assert that it our closure computed
435-
/// a value equal to the value aready set and then
435+
/// a value equal to the value already set and then
436436
/// we return the value our closure computed wrapped in a `Option`.
437437
/// If our closure set the value, `None` is returned.
438438
/// If the value is already initialized, the closure is not called and `None` is returned.

src/librustc_lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnconditionalRecursion {
888888
// NB. this has an edge case with non-returning statements,
889889
// like `loop {}` or `panic!()`: control flow never reaches
890890
// the exit node through these, so one can have a function
891-
// that never actually calls itselfs but is still picked up by
891+
// that never actually calls itself but is still picked up by
892892
// this lint:
893893
//
894894
// fn f(cond: bool) {

src/librustc_lint/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
486486
// Protect against infinite recursion, for example
487487
// `struct S(*mut S);`.
488488
// FIXME: A recursion limit is necessary as well, for irregular
489-
// recusive types.
489+
// recursive types.
490490
if !cache.insert(ty) {
491491
return FfiSafe;
492492
}

src/librustc_metadata/native_libs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl<'a, 'tcx> Collector<'a, 'tcx> {
207207
}
208208
}
209209

210-
// Update kind and, optionally, the name of all native libaries
210+
// Update kind and, optionally, the name of all native libraries
211211
// (there may be more than one) with the specified name.
212212
for &(ref name, ref new_name, kind) in &self.tcx.sess.opts.libs {
213213
let mut found = false;

src/librustc_mir/borrow_check/nll/invalidation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ impl<'cg, 'cx, 'tcx, 'gcx> InvalidationGenerator<'cg, 'cx, 'tcx, 'gcx> {
541541
// unique or mutable borrows are invalidated by writes.
542542
// Reservations count as writes since we need to check
543543
// that activating the borrow will be OK
544-
// TOOD(bob_twinkles) is this actually the right thing to do?
544+
// FIXME(bob_twinkles) is this actually the right thing to do?
545545
this.generate_invalidates(borrow_index, context.loc);
546546
}
547547
}

0 commit comments

Comments
 (0)