Skip to content

Commit 08a2bef

Browse files
committed
Rollup merge of rust-lang#21954 - jbcrail:fix-misspelled-comments, r=steveklabnik
The spelling corrections were made in both documentation comments and regular comments.
2 parents 6bf0cd8 + dc2e444 commit 08a2bef

File tree

27 files changed

+36
-36
lines changed

27 files changed

+36
-36
lines changed

src/doc/trpl/ownership.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ fn print<'a>(s: &'a str); // expanded
523523
fn debug(lvl: u32, s: &str); // elided
524524
fn debug<'a>(lvl: u32, s: &'a str); // expanded
525525
526-
// In the preceeding example, `lvl` doesn't need a lifetime because it's not a
526+
// In the preceding example, `lvl` doesn't need a lifetime because it's not a
527527
// reference (`&`). Only things relating to references (such as a `struct`
528528
// which contains a reference) need lifetimes.
529529

src/grammar/parser-lalr.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ maybe_stmts
11951195
//
11961196
// There are also two other expr subtypes: first, nonparen_expr
11971197
// disallows exprs surrounded by parens (including tuple expressions),
1198-
// this is neccesary for BOX (place) expressions, so a parens expr
1198+
// this is necessary for BOX (place) expressions, so a parens expr
11991199
// following the BOX is always parsed as the place. There is also
12001200
// expr_norange used in index_expr, which disallows '..' in
12011201
// expressions as that has special meaning inside of brackets.

src/liballoc/arc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl<T: Sync + Send> Drop for Arc<T> {
311311
///
312312
/// // stuff
313313
///
314-
/// drop(five); // explict drop
314+
/// drop(five); // explicit drop
315315
/// }
316316
/// {
317317
/// let five = Arc::new(5);
@@ -441,7 +441,7 @@ impl<T: Sync + Send> Drop for Weak<T> {
441441
///
442442
/// // stuff
443443
///
444-
/// drop(weak_five); // explict drop
444+
/// drop(weak_five); // explicit drop
445445
/// }
446446
/// {
447447
/// let five = Arc::new(5);

src/liballoc/rc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl<T> Drop for Rc<T> {
383383
///
384384
/// // stuff
385385
///
386-
/// drop(five); // explict drop
386+
/// drop(five); // explicit drop
387387
/// }
388388
/// {
389389
/// let five = Rc::new(5);
@@ -688,7 +688,7 @@ impl<T> Drop for Weak<T> {
688688
///
689689
/// // stuff
690690
///
691-
/// drop(weak_five); // explict drop
691+
/// drop(weak_five); // explicit drop
692692
/// }
693693
/// {
694694
/// let five = Rc::new(5);

src/libcollections/btree/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ impl<'a, K: 'a, V: 'a> Handle<&'a mut Node<K, V>, handle::Edge, handle::Internal
669669

670670
impl<K, V, NodeRef: Deref<Target=Node<K, V>>> Handle<NodeRef, handle::Edge, handle::Internal> {
671671
// This doesn't exist because there are no uses for it,
672-
// but is fine to add, analagous to edge_mut.
672+
// but is fine to add, analogous to edge_mut.
673673
//
674674
// /// Returns a reference to the edge pointed-to by this handle. This should not be
675675
// /// confused with `node`, which references the parent node of what is returned here.

src/libcore/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ pub trait IteratorExt: Iterator + Sized {
260260
}
261261

262262
/// Creates an iterator that applies the predicate to each element returned
263-
/// by this iterator. The only elements that will be yieled are those that
263+
/// by this iterator. The only elements that will be yielded are those that
264264
/// make the predicate evaluate to `true`.
265265
///
266266
/// # Examples

src/librustc/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ register_long_diagnostics! {
1414
E0001: r##"
1515
This error suggests that the expression arm corresponding to the noted pattern
1616
will never be reached as for all possible values of the expression being matched,
17-
one of the preceeding patterns will match.
17+
one of the preceding patterns will match.
1818
19-
This means that perhaps some of the preceeding patterns are too general, this
19+
This means that perhaps some of the preceding patterns are too general, this
2020
one is too specific or the ordering is incorrect.
2121
"##,
2222

src/librustc/middle/traits/select.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
775775
-> bool
776776
{
777777
// In general, it's a good idea to cache results, even
778-
// ambigious ones, to save us some trouble later. But we have
778+
// ambiguous ones, to save us some trouble later. But we have
779779
// to be careful not to cache results that could be
780780
// invalidated later by advances in inference. Normally, this
781781
// is not an issue, because any inference variables whose
@@ -1273,7 +1273,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12731273
///
12741274
/// - The impl is conditional, in which case we may not have winnowed it out
12751275
/// because we don't know if the conditions apply, but the where clause is basically
1276-
/// telling us taht there is some impl, though not necessarily the one we see.
1276+
/// telling us that there is some impl, though not necessarily the one we see.
12771277
///
12781278
/// In both cases we prefer to take the where clause, which is
12791279
/// essentially harmless. See issue #18453 for more details of

src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2520,7 +2520,7 @@ impl FlagComputation {
25202520
fn add_bound_computation(&mut self, computation: &FlagComputation) {
25212521
self.add_flags(computation.flags);
25222522

2523-
// The types that contributed to `computation` occured within
2523+
// The types that contributed to `computation` occurred within
25242524
// a region binder, so subtract one from the region depth
25252525
// within when adding the depth to `self`.
25262526
let depth = computation.depth;

src/librustc_borrowck/borrowck/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
//! which contains an empty set of actions, still has a purpose---it
143143
//! prevents moves from `LV`. I chose not to make `MOVE` a fourth kind of
144144
//! action because that would imply that sometimes moves are permitted
145-
//! from restrictived values, which is not the case.
145+
//! from restricted values, which is not the case.
146146
//!
147147
//! #### Example
148148
//!

src/librustc_driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ pub fn source_name(input: &Input) -> String {
171171
/// CompileController is used to customise compilation, it allows compilation to
172172
/// be stopped and/or to call arbitrary code at various points in compilation.
173173
/// It also allows for various flags to be set to influence what information gets
174-
/// colelcted during compilation.
174+
/// collected during compilation.
175175
///
176176
/// This is a somewhat higher level controller than a Session - the Session
177177
/// controls what happens in each phase, whereas the CompileController controls

src/librustc_resolve/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ register_diagnostics! {
2020
E0254, // import conflicts with imported crate in this module
2121
E0255, // import conflicts with value in this module
2222
E0256, // import conflicts with type in this module
23-
E0257, // inherent implementations are only allowen on types defined in the current module
23+
E0257, // inherent implementations are only allowed on types defined in the current module
2424
E0258, // import conflicts with existing submodule
2525
E0259, // an extern crate has already been imported into this module
2626
E0260 // name conflicts with an external crate that has been imported into this module

src/librustc_trans/trans/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
365365
(_, "init") => {
366366
let tp_ty = *substs.types.get(FnSpace, 0);
367367
if !return_type_is_void(ccx, tp_ty) {
368-
// Just zero out the stack slot. (See comment on base::memzero for explaination)
368+
// Just zero out the stack slot. (See comment on base::memzero for explanation)
369369
zero_mem(bcx, llresult, tp_ty);
370370
}
371371
C_nil(ccx)

src/librustc_typeck/check/compare_method.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ pub fn compare_impl_method<'tcx>(tcx: &ty::ctxt<'tcx>,
159159
// vs 'b). However, the normal subtyping rules on fn types handle
160160
// this kind of equivalency just fine.
161161
//
162-
// We now use these subsititions to ensure that all declared bounds are
162+
// We now use these substitutions to ensure that all declared bounds are
163163
// satisfied by the implementation's method.
164164
//
165165
// We do this by creating a parameter environment which contains a
166-
// substition corresponding to impl_to_skol_substs. We then build
166+
// substitution corresponding to impl_to_skol_substs. We then build
167167
// trait_to_skol_substs and use it to convert the predicates contained
168168
// in the trait_m.generics to the skolemized form.
169169
//

src/librustc_typeck/check/vtable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ pub fn select_all_fcx_obligations_and_apply_defaults(fcx: &FnCtxt) {
288288
pub fn select_all_fcx_obligations_or_error(fcx: &FnCtxt) {
289289
debug!("select_all_fcx_obligations_or_error");
290290

291-
// upvar inference should have ensured that all deferrred call
291+
// upvar inference should have ensured that all deferred call
292292
// resolutions are handled by now.
293293
assert!(fcx.inh.deferred_call_resolutions.borrow().is_empty());
294294

src/librustc_typeck/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ register_diagnostics! {
108108
E0189, // can only cast a boxed pointer to a boxed object
109109
E0190, // can only cast a &-pointer to an &-object
110110
E0191, // value of the associated type must be specified
111-
E0192, // negative imples are allowed just fo `Send` and `Sync`
111+
E0192, // negative imples are allowed just for `Send` and `Sync`
112112
E0193, // cannot bound type where clause bounds may only be attached to types
113113
// involving type parameters
114114
E0194,
@@ -119,7 +119,7 @@ register_diagnostics! {
119119
E0199, // implementing trait is not unsafe
120120
E0200, // trait requires an `unsafe impl` declaration
121121
E0201, // duplicate method in trait impl
122-
E0202, // associated items are not allowed in inherint impls
122+
E0202, // associated items are not allowed in inherent impls
123123
E0203, // type parameter has more than one relaxed default bound,
124124
// and only one is supported
125125
E0204, // trait `Copy` may not be implemented for this type; field

src/libstd/collections/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
//!
314314
//! assert_eq!(count.get(&'s'), Some(&8));
315315
//!
316-
//! println!("Number of occurences of each character");
316+
//! println!("Number of occurrences of each character");
317317
//! for (char, count) in count.iter() {
318318
//! println!("{}: {}", char, count);
319319
//! }

src/libstd/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ pub fn temp_dir() -> Path {
337337
///
338338
/// # Errors
339339
///
340-
/// Acquring the path to the current executable is a platform-specific operation
340+
/// Acquiring the path to the current executable is a platform-specific operation
341341
/// that can fail for a good number of reasons. Some errors can include, but not
342342
/// be limited to filesystem operations failing or general syscall failures.
343343
///

src/libstd/io/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn with_end_to_cap<F>(v: &mut Vec<u8>, f: F) -> Result<usize>
9797
//
9898
// To this end, we use an RAII guard (to protect against panics) which updates
9999
// the length of the string when it is dropped. This guard initially truncates
100-
// the string to the prior length and only afer we've validated that the
100+
// the string to the prior length and only after we've validated that the
101101
// new contents are valid UTF-8 do we allow it to set a longer length.
102102
//
103103
// The unsafety in this function is twofold:
@@ -664,7 +664,7 @@ impl<T> Take<T> {
664664
///
665665
/// # Note
666666
///
667-
/// This instance may reach EOF after reading fewer bytes than indiccated by
667+
/// This instance may reach EOF after reading fewer bytes than indicated by
668668
/// this method if the underlying `Read` instance reaches EOF.
669669
pub fn limit(&self) -> u64 { self.limit }
670670
}

src/libstd/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ impl PathBuf {
922922
///
923923
/// If `self.file_name()` is `None`, does nothing and returns `false`.
924924
///
925-
/// Otherwise, returns `tru`; if `self.exension()` is `None`, the extension
925+
/// Otherwise, returns `true`; if `self.extension()` is `None`, the extension
926926
/// is added; otherwise it is replaced.
927927
pub fn set_extension<S: ?Sized + AsOsStr>(&mut self, extension: &S) -> bool {
928928
if self.file_name().is_none() { return false; }
@@ -1062,7 +1062,7 @@ impl Path {
10621062
PathBuf::new(self)
10631063
}
10641064

1065-
/// A path is *absolute* if it is indepedent of the current directory.
1065+
/// A path is *absolute* if it is independent of the current directory.
10661066
///
10671067
/// * On Unix, a path is absolute if it starts with the root, so
10681068
/// `is_absolute` and `has_root` are equivalent.

src/libstd/sync/mpsc/oneshot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use core::mem;
4545
use sync::atomic::{AtomicUsize, Ordering};
4646

4747
// Various states you can find a port in.
48-
const EMPTY: uint = 0; // initial state: no data, no blocked reciever
48+
const EMPTY: uint = 0; // initial state: no data, no blocked receiver
4949
const DATA: uint = 1; // data ready for receiver to take
5050
const DISCONNECTED: uint = 2; // channel is disconnected OR upgraded
5151
// Any other value represents a pointer to a SignalToken value. The

src/libstd/sys/common/wtf8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl CodePoint {
8484

8585
/// Create a new `CodePoint` from a `char`.
8686
///
87-
/// Since all Unicode scalar values are code points, this always succeds.
87+
/// Since all Unicode scalar values are code points, this always succeeds.
8888
#[inline]
8989
pub fn from_char(value: char) -> CodePoint {
9090
CodePoint { value: value as u32 }

src/libstd/sys/windows/thread_local.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ unsafe fn unregister_dtor(key: Key) -> bool {
191191
// # What's up with this callback?
192192
//
193193
// The callback specified receives a number of parameters from... someone!
194-
// (the kernel? the runtime? I'm not qute sure!) There are a few events that
194+
// (the kernel? the runtime? I'm not quite sure!) There are a few events that
195195
// this gets invoked for, but we're currently only interested on when a
196196
// thread or a process "detaches" (exits). The process part happens for the
197197
// last thread and the thread part happens for any normal thread.

src/libstd/time/duration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl Duration {
232232
secs_part.checked_add(nanos_part as i64)
233233
}
234234

235-
/// Add two durations, returning `None` if overflow occured.
235+
/// Add two durations, returning `None` if overflow occurred.
236236
#[unstable(feature = "std_misc")]
237237
pub fn checked_add(&self, rhs: &Duration) -> Option<Duration> {
238238
let mut secs = try_opt!(self.secs.checked_add(rhs.secs));
@@ -247,7 +247,7 @@ impl Duration {
247247
if d < MIN || d > MAX { None } else { Some(d) }
248248
}
249249

250-
/// Subtract two durations, returning `None` if overflow occured.
250+
/// Subtract two durations, returning `None` if overflow occurred.
251251
#[unstable(feature = "std_misc")]
252252
pub fn checked_sub(&self, rhs: &Duration) -> Option<Duration> {
253253
let mut secs = try_opt!(self.secs.checked_sub(rhs.secs));

src/libsyntax/feature_gate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
109109
// int and uint are now deprecated
110110
("int_uint", "1.0.0", Active),
111111

112-
// macro reexport needs more discusion and stabilization
112+
// macro reexport needs more discussion and stabilization
113113
("macro_reexport", "1.0.0", Active),
114114

115115
// These are used to test this portion of the compiler, they don't actually

src/libsyntax/parse/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ fn filtered_float_lit(data: token::InternedString, suffix: Option<&str>,
560560
}
561561
pub fn float_lit(s: &str, suffix: Option<&str>, sd: &SpanHandler, sp: Span) -> ast::Lit_ {
562562
debug!("float_lit: {:?}, {:?}", s, suffix);
563-
// FIXME #2252: bounds checking float literals is defered until trans
563+
// FIXME #2252: bounds checking float literals is deferred until trans
564564
let s = s.chars().filter(|&c| c != '_').collect::<String>();
565565
let data = token::intern_and_get_ident(&*s);
566566
filtered_float_lit(data, suffix, sd, sp)

src/rustbook/javascript.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
4343
// of each of the sections.
4444
// It works by extracting the current page based on the url and iterates over
4545
// the menu links until it finds the menu item for the current page. We then
46-
// create a copy of the preceeding and following menu links and add the
46+
// create a copy of the preceding and following menu links and add the
4747
// correct css class and insert them into the bottom of the page.
4848
var toc = document.getElementById('toc').getElementsByTagName('a');
4949
var href = document.location.pathname.split('/').pop();

0 commit comments

Comments
 (0)