diff --git a/src/etc/emacs/rust-mode-tests.el b/src/etc/emacs/rust-mode-tests.el
index 1b6794e77f9..f255dbf1507 100644
--- a/src/etc/emacs/rust-mode-tests.el
+++ b/src/etc/emacs/rust-mode-tests.el
@@ -376,7 +376,7 @@ fn bar( a:int,
-> int
{ }
-fn baz( a:int, // shoudl work with a comment here
+fn baz( a:int, // should work with a comment here
b:char)
-> int
{ }
diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs
index dbbff61b8dd..77fb6d4a120 100644
--- a/src/libcollections/btree/map.rs
+++ b/src/libcollections/btree/map.rs
@@ -41,10 +41,10 @@ use ringbuf::RingBuf;
/// the BST strategy.
///
/// A B-Tree instead makes each node contain B-1 to 2B-1 elements in a contiguous array. By doing
-/// this, we reduce the number of allocations by a factor of B, and improve cache effeciency in
+/// this, we reduce the number of allocations by a factor of B, and improve cache efficiency in
/// searches. However, this does mean that searches will have to do *more* comparisons on average.
/// The precise number of comparisons depends on the node search strategy used. For optimal cache
-/// effeciency, one could search the nodes linearly. For optimal comparisons, one could search
+/// efficiency, one could search the nodes linearly. For optimal comparisons, one could search
/// the node using binary search. As a compromise, one could also perform a linear search
/// that initially only checks every ith element for some choice of i.
///
diff --git a/src/libcollections/btree/node.rs b/src/libcollections/btree/node.rs
index e30b29f8767..4da362952b6 100644
--- a/src/libcollections/btree/node.rs
+++ b/src/libcollections/btree/node.rs
@@ -53,7 +53,7 @@ pub struct Node {
// hard. For now, we accept this cost in the name of correctness and simplicity.
//
// As a compromise, keys and vals could be merged into one Vec<(K, V)>, which would shave
- // off 3 words, but possibly hurt our cache effeciency during search, which only cares about
+ // off 3 words, but possibly hurt our cache efficiency during search, which only cares about
// keys. This would also avoid the Zip we use in our iterator implementations. This is
// probably worth investigating.
//
@@ -72,7 +72,7 @@ impl Node {
/// `GoDown` will be yielded with the index of the subtree the key must lie in.
pub fn search(&self, key: &K) -> SearchResult {
// FIXME(Gankro): Tune when to search linear or binary based on B (and maybe K/V).
- // For the B configured as of this writing (B = 6), binary search was *singnificantly*
+ // For the B configured as of this writing (B = 6), binary search was *significantly*
// worse for uints.
self.search_linear(key)
}
@@ -375,7 +375,7 @@ impl Node {
}
}
- /// Steal! Stealing is roughly analagous to a binary tree rotation.
+ /// Steal! Stealing is roughly analogous to a binary tree rotation.
/// In this case, we're "rotating" right.
unsafe fn steal_to_left(&mut self, underflowed_child_index: uint) {
// Take the biggest stuff off left
@@ -387,7 +387,7 @@ impl Node {
}
};
- // Swap the parent's seperating key-value pair with left's
+ // Swap the parent's separating key-value pair with left's
self.unsafe_swap(underflowed_child_index - 1, &mut key, &mut val);
// Put them at the start of right
@@ -402,7 +402,7 @@ impl Node {
}
}
- /// Steal! Stealing is roughly analagous to a binary tree rotation.
+ /// Steal! Stealing is roughly analogous to a binary tree rotation.
/// In this case, we're "rotating" left.
unsafe fn steal_to_right(&mut self, underflowed_child_index: uint) {
// Take the smallest stuff off right
@@ -414,7 +414,7 @@ impl Node {
}
};
- // Swap the parent's seperating key-value pair with right's
+ // Swap the parent's separating key-value pair with right's
self.unsafe_swap(underflowed_child_index, &mut key, &mut val);
// Put them at the end of left
@@ -430,9 +430,9 @@ impl Node {
}
/// Merge! Left and right will be smooshed into one node, along with the key-value
- /// pair that seperated them in their parent.
+ /// pair that separated them in their parent.
unsafe fn merge_children(&mut self, left_index: uint) {
- // Permanently remove right's index, and the key-value pair that seperates
+ // Permanently remove right's index, and the key-value pair that separates
// left and right
let (key, val, right) = {
match (self.keys.remove(left_index),
@@ -448,7 +448,7 @@ impl Node {
left.absorb(key, val, right);
}
- /// Take all the values from right, seperated by the given key and value
+ /// Take all the values from right, separated by the given key and value
fn absorb(&mut self, key: K, val: V, right: Node) {
// Just as a sanity check, make sure we can fit this guy in
debug_assert!(self.len() + right.len() <= self.capacity())
diff --git a/src/librand/chacha.rs b/src/librand/chacha.rs
index 83d03bb265e..97e68bcbb2c 100644
--- a/src/librand/chacha.rs
+++ b/src/librand/chacha.rs
@@ -173,7 +173,7 @@ impl<'a> SeedableRng<&'a [u32]> for ChaChaRng {
fn reseed(&mut self, seed: &'a [u32]) {
// reset state
self.init(&[0u32, ..KEY_WORDS]);
- // set key inplace
+ // set key in place
let key = self.state.slice_mut(4, 4+KEY_WORDS);
for (k, s) in key.iter_mut().zip(seed.iter()) {
*k = *s;
diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs
index 23257912b82..998a9164647 100644
--- a/src/librustc/middle/traits/select.rs
+++ b/src/librustc/middle/traits/select.rs
@@ -211,7 +211,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// can be applied to particular types. It skips the "confirmation"
// step and hence completely ignores output type parameters.
//
- // The result is "true" if the obliation *may* hold and "false" if
+ // The result is "true" if the obligation *may* hold and "false" if
// we can be sure it does not.
pub fn evaluate_obligation_intercrate(&mut self,
diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs
index 834441d4430..cec96b13fbe 100644
--- a/src/librustc/middle/trans/expr.rs
+++ b/src/librustc/middle/trans/expr.rs
@@ -2117,7 +2117,7 @@ fn deref_once<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
deref_owned_pointer(bcx, expr, datum, content_ty)
} else {
// A fat pointer and an opened DST value have the same
- // represenation just different types. Since there is no
+ // representation just different types. Since there is no
// temporary for `*e` here (because it is unsized), we cannot
// emulate the sized object code path for running drop glue and
// free. Instead, we schedule cleanup for `e`, turning it into
@@ -2142,7 +2142,7 @@ fn deref_once<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
// owner (or, in the case of *T, by the user).
DatumBlock::new(bcx, Datum::new(ptr, content_ty, LvalueExpr))
} else {
- // A fat pointer and an opened DST value have the same represenation
+ // A fat pointer and an opened DST value have the same representation
// just different types.
DatumBlock::new(bcx, Datum::new(datum.val,
ty::mk_open(bcx.tcx(), content_ty),
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs
index 8c602548f33..1ce567e6329 100644
--- a/src/librustc/middle/ty.rs
+++ b/src/librustc/middle/ty.rs
@@ -3605,7 +3605,7 @@ pub fn expr_kind(tcx: &ctxt, expr: &ast::Expr) -> ExprKind {
// Special case: A unit like struct's constructor must be called without () at the
// end (like `UnitStruct`) which means this is an ExprPath to a DefFn. But in case
- // of unit structs this is should not be interpretet as function pointer but as
+ // of unit structs this is should not be interpreted as function pointer but as
// call to the constructor.
def::DefFn(_, _, true) => RvalueDpsExpr,
@@ -5409,7 +5409,7 @@ impl BorrowKind {
MutBorrow => ast::MutMutable,
ImmBorrow => ast::MutImmutable,
- // We have no type correponding to a unique imm borrow, so
+ // We have no type corresponding to a unique imm borrow, so
// use `&mut`. It gives all the capabilities of an `&uniq`
// and hence is a safe "over approximation".
UniqueImmBorrow => ast::MutMutable,
diff --git a/src/librustc/middle/typeck/check/regionck.rs b/src/librustc/middle/typeck/check/regionck.rs
index 31fe30fc9f8..c49246b5c54 100644
--- a/src/librustc/middle/typeck/check/regionck.rs
+++ b/src/librustc/middle/typeck/check/regionck.rs
@@ -1675,7 +1675,7 @@ fn link_reborrowed_region(rcx: &Rcx,
//
// If mutability was inferred from an upvar, we may be
// forced to revisit this decision later if processing
- // another borrow or nested closure ends up coverting the
+ // another borrow or nested closure ends up converting the
// upvar borrow kind to mutable/unique. Record the
// information needed to perform the recursive link in the
// maybe link map.
diff --git a/src/libstd/collections/hashmap/set.rs b/src/libstd/collections/hashmap/set.rs
index dde1f27c9a3..ca954679c1c 100644
--- a/src/libstd/collections/hashmap/set.rs
+++ b/src/libstd/collections/hashmap/set.rs
@@ -186,7 +186,7 @@ impl, S, H: Hasher> HashSet {
/// # Example
///
/// This is a slightly silly example where we define the number's
- /// parity as the equivilance class. It is important that the
+ /// parity as the equivalance class. It is important that the
/// values hash the same, which is why we implement `Hash`.
///
/// ```
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 8eaee7282d1..c06feae6872 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -436,7 +436,7 @@ pub enum Stmt_ {
/// Expr with trailing semi-colon (may have any type):
StmtSemi(P, NodeId),
- /// bool: is there a trailing sem-colon?
+ /// bool: is there a trailing semi-colon?
StmtMac(Mac, bool),
}
diff --git a/src/test/run-pass/dst-coercions.rs b/src/test/run-pass/dst-coercions.rs
index 1c9d5cd3afe..dbad546ce1a 100644
--- a/src/test/run-pass/dst-coercions.rs
+++ b/src/test/run-pass/dst-coercions.rs
@@ -28,7 +28,7 @@ pub fn main() {
let x: *mut S = &mut S;
- // Test we can chnage the mutability from mut to const.
+ // Test we can change the mutability from mut to const.
let x: &T = &mut S;
let x: *const T = &mut S;
}
diff --git a/src/test/run-pass/realloc-16687.rs b/src/test/run-pass/realloc-16687.rs
index d8f48c7e662..966e34dfe49 100644
--- a/src/test/run-pass/realloc-16687.rs
+++ b/src/test/run-pass/realloc-16687.rs
@@ -30,7 +30,7 @@ unsafe fn test_triangle() -> bool {
let ascend = ascend.as_mut_slice();
static ALIGN : uint = 1;
- // Checks that `ascend` forms triangle of acending size formed
+ // Checks that `ascend` forms triangle of ascending size formed
// from pairs of rows (where each pair of rows is equally sized),
// and the elements of the triangle match their row-pair index.
unsafe fn sanity_check(ascend: &[*mut u8]) {
diff --git a/src/test/run-pass/vec-dst.rs b/src/test/run-pass/vec-dst.rs
index 2fe8f4bdf01..11b58948e05 100644
--- a/src/test/run-pass/vec-dst.rs
+++ b/src/test/run-pass/vec-dst.rs
@@ -10,7 +10,7 @@
fn sub_expr() {
// Test for a &[T] => &&[T] coercion in sub-expression position
- // (surpisingly, this can cause errors which are not caused by either of:
+ // (surprisingly, this can cause errors which are not caused by either of:
// `let x = vec.slice_mut(0, 2);`
// `foo(vec.slice_mut(0, 2));` ).
let mut vec: Vec = vec!(1, 2, 3, 4);