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

+2-2
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

+4-4
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

+1-1
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

+1-1
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

+1-1
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

+3-3
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

+1-1
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

+2-2
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

+1-1
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

+2-2
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
}

src/librustc/middle/privacy.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl Visitor<()> for ParentVisitor {
6363
let prev = self.curparent;
6464
match item.node {
6565
ast::ItemMod(..) => { self.curparent = item.id; }
66-
// Enum variants are parented to the enum definition itself beacuse
66+
// Enum variants are parented to the enum definition itself because
6767
// they inherit privacy
6868
ast::ItemEnum(ref def, _) => {
6969
for variant in def.variants.iter() {
@@ -1034,7 +1034,7 @@ impl<'a> Visitor<()> for SanePrivacyVisitor<'a> {
10341034
}
10351035

10361036
impl<'a> SanePrivacyVisitor<'a> {
1037-
/// Validates all of the visibility qualifers placed on the item given. This
1037+
/// Validates all of the visibility qualifiers placed on the item given. This
10381038
/// ensures that there are no extraneous qualifiers that don't actually do
10391039
/// anything. In theory these qualifiers wouldn't parse, but that may happen
10401040
/// later on down the road...
@@ -1262,7 +1262,7 @@ impl<'a> Visitor<()> for VisiblePrivateTypesVisitor<'a> {
12621262
self_is_public_path = visitor.outer_type_is_public_path;
12631263
}
12641264

1265-
// miscellanous info about the impl
1265+
// miscellaneous info about the impl
12661266

12671267
// `true` iff this is `impl Private for ...`.
12681268
let not_private_trait =

src/librustc/middle/region.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl RegionMaps {
182182

183183
// else, locate the innermost terminating scope
184184
// if there's one. Static items, for instance, won't
185-
// have an enclusing scope, hence no scope will be
185+
// have an enclosing scope, hence no scope will be
186186
// returned.
187187
let mut id = match self.opt_encl_scope(expr_id) {
188188
Some(i) => i,
@@ -533,7 +533,7 @@ fn resolve_expr(visitor: &mut RegionResolutionVisitor,
533533
// the invoked function is actually running* and call.id
534534
// represents *the time to prepare the arguments and make the
535535
// call*. See the section "Borrows in Calls" borrowck/doc.rs
536-
// for an extended explanantion of why this distinction is
536+
// for an extended explanation of why this distinction is
537537
// important.
538538
//
539539
// record_superlifetime(new_cx, expr.callee_id);
@@ -604,7 +604,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor,
604604
// (covers cases `expr` borrows an rvalue that is then assigned
605605
// to memory (at least partially) owned by the binding)
606606
//
607-
// Here are some examples hopefully giving an intution where each
607+
// Here are some examples hopefully giving an intuition where each
608608
// rule comes into play and why:
609609
//
610610
// Rule A. `let (ref x, ref y) = (foo().x, 44)`. The rvalue `(22, 44)`

src/librustc/middle/resolve.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub enum LastPrivate {
7272
// `use` directives (imports) can refer to two separate definitions in the
7373
// type and value namespaces. We record here the last private node for each
7474
// and whether the import is in fact used for each.
75-
// If the Option<PrivateDep> fields are None, it means there is no defintion
75+
// If the Option<PrivateDep> fields are None, it means there is no definition
7676
// in that namespace.
7777
LastImport{pub value_priv: Option<PrivateDep>,
7878
pub value_used: ImportUse,
@@ -3610,7 +3610,7 @@ impl<'a> Resolver<'a> {
36103610
}
36113611
}
36123612

3613-
// n.b. the discr expr gets visted twice.
3613+
// n.b. the discr expr gets visited twice.
36143614
// but maybe it's okay since the first time will signal an
36153615
// error if there is one? -- tjc
36163616
self.with_type_parameter_rib(HasTypeParameters(generics,

src/librustc/middle/subst.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ impl Subst for ty::Region {
272272
substs: &ty::substs,
273273
_: Option<Span>) -> ty::Region {
274274
// Note: This routine only handles regions that are bound on
275-
// type declarationss and other outer declarations, not those
275+
// type declarations and other outer declarations, not those
276276
// bound in *fn types*. Region substitution of the bound
277277
// regions that appear in a function signature is done using
278278
// the specialized routine

src/librustc/middle/trans/_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ fn get_options(bcx: &Block, m: &[Match], col: uint) -> Vec<Opt> {
963963
if set.iter().any(|l| opt_eq(tcx, l, &val)) {return;}
964964
set.push(val);
965965
}
966-
// Vector comparisions are special in that since the actual
966+
// Vector comparisons are special in that since the actual
967967
// conditions over-match, we need to be careful about them. This
968968
// means that in order to properly handle things in order, we need
969969
// to not always merge conditions.

src/librustc/middle/trans/callee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ pub fn trans_fn_ref_with_vtables(
370370
false
371371
};
372372

373-
// Create a monomorphic verison of generic functions
373+
// Create a monomorphic version of generic functions
374374
if must_monomorphise {
375375
// Should be either intra-crate or inlined.
376376
assert_eq!(def_id.krate, ast::LOCAL_CRATE);

src/librustc/middle/trans/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ use syntax::ast_util;
8484
// because the alignment requirements of the bound data affects the
8585
// alignment requires of the closure_data struct as a whole. However,
8686
// right now this is a non-issue in any case, because the size of the
87-
// rust_opaque_box header is always a mutiple of 16-bytes, which is
87+
// rust_opaque_box header is always a multiple of 16-bytes, which is
8888
// the maximum alignment requirement we ever have to worry about.
8989
//
9090
// The only reason alignment matters is that, in order to learn what data

src/librustc/middle/trans/debuginfo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,7 @@ fn populate_scope_map(cx: &CrateContext,
25032503
ast::PatIdent(_, ref path_ref, ref sub_pat_opt) => {
25042504

25052505
// Check if this is a binding. If so we need to put it on the scope stack and maybe
2506-
// introduce an articial scope
2506+
// introduce an artificial scope
25072507
if pat_util::pat_is_binding(def_map, pat) {
25082508

25092509
let ident = ast_util::path_to_ident(path_ref);

src/librustc/middle/trans/monomorphize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
128128
// Static default methods are a little unfortunate, in
129129
// that the "internal" and "external" type of them differ.
130130
// Internally, the method body can refer to Self, but the
131-
// externally visable type of the method has a type param
131+
// externally visible type of the method has a type param
132132
// inserted in between the trait type params and the
133133
// method type params. The substs that we are given are
134134
// the proper substs *internally* to the method body, so

src/librustc/middle/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,7 @@ pub fn is_instantiable(cx: &ctxt, r_ty: t) -> bool {
23382338
let r = match get(ty).sty {
23392339
// fixed length vectors need special treatment compared to
23402340
// normal vectors, since they don't necessarily have the
2341-
// possibilty to have length zero.
2341+
// possibility to have length zero.
23422342
ty_vec(_, Some(0)) => false, // don't need no contents
23432343
ty_vec(mt, Some(_)) => type_requires(cx, seen, r_ty, mt.ty),
23442344

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub struct FnCtxt<'a> {
238238
//
239239
// What we do in such cases is to generate a region variable with
240240
// `region_lb` as a lower bound. The regionck pass then adds
241-
// other constriants based on how the variable is used and region
241+
// other constraints based on how the variable is used and region
242242
// inference selects the ultimate value. Finally, borrowck is
243243
// charged with guaranteeing that the value whose address was taken
244244
// can actually be made to live as long as it needs to live.
@@ -2548,7 +2548,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
25482548
ty::mt {ty: t, mutbl: mutability},
25492549
None)), // Sadly, we know the length
25502550
// - Some(args.len()) - but
2551-
// must thow it away or cause
2551+
// must throw it away or cause
25522552
// confusion further down the
25532553
// pipeline. Hopefully we can
25542554
// remedy this later.

src/librustc/middle/typeck/infer/resolve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
// therefore cannot sensibly be mapped to any particular result. By
3737
// default, we will leave such variables as is (so you will get back a
3838
// variable in your result). The options force_* will cause the
39-
// resolution to fail in this case intead, except for the case of
39+
// resolution to fail in this case instead, except for the case of
4040
// integral variables, which resolve to `int` if forced.
4141
//
4242
// # resolve_all and force_all

src/librustc/util/sha2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ impl FixedBuffer for FixedBuffer64 {
146146
}
147147
}
148148

149-
// While we have at least a full buffer size chunks's worth of data, process that data
149+
// While we have at least a full buffer size chunk's worth of data, process that data
150150
// without copying it into the buffer
151151
while input.len() - i >= size {
152152
func(input.slice(i, i + size));
153153
i += size;
154154
}
155155

156-
// Copy any input data into the buffer. At this point in the method, the ammount of
156+
// Copy any input data into the buffer. At this point in the method, the amount of
157157
// data left in the input vector will be less than the buffer size and the buffer will
158158
// be empty.
159159
let input_remaining = input.len() - i;

src/libstd/cmp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//!
2727
//! // Our implementation of `Eq` to support `==` and `!=`.
2828
//! impl Eq for SketchyNum {
29-
//! // Our custom eq allows numbers which are near eachother to be equal! :D
29+
//! // Our custom eq allows numbers which are near each other to be equal! :D
3030
//! fn eq(&self, other: &SketchyNum) -> bool {
3131
//! (self.num - other.num).abs() < 5
3232
//! }
@@ -283,7 +283,7 @@ mod test {
283283

284284
// Our implementation of `Eq` to support `==` and `!=`.
285285
impl Eq for SketchyNum {
286-
// Our custom eq allows numbers which are near eachother to be equal! :D
286+
// Our custom eq allows numbers which are near each other to be equal! :D
287287
fn eq(&self, other: &SketchyNum) -> bool {
288288
(self.num - other.num).abs() < 5
289289
}

src/libstd/iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ impl<A: TotalOrd, T: Iterator<A>> OrdIterator<A> for T {
937937
loop {
938938
// `first` and `second` are the two next elements we want to look at.
939939
// We first compare `first` and `second` (#1). The smaller one is then compared to
940-
// current mininum (#2). The larger one is compared to current maximum (#3). This
940+
// current minimum (#2). The larger one is compared to current maximum (#3). This
941941
// way we do 3 comparisons for 2 elements.
942942
let first = match self.next() {
943943
None => break,

src/libstd/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/// which is transmitted.
2525
///
2626
/// The multi-argument form of this macro fails with a string and has the
27-
/// `format!` sytnax for building a string.
27+
/// `format!` syntax for building a string.
2828
///
2929
/// # Example
3030
///

src/libstd/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! an unsafe pointer when safe pointers are unsuitable;
1616
//! checking for null; and converting back to safe pointers.
1717
//! As a result, there is not yet an abundance of library code
18-
//! for working with unsafe poniters, and in particular,
18+
//! for working with unsafe pointers, and in particular,
1919
//! since pointer math is fairly uncommon in Rust, it is not
2020
//! all that convenient.
2121
//!

src/libstd/raw.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! They can be used as targets of transmutes in unsafe code for manipulating
1616
//! the raw representations directly.
1717
//!
18-
//! Their definitition should always match the ABI defined in `rustc::back::abi`.
18+
//! Their definition should always match the ABI defined in `rustc::back::abi`.
1919
2020
use cast;
2121

0 commit comments

Comments
 (0)