Skip to content

Commit c46c760

Browse files
committed
auto merge of #13653 : jbcrail/rust/fix-comment-mistakes, r=alexcrichton
2 parents ef1b929 + 809f13e commit c46c760

33 files changed

+53
-53
lines changed

src/libcollections/btree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,13 +659,13 @@ impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for Branch<K, V> {
659659
}
660660
}
661661

662-
//A LeafElt containts no left child, but a key-value pair.
662+
//A LeafElt contains no left child, but a key-value pair.
663663
struct LeafElt<K, V> {
664664
key: K,
665665
value: V
666666
}
667667

668-
//A BranchElt has a left child in insertition to a key-value pair.
668+
//A BranchElt has a left child in insertion to a key-value pair.
669669
struct BranchElt<K, V> {
670670
left: ~Node<K, V>,
671671
key: K,

src/libcollections/hashmap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ static INITIAL_LOAD_FACTOR: Fraction = (9, 10);
605605
//
606606
// > Why a load factor of 90%?
607607
//
608-
// In general, all the distances to inital buckets will converge on the mean.
608+
// In general, all the distances to initial buckets will converge on the mean.
609609
// At a load factor of α, the odds of finding the target bucket after k
610610
// probes is approximately 1-α^k. If we set this equal to 50% (since we converge
611611
// on the mean) and set k=8 (64-byte cache line / 8-byte hash), α=0.92. I round
@@ -618,7 +618,7 @@ static INITIAL_LOAD_FACTOR: Fraction = (9, 10);
618618
// > Wait, what? Where did you get 1-α^k from?
619619
//
620620
// On the first probe, your odds of a collision with an existing element is α.
621-
// The odds of doing this twice in a row is approximatelly α^2. For three times,
621+
// The odds of doing this twice in a row is approximately α^2. For three times,
622622
// α^3, etc. Therefore, the odds of colliding k times is α^k. The odds of NOT
623623
// colliding after k tries is 1-α^k.
624624
//
@@ -692,7 +692,7 @@ static INITIAL_LOAD_FACTOR: Fraction = (9, 10);
692692
/// let mut book_reviews = HashMap::new();
693693
///
694694
/// // review some books.
695-
/// book_reviews.insert("Adventures of Hucklebury Fin", "My favorite book.");
695+
/// book_reviews.insert("Adventures of Huckleberry Finn", "My favorite book.");
696696
/// book_reviews.insert("Grimms' Fairy Tales", "Masterpiece.");
697697
/// book_reviews.insert("Pride and Prejudice", "Very enjoyable.");
698698
/// book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.");
@@ -782,7 +782,7 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
782782
/// from its 'ideal' location.
783783
///
784784
/// In the cited blog posts above, this is called the "distance to
785-
/// inital bucket", or DIB.
785+
/// initial bucket", or DIB.
786786
fn bucket_distance(&self, index_of_elem: &table::FullIndex) -> uint {
787787
// where the hash of the element that happens to reside at
788788
// `index_of_elem` tried to place itself first.

src/libcollections/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ pub struct RevMutEntries<'a, K, V> {
308308
// (with many different `x`) below, so we need to optionally pass mut
309309
// as a tt, but the only thing we can do with a `tt` is pass them to
310310
// other macros, so this takes the `& <mutability> <operand>` token
311-
// sequence and forces their evalutation as an expression.
311+
// sequence and forces their evaluation as an expression.
312312
macro_rules! addr { ($e:expr) => { $e }}
313313
// putting an optional mut into type signatures
314314
macro_rules! item { ($i:item) => { $i }}

src/libcollections/trie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<T> TrieMap<T> {
141141
// (with many different `x`) below, so we need to optionally pass mut
142142
// as a tt, but the only thing we can do with a `tt` is pass them to
143143
// other macros, so this takes the `& <mutability> <operand>` token
144-
// sequence and forces their evalutation as an expression. (see also
144+
// sequence and forces their evaluation as an expression. (see also
145145
// `item!` below.)
146146
macro_rules! addr { ($e:expr) => { $e } }
147147

src/libnum/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ macro_rules! impl_integer_for_int {
171171
/// `other`.
172172
#[inline]
173173
fn lcm(&self, other: &$T) -> $T {
174-
// should not have to recaluculate abs
174+
// should not have to recalculate abs
175175
((*self * *other) / self.gcd(other)).abs()
176176
}
177177

src/librustc/back/link.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ fn link_args(sess: &Session,
11711171
// actually creates "invalid" objects [1] [2], but only for some
11721172
// introspection tools, not in terms of whether it can be loaded.
11731173
//
1174-
// Long story shory, passing this flag forces the linker to *not*
1174+
// Long story short, passing this flag forces the linker to *not*
11751175
// truncate section names (so we can find the metadata section after
11761176
// it's compiled). The real kicker is that rust compiled just fine on
11771177
// windows for quite a long time *without* this flag, so I have no idea
@@ -1491,7 +1491,7 @@ fn add_upstream_rust_crates(args: &mut Vec<~str>, sess: &Session,
14911491
}
14921492

14931493
// Link in all of our upstream crates' native dependencies. Remember that
1494-
// all of these upstream native depenencies are all non-static
1494+
// all of these upstream native dependencies are all non-static
14951495
// dependencies. We've got two cases then:
14961496
//
14971497
// 1. The upstream crate is an rlib. In this case we *must* link in the
@@ -1509,7 +1509,7 @@ fn add_upstream_rust_crates(args: &mut Vec<~str>, sess: &Session,
15091509
// be instantiated in the target crate, meaning that the native symbol must
15101510
// also be resolved in the target crate.
15111511
fn add_upstream_native_libraries(args: &mut Vec<~str>, sess: &Session) {
1512-
// Be sure to use a topological sorting of crates becuase there may be
1512+
// Be sure to use a topological sorting of crates because there may be
15131513
// interdependencies between native libraries. When passing -nodefaultlibs,
15141514
// for example, almost all native libraries depend on libc, so we have to
15151515
// make sure that's all the way at the right (liblibc is near the base of

src/librustc/back/svh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
//! such.
2121
//!
2222
//! The core of this problem is when an upstream dependency changes and
23-
//! downstream dependants are not recompiled. This causes compile errors because
23+
//! downstream dependents are not recompiled. This causes compile errors because
2424
//! the upstream crate's metadata has changed but the downstream crates are
2525
//! still referencing the older crate's metadata.
2626
//!

src/librustc/metadata/loader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ impl<'a> Context<'a> {
222222
//
223223
// A Library candidate is created if the metadata for the set of
224224
// libraries corresponds to the crate id and hash criteria that this
225-
// serach is being performed for.
225+
// search is being performed for.
226226
let mut libraries = Vec::new();
227227
for (_hash, (rlibs, dylibs)) in candidates.move_iter() {
228228
let mut metadata = None;
@@ -278,7 +278,7 @@ impl<'a> Context<'a> {
278278
// rlib/dylib).
279279
//
280280
// The return value is `None` if `file` doesn't look like a rust-generated
281-
// library, or if a specific version was requested and it doens't match the
281+
// library, or if a specific version was requested and it doesn't match the
282282
// apparent file's version.
283283
//
284284
// If everything checks out, then `Some(hash)` is returned where `hash` is

src/librustc/middle/dead.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ fn create_and_seed_worklist(tcx: &ty::ctxt,
275275
None => ()
276276
}
277277

278-
// Seed implemeneted trait methods
278+
// Seed implemented trait methods
279279
let mut life_seeder = LifeSeeder {
280280
worklist: worklist
281281
};

src/librustc/middle/liveness.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
480480
// var must be dead afterwards
481481
moves::CapMove => true,
482482

483-
// var can stil be used
483+
// var can still be used
484484
moves::CapCopy | moves::CapRef => false
485485
};
486486
call_caps.push(CaptureInfo {ln: cv_ln,
@@ -613,7 +613,7 @@ impl<'a> Liveness<'a> {
613613
f: |&mut Liveness<'a>, LiveNode, Variable, Span, NodeId|) {
614614
// only consider the first pattern; any later patterns must have
615615
// the same bindings, and we also consider the first pattern to be
616-
// the "authoratative" set of ids
616+
// the "authoritative" set of ids
617617
if !pats.is_empty() {
618618
self.pat_bindings(pats[0], f)
619619
}

0 commit comments

Comments
 (0)