Skip to content

Commit 3040320

Browse files
committed
Fix spelling mistakes in comments.
1 parent f168c12 commit 3040320

File tree

13 files changed

+24
-24
lines changed

13 files changed

+24
-24
lines changed

src/etc/emacs/rust-mode-tests.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ fn bar( a:int,
376376
-> int
377377
{ }
378378
379-
fn baz( a:int, // shoudl work with a comment here
379+
fn baz( a:int, // should work with a comment here
380380
b:char)
381381
-> int
382382
{ }

src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ use ringbuf::RingBuf;
4141
/// the BST strategy.
4242
///
4343
/// A B-Tree instead makes each node contain B-1 to 2B-1 elements in a contiguous array. By doing
44-
/// this, we reduce the number of allocations by a factor of B, and improve cache effeciency in
44+
/// this, we reduce the number of allocations by a factor of B, and improve cache efficiency in
4545
/// searches. However, this does mean that searches will have to do *more* comparisons on average.
4646
/// The precise number of comparisons depends on the node search strategy used. For optimal cache
47-
/// effeciency, one could search the nodes linearly. For optimal comparisons, one could search
47+
/// efficiency, one could search the nodes linearly. For optimal comparisons, one could search
4848
/// the node using binary search. As a compromise, one could also perform a linear search
4949
/// that initially only checks every i<sup>th</sup> element for some choice of i.
5050
///

src/libcollections/btree/node.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub struct Node<K, V> {
5353
// hard. For now, we accept this cost in the name of correctness and simplicity.
5454
//
5555
// As a compromise, keys and vals could be merged into one Vec<(K, V)>, which would shave
56-
// off 3 words, but possibly hurt our cache effeciency during search, which only cares about
56+
// off 3 words, but possibly hurt our cache efficiency during search, which only cares about
5757
// keys. This would also avoid the Zip we use in our iterator implementations. This is
5858
// probably worth investigating.
5959
//
@@ -72,7 +72,7 @@ impl<K: Ord, V> Node<K, V> {
7272
/// `GoDown` will be yielded with the index of the subtree the key must lie in.
7373
pub fn search(&self, key: &K) -> SearchResult {
7474
// FIXME(Gankro): Tune when to search linear or binary based on B (and maybe K/V).
75-
// For the B configured as of this writing (B = 6), binary search was *singnificantly*
75+
// For the B configured as of this writing (B = 6), binary search was *significantly*
7676
// worse for uints.
7777
self.search_linear(key)
7878
}
@@ -375,7 +375,7 @@ impl<K, V> Node<K, V> {
375375
}
376376
}
377377

378-
/// Steal! Stealing is roughly analagous to a binary tree rotation.
378+
/// Steal! Stealing is roughly analogous to a binary tree rotation.
379379
/// In this case, we're "rotating" right.
380380
unsafe fn steal_to_left(&mut self, underflowed_child_index: uint) {
381381
// Take the biggest stuff off left
@@ -387,7 +387,7 @@ impl<K, V> Node<K, V> {
387387
}
388388
};
389389

390-
// Swap the parent's seperating key-value pair with left's
390+
// Swap the parent's separating key-value pair with left's
391391
self.unsafe_swap(underflowed_child_index - 1, &mut key, &mut val);
392392

393393
// Put them at the start of right
@@ -402,7 +402,7 @@ impl<K, V> Node<K, V> {
402402
}
403403
}
404404

405-
/// Steal! Stealing is roughly analagous to a binary tree rotation.
405+
/// Steal! Stealing is roughly analogous to a binary tree rotation.
406406
/// In this case, we're "rotating" left.
407407
unsafe fn steal_to_right(&mut self, underflowed_child_index: uint) {
408408
// Take the smallest stuff off right
@@ -414,7 +414,7 @@ impl<K, V> Node<K, V> {
414414
}
415415
};
416416

417-
// Swap the parent's seperating key-value pair with right's
417+
// Swap the parent's separating key-value pair with right's
418418
self.unsafe_swap(underflowed_child_index, &mut key, &mut val);
419419

420420
// Put them at the end of left
@@ -430,9 +430,9 @@ impl<K, V> Node<K, V> {
430430
}
431431

432432
/// Merge! Left and right will be smooshed into one node, along with the key-value
433-
/// pair that seperated them in their parent.
433+
/// pair that separated them in their parent.
434434
unsafe fn merge_children(&mut self, left_index: uint) {
435-
// Permanently remove right's index, and the key-value pair that seperates
435+
// Permanently remove right's index, and the key-value pair that separates
436436
// left and right
437437
let (key, val, right) = {
438438
match (self.keys.remove(left_index),
@@ -448,7 +448,7 @@ impl<K, V> Node<K, V> {
448448
left.absorb(key, val, right);
449449
}
450450

451-
/// Take all the values from right, seperated by the given key and value
451+
/// Take all the values from right, separated by the given key and value
452452
fn absorb(&mut self, key: K, val: V, right: Node<K, V>) {
453453
// Just as a sanity check, make sure we can fit this guy in
454454
debug_assert!(self.len() + right.len() <= self.capacity())

src/librand/chacha.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl<'a> SeedableRng<&'a [u32]> for ChaChaRng {
173173
fn reseed(&mut self, seed: &'a [u32]) {
174174
// reset state
175175
self.init(&[0u32, ..KEY_WORDS]);
176-
// set key inplace
176+
// set key in place
177177
let key = self.state.slice_mut(4, 4+KEY_WORDS);
178178
for (k, s) in key.iter_mut().zip(seed.iter()) {
179179
*k = *s;

src/librustc/middle/traits/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
211211
// can be applied to particular types. It skips the "confirmation"
212212
// step and hence completely ignores output type parameters.
213213
//
214-
// The result is "true" if the obliation *may* hold and "false" if
214+
// The result is "true" if the obligation *may* hold and "false" if
215215
// we can be sure it does not.
216216

217217
pub fn evaluate_obligation_intercrate(&mut self,

src/librustc/middle/trans/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ fn deref_once<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
21172117
deref_owned_pointer(bcx, expr, datum, content_ty)
21182118
} else {
21192119
// A fat pointer and an opened DST value have the same
2120-
// represenation just different types. Since there is no
2120+
// representation just different types. Since there is no
21212121
// temporary for `*e` here (because it is unsized), we cannot
21222122
// emulate the sized object code path for running drop glue and
21232123
// free. Instead, we schedule cleanup for `e`, turning it into
@@ -2142,7 +2142,7 @@ fn deref_once<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
21422142
// owner (or, in the case of *T, by the user).
21432143
DatumBlock::new(bcx, Datum::new(ptr, content_ty, LvalueExpr))
21442144
} else {
2145-
// A fat pointer and an opened DST value have the same represenation
2145+
// A fat pointer and an opened DST value have the same representation
21462146
// just different types.
21472147
DatumBlock::new(bcx, Datum::new(datum.val,
21482148
ty::mk_open(bcx.tcx(), content_ty),

src/librustc/middle/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3605,7 +3605,7 @@ pub fn expr_kind(tcx: &ctxt, expr: &ast::Expr) -> ExprKind {
36053605

36063606
// Special case: A unit like struct's constructor must be called without () at the
36073607
// end (like `UnitStruct`) which means this is an ExprPath to a DefFn. But in case
3608-
// of unit structs this is should not be interpretet as function pointer but as
3608+
// of unit structs this is should not be interpreted as function pointer but as
36093609
// call to the constructor.
36103610
def::DefFn(_, _, true) => RvalueDpsExpr,
36113611

@@ -5409,7 +5409,7 @@ impl BorrowKind {
54095409
MutBorrow => ast::MutMutable,
54105410
ImmBorrow => ast::MutImmutable,
54115411

5412-
// We have no type correponding to a unique imm borrow, so
5412+
// We have no type corresponding to a unique imm borrow, so
54135413
// use `&mut`. It gives all the capabilities of an `&uniq`
54145414
// and hence is a safe "over approximation".
54155415
UniqueImmBorrow => ast::MutMutable,

src/librustc/middle/typeck/check/regionck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ fn link_reborrowed_region(rcx: &Rcx,
16751675
//
16761676
// If mutability was inferred from an upvar, we may be
16771677
// forced to revisit this decision later if processing
1678-
// another borrow or nested closure ends up coverting the
1678+
// another borrow or nested closure ends up converting the
16791679
// upvar borrow kind to mutable/unique. Record the
16801680
// information needed to perform the recursive link in the
16811681
// maybe link map.

src/libstd/collections/hashmap/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
186186
/// # Example
187187
///
188188
/// This is a slightly silly example where we define the number's
189-
/// parity as the equivilance class. It is important that the
189+
/// parity as the equivalance class. It is important that the
190190
/// values hash the same, which is why we implement `Hash`.
191191
///
192192
/// ```

src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ pub enum Stmt_ {
436436
/// Expr with trailing semi-colon (may have any type):
437437
StmtSemi(P<Expr>, NodeId),
438438

439-
/// bool: is there a trailing sem-colon?
439+
/// bool: is there a trailing semi-colon?
440440
StmtMac(Mac, bool),
441441
}
442442

src/test/run-pass/dst-coercions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn main() {
2828

2929
let x: *mut S = &mut S;
3030

31-
// Test we can chnage the mutability from mut to const.
31+
// Test we can change the mutability from mut to const.
3232
let x: &T = &mut S;
3333
let x: *const T = &mut S;
3434
}

src/test/run-pass/realloc-16687.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ unsafe fn test_triangle() -> bool {
3030
let ascend = ascend.as_mut_slice();
3131
static ALIGN : uint = 1;
3232

33-
// Checks that `ascend` forms triangle of acending size formed
33+
// Checks that `ascend` forms triangle of ascending size formed
3434
// from pairs of rows (where each pair of rows is equally sized),
3535
// and the elements of the triangle match their row-pair index.
3636
unsafe fn sanity_check(ascend: &[*mut u8]) {

src/test/run-pass/vec-dst.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
fn sub_expr() {
1212
// Test for a &[T] => &&[T] coercion in sub-expression position
13-
// (surpisingly, this can cause errors which are not caused by either of:
13+
// (surprisingly, this can cause errors which are not caused by either of:
1414
// `let x = vec.slice_mut(0, 2);`
1515
// `foo(vec.slice_mut(0, 2));` ).
1616
let mut vec: Vec<int> = vec!(1, 2, 3, 4);

0 commit comments

Comments
 (0)