Skip to content

Commit b1302f9

Browse files
committed
auto merge of #14764 : jbcrail/rust/fix-more-comments, r=alexcrichton
2 parents 7f777a5 + c2c9946 commit b1302f9

File tree

48 files changed

+64
-64
lines changed

Some content is hidden

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

48 files changed

+64
-64
lines changed

src/liballoc/arc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<T: Share + Send> Drop for Arc<T> {
184184

185185
// This fence is needed to prevent reordering of use of the data and
186186
// deletion of the data. Because it is marked `Release`, the
187-
// decreasing of the reference count sychronizes with this `Acquire`
187+
// decreasing of the reference count synchronizes with this `Acquire`
188188
// fence. This means that use of the data happens before decreasing
189189
// the refernce count, which happens before this fence, which
190190
// happens before the deletion of the data.

src/libcore/fmt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ impl<'a> Formatter<'a> {
539539
}
540540

541541
/// Runs a callback, emitting the correct padding either before or
542-
/// afterwards depending on whether right or left alingment is requested.
542+
/// afterwards depending on whether right or left alignment is requested.
543543
fn with_padding(&mut self,
544544
padding: uint,
545545
default: rt::Alignment,

src/libcore/result.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
//! *Note: The actual definition of `Writer` uses `IoResult`, which
106106
//! is just a synonym for `Result<T, IoError>`.*
107107
//!
108-
//! This method doesn`t produce a value, but the write may
108+
//! This method doesn't produce a value, but the write may
109109
//! fail. It's crucial to handle the error case, and *not* write
110110
//! something like this:
111111
//!

src/libgetopts/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub struct OptGroup {
163163
pub occur: Occur
164164
}
165165

166-
/// Describes wether an option is given at all or has a value.
166+
/// Describes whether an option is given at all or has a value.
167167
#[deriving(Clone, PartialEq)]
168168
enum Optval {
169169
Val(String),

src/libgreen/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
227227
regs[RUSTRT_R14] = procedure.env as uint;
228228
regs[RUSTRT_R15] = fptr as uint;
229229

230-
// These registers are picked up by the regulard context switch paths. These
230+
// These registers are picked up by the regular context switch paths. These
231231
// will put us in "mostly the right context" except for frobbing all the
232232
// arguments to the right place. We have the small trampoline code inside of
233233
// rust_bootstrap_green_task to do that.

src/libgreen/sched.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub struct Scheduler {
8282
run_anything: bool,
8383
/// A fast XorShift rng for scheduler use
8484
rng: XorShiftRng,
85-
/// A togglable idle callback
85+
/// A toggleable idle callback
8686
idle_callback: Option<Box<PausableIdleCallback:Send>>,
8787
/// A countdown that starts at a random value and is decremented
8888
/// every time a yield check is performed. When it hits 0 a task
@@ -287,7 +287,7 @@ impl Scheduler {
287287

288288
// After processing a message, we consider doing some more work on the
289289
// event loop. The "keep going" condition changes after the first
290-
// iteration becase we don't want to spin here infinitely.
290+
// iteration because we don't want to spin here infinitely.
291291
//
292292
// Once we start doing work we can keep doing work so long as the
293293
// iteration does something. Note that we don't want to starve the

src/liblibc/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ pub use types::os::arch::extra::{mach_timebase_info};
291291
extern {}
292292

293293
/// A wrapper for a nullable pointer. Don't use this except for interacting
294-
/// with libc. Basically Option, but without the dependance on libstd.
294+
/// with libc. Basically Option, but without the dependence on libstd.
295295
// If/when libprim happens, this can be removed in favor of that
296296
pub enum Nullable<T> {
297297
Null,
@@ -3497,7 +3497,7 @@ pub mod consts {
34973497

34983498

34993499
pub mod funcs {
3500-
// Thankfull most of c95 is universally available and does not vary by OS
3500+
// Thankfully most of c95 is universally available and does not vary by OS
35013501
// or anything. The same is not true of POSIX.
35023502

35033503
pub mod c95 {

src/libnative/io/pipe_win32.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
//! it sounded like named pipes just weren't built for this kind of interaction,
5151
//! and the suggested solution was to use overlapped I/O.
5252
//!
53-
//! I don't realy know what overlapped I/O is, but my basic understanding after
53+
//! I don't really know what overlapped I/O is, but my basic understanding after
5454
//! reading about it is that you have an external Event which is used to signal
5555
//! I/O completion, passed around in some OVERLAPPED structures. As to what this
5656
//! is, I'm not exactly sure.

src/libnative/io/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ fn waitpid(pid: pid_t, deadline: u64) -> IoResult<rtio::ProcessExit> {
923923
// Register a new SIGCHLD handler, returning the reading half of the
924924
// self-pipe plus the old handler registered (return value of sigaction).
925925
//
926-
// Be sure to set up the self-pipe first because as soon as we reigster a
926+
// Be sure to set up the self-pipe first because as soon as we register a
927927
// handler we're going to start receiving signals.
928928
fn register_sigchld() -> (libc::c_int, c::sigaction) {
929929
unsafe {

src/libnative/task.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl rt::Runtime for Ops {
166166
//
167167
// On a mildly unrelated note, it should also be pointed out that OS
168168
// condition variables are susceptible to spurious wakeups, which we need to
169-
// be ready for. In order to accomodate for this fact, we have an extra
169+
// be ready for. In order to accommodate for this fact, we have an extra
170170
// `awoken` field which indicates whether we were actually woken up via some
171171
// invocation of `reawaken`. This flag is only ever accessed inside the
172172
// lock, so there's no need to make it atomic.

src/libregex/compile.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub enum Inst {
3434

3535
// The CharClass instruction tries to match one input character against
3636
// the range of characters given.
37-
// The flags indicate whether to do a case insentivie match and whether
37+
// The flags indicate whether to do a case insensitive match and whether
3838
// the character class is negated or not.
3939
CharClass(Vec<(char, char)>, Flags),
4040

@@ -48,7 +48,7 @@ pub enum Inst {
4848
EmptyBegin(Flags),
4949

5050
// Matches the end of the string, consumes no characters.
51-
// The flags indicate whether it matches if the proceding character
51+
// The flags indicate whether it matches if the proceeding character
5252
// is a new line.
5353
EmptyEnd(Flags),
5454

src/librustc/driver/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ fn describe_codegen_flags() {
189189
}
190190
}
191191

192-
/// Process command line options. Emits messages as appropirate.If compilation
192+
/// Process command line options. Emits messages as appropriate. If compilation
193193
/// should continue, returns a getopts::Matches object parsed from args, otherwise
194194
/// returns None.
195195
pub fn handle_options(mut args: Vec<String>) -> Option<getopts::Matches> {

src/librustc/middle/borrowck/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ are computed based on the kind of borrow:
551551
The reasoning here is that a mutable borrow must be the only writer,
552552
therefore it prevents other writes (`MUTATE`), mutable borrows
553553
(`CLAIM`), and immutable borrows (`FREEZE`). An immutable borrow
554-
permits other immutable borrows but forbids writes and mutable borows.
554+
permits other immutable borrows but forbids writes and mutable borrows.
555555
Finally, a const borrow just wants to be sure that the value is not
556556
moved out from under it, so no actions are forbidden.
557557

src/librustc/middle/expr_use_visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ impl<'d,'t,TYPER:mc::Typer> ExprUseVisitor<'d,'t,TYPER> {
438438
None => {
439439
self.tcx().sess.span_bug(
440440
callee.span,
441-
format!("unxpected callee type {}",
441+
format!("unexpected callee type {}",
442442
callee_ty.repr(self.tcx())).as_slice());
443443
}
444444
}

src/librustc/middle/graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ impl<N,E> Graph<N,E> {
257257
//
258258
// A common use for graphs in our compiler is to perform
259259
// fixed-point iteration. In this case, each edge represents a
260-
// constaint, and the nodes themselves are associated with
260+
// constraint, and the nodes themselves are associated with
261261
// variables or other bitsets. This method facilitates such a
262262
// computation.
263263

src/librustc/middle/mem_categorization.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* is the address of the lvalue. If Expr is an rvalue, this is the address of
3232
* some temporary spot in memory where the result is stored.
3333
*
34-
* Now, cat_expr() classies the expression Expr and the address A=ToAddr(Expr)
34+
* Now, cat_expr() classifies the expression Expr and the address A=ToAddr(Expr)
3535
* as follows:
3636
*
3737
* - cat: what kind of expression was this? This is a subset of the
@@ -42,7 +42,7 @@
4242
*
4343
* The resulting categorization tree differs somewhat from the expressions
4444
* themselves. For example, auto-derefs are explicit. Also, an index a[b] is
45-
* decomposed into two operations: a derefence to reach the array data and
45+
* decomposed into two operations: a dereference to reach the array data and
4646
* then an index to jump forward to the relevant item.
4747
*
4848
* ## By-reference upvars

src/librustc/middle/region.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The region maps encode information about region relationships.
3939
4040
- `scope_map` maps from a scope id to the enclosing scope id; this is
4141
usually corresponding to the lexical nesting, though in the case of
42-
closures the parent scope is the innermost conditinal expression or repeating
42+
closures the parent scope is the innermost conditional expression or repeating
4343
block
4444
4545
- `var_map` maps from a variable or binding id to the block in which

src/librustc/middle/trans/adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ pub fn trans_field_ptr(bcx: &Block, r: &Repr, val: ValueRef, discr: Disr,
717717
let ty = type_of::type_of(bcx.ccx(), *nullfields.get(ix));
718718
assert_eq!(machine::llsize_of_alloc(bcx.ccx(), ty), 0);
719719
// The contents of memory at this pointer can't matter, but use
720-
// the value that's "reasonable" in case of pointer comparision.
720+
// the value that's "reasonable" in case of pointer comparison.
721721
PointerCast(bcx, val, ty.ptr_to())
722722
}
723723
RawNullablePointer { nndiscr, nnty, .. } => {

src/librustc/middle/trans/base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ fn enum_variant_size_lint(ccx: &CrateContext, enum_def: &ast::EnumDef, sp: Span,
15731573
for var in variants.iter() {
15741574
let mut size = 0;
15751575
for field in var.fields.iter().skip(1) {
1576-
// skip the dicriminant
1576+
// skip the discriminant
15771577
size += llsize_of_real(ccx, sizing_type_of(ccx, *field));
15781578
}
15791579
sizes.push(size);
@@ -2320,7 +2320,7 @@ pub fn trans_crate(krate: ast::Crate,
23202320
// LLVM code generator emits a ".file filename" directive
23212321
// for ELF backends. Value of the "filename" is set as the
23222322
// LLVM module identifier. Due to a LLVM MC bug[1], LLVM
2323-
// crashes if the module identifer is same as other symbols
2323+
// crashes if the module identifier is same as other symbols
23242324
// such as a function name in the module.
23252325
// 1. http://llvm.org/bugs/show_bug.cgi?id=11479
23262326
let mut llmod_id = link_meta.crateid.name.clone();

src/librustc/middle/trans/debuginfo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ impl EnumMemberDescriptionFactory {
15271527
// As far as debuginfo is concerned, the pointer this enum represents is still
15281528
// wrapped in a struct. This is to make the DWARF representation of enums uniform.
15291529

1530-
// First create a description of the artifical wrapper struct:
1530+
// First create a description of the artificial wrapper struct:
15311531
let non_null_variant = self.variants.get(non_null_variant_index as uint);
15321532
let non_null_variant_ident = non_null_variant.name;
15331533
let non_null_variant_name = token::get_ident(non_null_variant_ident);

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl FnStyleState {
204204
}
205205

206206
/// Whether `check_binop` is part of an assignment or not.
207-
/// Used to know wether we allow user overloads and to print
207+
/// Used to know whether we allow user overloads and to print
208208
/// better messages on error.
209209
#[deriving(PartialEq)]
210210
enum IsBinopAssignment{
@@ -3702,7 +3702,7 @@ pub fn check_const_with_ty(fcx: &FnCtxt,
37023702
e: &ast::Expr,
37033703
declty: ty::t) {
37043704
// Gather locals in statics (because of block expressions).
3705-
// This is technically uneccessary because locals in static items are forbidden,
3705+
// This is technically unnecessary because locals in static items are forbidden,
37063706
// but prevents type checking from blowing up before const checking can properly
37073707
// emit a error.
37083708
GatherLocalsVisitor { fcx: fcx }.visit_expr(e, ());
@@ -4174,7 +4174,7 @@ pub fn instantiate_path(fcx: &FnCtxt,
41744174
}
41754175
None => {
41764176
fcx.tcx().sess.span_bug(span,
4177-
"missing default for a not explicitely provided type param")
4177+
"missing default for a not explicitly provided type param")
41784178
}
41794179
}
41804180
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl<'f> Coerce<'f> {
180180
self.unpack_actual_value(a, |sty_a| {
181181
match *sty_a {
182182
ty::ty_bare_fn(ref a_f) => {
183-
// Bare functions are coercable to any closure type.
183+
// Bare functions are coercible to any closure type.
184184
//
185185
// FIXME(#3320) this should go away and be
186186
// replaced with proper inference, got a patch

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ pub fn super_fn_sigs<C:Combine>(this: &C, a: &ty::FnSig, b: &ty::FnSig) -> cres<
372372

373373
pub fn super_tys<C:Combine>(this: &C, a: ty::t, b: ty::t) -> cres<ty::t> {
374374

375-
// This is a horible hack - historically, [T] was not treated as a type,
375+
// This is a horrible hack - historically, [T] was not treated as a type,
376376
// so, for example, &T and &[U] should not unify. In fact the only thing
377377
// &[U] should unify with is &[T]. We preserve that behaviour with this
378378
// check.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ works, it often happens that errors are not detected until far after
1717
the relevant line of code has been type-checked. Therefore, there is
1818
an elaborate system to track why a particular constraint in the
1919
inference graph arose so that we can explain to the user what gave
20-
rise to a patricular error.
20+
rise to a particular error.
2121
2222
The basis of the system are the "origin" types. An "origin" is the
2323
reason that a constraint or inference variable arose. There are

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* The code in here is defined quite generically so that it can be
2020
* applied both to type variables, which represent types being inferred,
2121
* and fn variables, which represent function types being inferred.
22-
* It may eventually be applied to ther types as well, who knows.
22+
* It may eventually be applied to their types as well, who knows.
2323
* In some cases, the functions are also generic with respect to the
2424
* operation on the lattice (GLB vs LUB).
2525
*

src/librustc/middle/typeck/infer/region_inference/doc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ identify and remove strongly connected components (SCC) in the graph.
362362
Note that such components must consist solely of region variables; all
363363
of these variables can effectively be unified into a single variable.
364364
Once SCCs are removed, we are left with a DAG. At this point, we
365-
could walk the DAG in toplogical order once to compute the expanding
365+
could walk the DAG in topological order once to compute the expanding
366366
nodes, and again in reverse topological order to compute the
367367
contracting nodes. However, as I said, this does not work given the
368368
current treatment of closure bounds, but perhaps in the future we can
@@ -617,7 +617,7 @@ created to replace the bound regions in the input types, but it also
617617
contains 'intermediate' variables created to represent the LUB/GLB of
618618
individual regions. Basically, when asked to compute the LUB/GLB of a
619619
region variable with another region, the inferencer cannot oblige
620-
immediately since the valuese of that variables are not known.
620+
immediately since the values of that variables are not known.
621621
Therefore, it creates a new variable that is related to the two
622622
regions. For example, the LUB of two variables `$x` and `$y` is a
623623
fresh variable `$z` that is constrained such that `$x <= $z` and `$y

src/librustc/middle/typeck/variance.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ impl<'a> Visitor<()> for ConstraintContext<'a> {
483483
let variant =
484484
ty::VariantInfo::from_ast_variant(tcx,
485485
ast_variant,
486-
/*discrimant*/ 0);
486+
/*discriminant*/ 0);
487487
for &arg_ty in variant.args.iter() {
488488
self.add_constraints_from_ty(arg_ty, self.covariant);
489489
}

src/librustc/util/sha2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ fn add_bytes_to_bits<T: Int + CheckedAdd + ToBits>(bits: T, bytes: T) -> T {
6161
let (new_high_bits, new_low_bits) = bytes.to_bits();
6262

6363
if new_high_bits > Zero::zero() {
64-
fail!("numeric overflow occured.")
64+
fail!("numeric overflow occurred.")
6565
}
6666

6767
match bits.checked_add(&new_low_bits) {
6868
Some(x) => return x,
69-
None => fail!("numeric overflow occured.")
69+
None => fail!("numeric overflow occurred.")
7070
}
7171
}
7272

src/librustdoc/html/markdown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ fn parse_lang_string(string: &str) -> (bool,bool,bool,bool) {
391391
}
392392

393393
/// By default this markdown renderer generates anchors for each header in the
394-
/// rendered document. The anchor name is the contents of the header spearated
394+
/// rendered document. The anchor name is the contents of the header separated
395395
/// by hyphens, and a task-local map is used to disambiguate among duplicate
396396
/// headers (numbers are appended).
397397
///

src/librustdoc/html/toc.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ pub struct TocEntry {
4949
#[deriving(PartialEq)]
5050
pub struct TocBuilder {
5151
top_level: Toc,
52-
/// The current heirachy of parent headings, the levels are
52+
/// The current hierarchy of parent headings, the levels are
5353
/// strictly increasing (i.e. chain[0].level < chain[1].level <
54-
/// ...) with each entry being the most recent occurance of a
54+
/// ...) with each entry being the most recent occurrence of a
5555
/// heading with that level (it doesn't include the most recent
56-
/// occurences of every level, just, if *is* in `chain` then is is
56+
/// occurrences of every level, just, if *is* in `chain` then is is
5757
/// the most recent one).
5858
///
5959
/// We also have `chain[0].level <= top_level.entries[last]`.
@@ -123,7 +123,7 @@ impl TocBuilder {
123123
}
124124

125125
/// Push a level `level` heading into the appropriate place in the
126-
/// heirarchy, returning a string containing the section number in
126+
/// hierarchy, returning a string containing the section number in
127127
/// `<num>.<num>.<num>` format.
128128
pub fn push<'a>(&'a mut self, level: u32, name: String, id: String) -> &'a str {
129129
assert!(level >= 1);

src/librustdoc/passes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ mod unindent_tests {
383383

384384
#[test]
385385
fn should_ignore_first_line_indent() {
386-
// Thi first line of the first paragraph may not be indented as
386+
// The first line of the first paragraph may not be indented as
387387
// far due to the way the doc string was written:
388388
//
389389
// #[doc = "Start way over here

src/librustrt/task.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl Task {
163163

164164
// Here we must unsafely borrow the task in order to not remove it from
165165
// TLS. When collecting failure, we may attempt to send on a channel (or
166-
// just run aribitrary code), so we must be sure to still have a local
166+
// just run arbitrary code), so we must be sure to still have a local
167167
// task in TLS.
168168
unsafe {
169169
let me: *mut Task = Local::unsafe_borrow();

src/librustrt/unwind.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ pub fn begin_unwind<M: Any + Send>(msg: M, file: &'static str, line: uint) -> !
395395
/// The core of the unwinding.
396396
///
397397
/// This is non-generic to avoid instantiation bloat in other crates
398-
/// (which makes compilation of small crates noticably slower). (Note:
398+
/// (which makes compilation of small crates noticeably slower). (Note:
399399
/// we need the `Any` object anyway, we're not just creating it to
400400
/// avoid being generic.)
401401
///
@@ -408,7 +408,7 @@ fn begin_unwind_inner(msg: Box<Any:Send>,
408408
// First, invoke call the user-defined callbacks triggered on task failure.
409409
//
410410
// By the time that we see a callback has been registered (by reading
411-
// MAX_CALLBACKS), the actuall callback itself may have not been stored yet,
411+
// MAX_CALLBACKS), the actual callback itself may have not been stored yet,
412412
// so we just chalk it up to a race condition and move on to the next
413413
// callback. Additionally, CALLBACK_CNT may briefly be higher than
414414
// MAX_CALLBACKS, so we're sure to clamp it as necessary.

0 commit comments

Comments
 (0)