Skip to content

Commit 4b308b4

Browse files
committed
typos: fix a grabbag of typos all over the place
1 parent 95285c4 commit 4b308b4

Some content is hidden

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

71 files changed

+92
-94
lines changed

src/doc/grammar.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ bound := path | lifetime
773773

774774
## Type kinds
775775

776-
**FIXME:** this this probably not relevant to the grammar...
776+
**FIXME:** this is probably not relevant to the grammar...
777777

778778
# Memory and concurrency models
779779

src/doc/trpl/concurrency.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ our value if it's immutable, but we want to be able to mutate it, so we need
195195
something else to persuade the borrow checker we know what we're doing.
196196

197197
It looks like we need some type that allows us to safely mutate a shared value,
198-
for example a type that that can ensure only one thread at a time is able to
198+
for example a type that can ensure only one thread at a time is able to
199199
mutate the value inside it at any one time.
200200

201201
For that, we can use the `Mutex<T>` type!

src/doc/trpl/iterators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ This will print
302302

303303
`filter()` is an adapter that takes a closure as an argument. This closure
304304
returns `true` or `false`. The new iterator `filter()` produces
305-
only the elements that that closure returns `true` for:
305+
only the elements that the closure returns `true` for:
306306

307307
```rust
308308
for i in (1..100).filter(|&x| x % 2 == 0) {

src/etc/test-float-parse/runtests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
7272
Incomplete records are an error. Not-a-Number bit patterns are invalid too.
7373
74-
The tests run serially but the validaition for a a single test is parallelized
74+
The tests run serially but the validation for a single test is parallelized
7575
with ``multiprocessing``. Each test is launched as a subprocess.
7676
One thread supervises it: Accepts and enqueues records to validate, observe
7777
stderr, and waits for the process to exit. A set of worker processes perform

src/libcollections/btree/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ mod stack {
593593
top: node::Handle<*mut Node<K, V>, Type, NodeType>,
594594
}
595595

596-
/// A `PartialSearchStack` that doesn't hold a a reference to the next node, and is just
596+
/// A `PartialSearchStack` that doesn't hold a reference to the next node, and is just
597597
/// just waiting for a `Handle` to that next node to be pushed. See `PartialSearchStack::with`
598598
/// for more details.
599599
pub struct Pusher<'id, 'a, K:'a, V:'a> {

src/libcollectionstest/str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn test_find_str() {
8686
assert_eq!(data[43..86].find("iệt"), Some(77 - 43));
8787
assert_eq!(data[43..86].find("Nam"), Some(83 - 43));
8888

89-
// find every substring -- assert that it finds it, or an earlier occurence.
89+
// find every substring -- assert that it finds it, or an earlier occurrence.
9090
let string = "Việt Namacbaabcaabaaba";
9191
for (i, ci) in string.char_indices() {
9292
let ip = i + ci.len_utf8();

src/libcore/cell.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
598598
}
599599
}
600600

601-
/// Make a new `Ref` for a optional component of the borrowed data, e.g. an
601+
/// Make a new `Ref` for an optional component of the borrowed data, e.g. an
602602
/// enum variant.
603603
///
604604
/// The `RefCell` is already immutably borrowed, so this cannot fail.
@@ -668,7 +668,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
668668
}
669669
}
670670

671-
/// Make a new `RefMut` for a optional component of the borrowed data, e.g.
671+
/// Make a new `RefMut` for an optional component of the borrowed data, e.g.
672672
/// an enum variant.
673673
///
674674
/// The `RefCell` is already mutably borrowed, so this cannot fail.

src/libcore/intrinsics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -373,20 +373,20 @@ extern "rust-intrinsic" {
373373
/// a size of `count` * `size_of::<T>()` and an alignment of
374374
/// `min_align_of::<T>()`
375375
///
376-
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
376+
/// The volatile parameter is set to `true`, so it will not be optimized out.
377377
pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
378378
count: usize);
379379
/// Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with
380380
/// a size of `count` * `size_of::<T>()` and an alignment of
381381
/// `min_align_of::<T>()`
382382
///
383-
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
383+
/// The volatile parameter is set to `true`, so it will not be optimized out.
384384
pub fn volatile_copy_memory<T>(dst: *mut T, src: *const T, count: usize);
385385
/// Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a
386386
/// size of `count` * `size_of::<T>()` and an alignment of
387387
/// `min_align_of::<T>()`.
388388
///
389-
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
389+
/// The volatile parameter is set to `true`, so it will not be optimized out.
390390
pub fn volatile_set_memory<T>(dst: *mut T, val: u8, count: usize);
391391

392392
/// Perform a volatile load from the `src` pointer.

src/libcore/marker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ mod impls {
381381
/// ```
382382
///
383383
/// Without the declaration `T:Reflect`, `foo` would not type check
384-
/// (note: as a matter of style, it would be preferable to to write
384+
/// (note: as a matter of style, it would be preferable to write
385385
/// `T:Any`, because `T:Any` implies `T:Reflect` and `T:'static`, but
386386
/// we use `Reflect` here to show how it works). The `Reflect` bound
387387
/// thus serves to alert `foo`'s caller to the fact that `foo` may

src/libcore/num/bignum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ macro_rules! define_bignum {
110110
($name:ident: type=$ty:ty, n=$n:expr) => (
111111
/// Stack-allocated arbitrary-precision (up to certain limit) integer.
112112
///
113-
/// This is backed by an fixed-size array of given type ("digit").
113+
/// This is backed by a fixed-size array of given type ("digit").
114114
/// While the array is not very large (normally some hundred bytes),
115115
/// copying it recklessly may result in the performance hit.
116116
/// Thus this is intentionally not `Copy`.

src/libcore/num/flt2dec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ pub fn to_shortest_str<'a, T, F>(mut format_shortest: F, v: T,
461461
/// You probably would want `strategy::grisu::format_shortest` for this.
462462
///
463463
/// The `dec_bounds` is a tuple `(lo, hi)` such that the number is formatted
464-
/// as decimal only when `10^lo <= V < 10^hi`. Note that this is the *apparant* `V`
464+
/// as decimal only when `10^lo <= V < 10^hi`. Note that this is the *apparent* `V`
465465
/// instead of the actual `v`! Thus any printed exponent in the exponential form
466466
/// cannot be in this range, avoiding any confusion.
467467
///

src/libcore/num/flt2dec/strategy/grisu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ pub fn format_exact_opt(d: &Decoded, buf: &mut [u8], limit: i16)
488488
// but scaling `max_ten_kappa << e` by 10 can result in overflow.
489489
// thus we are being sloppy here and widen the error range by a factor of 10.
490490
// this will increase the false negative rate, but only very, *very* slightly;
491-
// it can only matter noticably when the mantissa is bigger than 60 bits.
491+
// it can only matter noticeably when the mantissa is bigger than 60 bits.
492492
return possibly_round(buf, 0, exp, limit, v.f / 10, (max_ten_kappa as u64) << e, err << e);
493493
} else if ((exp as i32 - limit as i32) as usize) < buf.len() {
494494
(exp - limit) as usize

src/libcore/num/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32)
13831383

13841384
// all valid digits are ascii, so we will just iterate over the utf8 bytes
13851385
// and cast them to chars. .to_digit() will safely return None for anything
1386-
// other than a valid ascii digit for a the given radix, including the first-byte
1386+
// other than a valid ascii digit for the given radix, including the first-byte
13871387
// of multi-byte sequences
13881388
let src = src.as_bytes();
13891389

src/libcore/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ macro_rules! derive_pattern_clone {
562562
}
563563

564564
/// This macro generates two public iterator structs
565-
/// wrapping an private internal one that makes use of the `Pattern` API.
565+
/// wrapping a private internal one that makes use of the `Pattern` API.
566566
///
567567
/// For all patterns `P: Pattern<'a>` the following items will be
568568
/// generated (generics omitted):

src/libcoretest/num/dec2flt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use test;
1616
mod parse;
1717
mod rawfp;
1818

19-
// Take an float literal, turn it into a string in various ways (that are all trusted
19+
// Take a float literal, turn it into a string in various ways (that are all trusted
2020
// to be correct) and see if those strings are parsed back to the value of the literal.
2121
// Requires a *polymorphic literal*, i.e. one that can serve as f64 as well as f32.
2222
macro_rules! test_literal {

src/librustc/front/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ impl<'ast> Map<'ast> {
578578
}
579579
}
580580

581-
/// Given a node ID, get a list of of attributes associated with the AST
581+
/// Given a node ID, get a list of attributes associated with the AST
582582
/// corresponding to the Node ID
583583
pub fn attrs(&self, id: NodeId) -> &'ast [ast::Attribute] {
584584
let attrs = match self.find(id) {

src/librustc/middle/expr_use_visitor.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
913913
self.consume_expr(&*arm.body);
914914
}
915915

916-
/// Walks an pat that occurs in isolation (i.e. top-level of fn
916+
/// Walks a pat that occurs in isolation (i.e. top-level of fn
917917
/// arg or let binding. *Not* a match arm or nested pat.)
918918
fn walk_irrefutable_pat(&mut self, cmt_discr: mc::cmt<'tcx>, pat: &hir::Pat) {
919919
let mut mode = Unknown;
@@ -1136,7 +1136,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
11361136
}
11371137

11381138
hir::PatIdent(_, _, Some(_)) => {
1139-
// Do nothing; this is a binding (not a enum
1139+
// Do nothing; this is a binding (not an enum
11401140
// variant or struct), and the cat_pattern call
11411141
// will visit the substructure recursively.
11421142
}
@@ -1145,7 +1145,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
11451145
hir::PatRegion(..) | hir::PatLit(..) | hir::PatRange(..) |
11461146
hir::PatVec(..) => {
11471147
// Similarly, each of these cases does not
1148-
// correspond to a enum variant or struct, so we
1148+
// correspond to an enum variant or struct, so we
11491149
// do not do any `matched_pat` calls for these
11501150
// cases either.
11511151
}

src/librustc/middle/infer/higher_ranked/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ pub fn plug_leaks<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
567567

568568
// Compute a mapping from the "taint set" of each skolemized
569569
// region back to the `ty::BoundRegion` that it originally
570-
// represented. Because `leak_check` passed, we know that that
570+
// represented. Because `leak_check` passed, we know that
571571
// these taint sets are mutually disjoint.
572572
let inv_skol_map: FnvHashMap<ty::Region, ty::BoundRegion> =
573573
skol_map

src/librustc/middle/traits/select.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2394,7 +2394,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
23942394
/// errors as if there is no applicable impl, but rather report
23952395
/// errors are about mismatched argument types.
23962396
///
2397-
/// Here is an example. Imagine we have an closure expression
2397+
/// Here is an example. Imagine we have a closure expression
23982398
/// and we desugared it so that the type of the expression is
23992399
/// `Closure`, and `Closure` expects an int as argument. Then it
24002400
/// is "as if" the compiler generated this impl:

src/librustc/middle/traits/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ pub fn upcast<'tcx>(tcx: &ty::ctxt<'tcx>,
408408
.collect()
409409
}
410410

411-
/// Given an trait `trait_ref`, returns the number of vtable entries
411+
/// Given a trait `trait_ref`, returns the number of vtable entries
412412
/// that come from `trait_ref`, excluding its supertraits. Used in
413413
/// computing the vtable base for an upcast trait of a trait object.
414414
pub fn count_own_vtable_entries<'tcx>(tcx: &ty::ctxt<'tcx>,

src/librustc/middle/ty/adjustment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub enum AutoAdjustment<'tcx> {
4848
///
4949
/// 1. The simplest cases are where the pointer is not adjusted fat vs thin.
5050
/// Here the pointer will be dereferenced N times (where a dereference can
51-
/// happen to to raw or borrowed pointers or any smart pointer which implements
51+
/// happen to raw or borrowed pointers or any smart pointer which implements
5252
/// Deref, including Box<_>). The number of dereferences is given by
5353
/// `autoderefs`. It can then be auto-referenced zero or one times, indicated
5454
/// by `autoref`, to either a raw or borrowed pointer. In these cases unsize is

src/librustc/middle/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub enum TypeVariants<'tcx> {
126126
TyRef(&'tcx Region, TypeAndMut<'tcx>),
127127

128128
/// If the def-id is Some(_), then this is the type of a specific
129-
/// fn item. Otherwise, if None(_), it a fn pointer type.
129+
/// fn item. Otherwise, if None(_), it is a fn pointer type.
130130
///
131131
/// FIXME: Conflating function pointers and the type of a
132132
/// function is probably a terrible idea; a function pointer is a

src/librustc_borrowck/borrowck/fragments.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub struct FragmentSets {
159159
/// FIXME(pnkfelix) probably do not want/need
160160
/// `parents_of_fragments` at all, if we can avoid it.
161161
///
162-
/// Update: I do not see a way to to avoid it. Maybe just remove
162+
/// Update: I do not see a way to avoid it. Maybe just remove
163163
/// above fixme, or at least document why doing this may be hard.
164164
parents_of_fragments: Vec<MovePathIndex>,
165165

src/librustc_borrowck/borrowck/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ const DOWNCAST_PRINTED_OPERATOR: &'static str = " as ";
373373

374374
// A local, "cleaned" version of `mc::InteriorKind` that drops
375375
// information that is not relevant to loan-path analysis. (In
376-
// particular, the distinction between how precisely a array-element
376+
// particular, the distinction between how precisely an array-element
377377
// is tracked is irrelevant here.)
378378
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
379379
pub enum InteriorKind {

src/librustc_trans/trans/_match.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,8 @@ fn insert_lllocals<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
963963
// leaving the remainder of the tuple `(_,
964964
// D(B))` still to be dropped in the future.
965965
//
966-
// Thus, here we must must zero the place that
967-
// we are moving *from*, because we do not yet
966+
// Thus, here we must zero the place that we
967+
// are moving *from*, because we do not yet
968968
// track drop flags for a fragmented parent
969969
// match input expression.
970970
//

src/librustc_trans/trans/callee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
339339
let llargs = get_params(fcx.llfn);
340340

341341
let self_idx = fcx.arg_offset();
342-
// the first argument (`self`) will be ptr to the the fn pointer
342+
// the first argument (`self`) will be ptr to the fn pointer
343343
let llfnpointer = if is_by_ref {
344344
Load(bcx, llargs[self_idx])
345345
} else {

src/librustc_trans/trans/debuginfo/metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ pub fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
809809
let mut type_map = debug_context(cx).type_map.borrow_mut();
810810

811811
if already_stored_in_typemap {
812-
// Also make sure that we already have a TypeMap entry entry for the unique type id.
812+
// Also make sure that we already have a TypeMap entry for the unique type id.
813813
let metadata_for_uid = match type_map.find_metadata_for_unique_id(unique_type_id) {
814814
Some(metadata) => metadata,
815815
None => {

src/librustc_trans/trans/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ impl OverflowOpViaInputCheck {
25262526
// Note that the mask's value is derived from the LHS type
25272527
// (since that is where the 32/64 distinction is relevant) but
25282528
// the mask's type must match the RHS type (since they will
2529-
// both be fed into a and-binop)
2529+
// both be fed into an and-binop)
25302530
let invert_mask = shift_mask_val(bcx, lhs_llty, rhs_llty, true);
25312531

25322532
let outer_bits = And(bcx, rhs, invert_mask, binop_debug_loc);

src/librustc_trans/trans/glue.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ pub enum DropGlueKind<'tcx> {
203203
/// Skips the dtor, if any, for ty; drops the contents directly.
204204
/// Note that the dtor is only skipped at the most *shallow*
205205
/// level, namely, an `impl Drop for Ty` itself. So, for example,
206-
/// if Ty is Newtype(S) then only the Drop impl for for Newtype
207-
/// itself will be skipped, while the Drop impl for S, if any,
208-
/// will be invoked.
206+
/// if Ty is Newtype(S) then only the Drop impl for Newtype itself
207+
/// will be skipped, while the Drop impl for S, if any, will be
208+
/// invoked.
209209
TyContents(Ty<'tcx>),
210210
}
211211

src/librustc_trans/trans/intrinsic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1221,8 +1221,8 @@ fn try_intrinsic<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
12211221
// MSVC's definition of the `rust_try` function. The exact implementation here
12221222
// is a little different than the GNU (standard) version below, not only because
12231223
// of the personality function but also because of the other fiddly bits about
1224-
// SEH. LLVM also currently requires us to structure this a very particular way
1225-
// as explained below.
1224+
// SEH. LLVM also currently requires us to structure this in a very particular
1225+
// way as explained below.
12261226
//
12271227
// Like with the GNU version we generate a shim wrapper
12281228
fn trans_msvc_try<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,

src/librustc_trans/trans/meth.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,7 @@ fn trans_trait_callee_from_llval<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
476476
/// }
477477
///
478478
/// What is the value of `x` when `foo` is invoked with `T=SomeTrait`?
479-
/// The answer is that it it is a shim function generate by this
480-
/// routine:
479+
/// The answer is that it is a shim function generated by this routine:
481480
///
482481
/// fn shim(t: &SomeTrait) -> int {
483482
/// // ... call t.get() virtually ...

src/librustc_trans/trans/type_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ pub fn in_memory_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) ->
361361
let repr = adt::represent_type(cx, t);
362362
// Unboxed closures can have substitutions in all spaces
363363
// inherited from their environment, so we use entire
364-
// contents of the VecPerParamSpace to to construct the llvm
364+
// contents of the VecPerParamSpace to construct the llvm
365365
// name
366366
adt::incomplete_type_of(cx, &*repr, "closure")
367367
}

src/librustc_typeck/astconv.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ fn create_region_substs<'tcx>(
347347
{
348348
let tcx = this.tcx();
349349

350-
// If the type is parameterized by the this region, then replace this
350+
// If the type is parameterized by this region, then replace this
351351
// region with the current anon region binding (in other words,
352352
// whatever & would get replaced with).
353353
let expected_num_region_params = decl_generics.regions.len(TypeSpace);
@@ -1238,7 +1238,7 @@ fn one_bound_for_assoc_type<'tcx>(tcx: &ty::ctxt<'tcx>,
12381238
Ok(bounds[0].clone())
12391239
}
12401240

1241-
// Create a type from a a path to an associated type.
1241+
// Create a type from a path to an associated type.
12421242
// For a path A::B::C::D, ty and ty_path_def are the type and def for A::B::C
12431243
// and item_segment is the path segment for D. We return a type and a def for
12441244
// the whole path.

src/librustc_typeck/check/dropck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
185185
for predicate in predicates {
186186
// (We do not need to worry about deep analysis of type
187187
// expressions etc because the Drop impls are already forced
188-
// to take on a structure that is roughly a alpha-renaming of
188+
// to take on a structure that is roughly an alpha-renaming of
189189
// the generic parameters of the item definition.)
190190

191191
// This path now just checks *all* predicates via the direct

0 commit comments

Comments
 (0)