Skip to content

Commit 539df81

Browse files
Fix some doc/comment typos.
1 parent 3cf2c04 commit 539df81

File tree

14 files changed

+28
-28
lines changed

14 files changed

+28
-28
lines changed

src/libcore/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ macro_rules! generate_pattern_iterators {
847847
internal:
848848
$internal_iterator:ident yielding ($iterty:ty);
849849

850-
// Kind of delgation - either single ended or double ended
850+
// Kind of delegation - either single ended or double ended
851851
delegate $($t:tt)*
852852
} => {
853853
$(#[$forward_iterator_attribute])*

src/libcore/str/pattern.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub enum SearchStep {
8383
/// Note that there might be more than one `Reject` between two `Match`es,
8484
/// there is no requirement for them to be combined into one.
8585
Reject(usize, usize),
86-
/// Expresses that every byte of the haystack has been visted, ending
86+
/// Expresses that every byte of the haystack has been visited, ending
8787
/// the iteration.
8888
Done
8989
}
@@ -101,7 +101,7 @@ pub enum SearchStep {
101101
/// the haystack. This enables consumers of this trait to
102102
/// slice the haystack without additional runtime checks.
103103
pub unsafe trait Searcher<'a> {
104-
/// Getter for the underlaying string to be searched in
104+
/// Getter for the underlying string to be searched in
105105
///
106106
/// Will always return the same `&str`
107107
fn haystack(&self) -> &'a str;
@@ -1153,7 +1153,7 @@ impl TwoWaySearcher {
11531153
// The maximal suffix is a possible critical factorization (u', v') of `arr`.
11541154
//
11551155
// Returns `i` where `i` is the starting index of v', from the back;
1156-
// returns immedately when a period of `known_period` is reached.
1156+
// returns immediately when a period of `known_period` is reached.
11571157
//
11581158
// `order_greater` determines if lexical order is `<` or `>`. Both
11591159
// orders must be computed -- the ordering with the largest `i` gives

src/librustc/traits/specialize/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ pub fn translate_substs<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
8888
// vary across impls
8989
let target_substs = match target_node {
9090
specialization_graph::Node::Impl(target_impl) => {
91-
// no need to translate if we're targetting the impl we started with
91+
// no need to translate if we're targeting the impl we started with
9292
if source_impl == target_impl {
9393
return source_substs;
9494
}
9595

9696
fulfill_implication(infcx, param_env, source_trait_ref, target_impl)
9797
.unwrap_or_else(|_| {
9898
bug!("When translating substitutions for specialization, the expected \
99-
specializaiton failed to hold")
99+
specialization failed to hold")
100100
})
101101
}
102102
specialization_graph::Node::Trait(..) => source_trait_ref.substs,
@@ -107,7 +107,7 @@ pub fn translate_substs<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
107107
}
108108

109109
/// Given a selected impl described by `impl_data`, returns the
110-
/// definition and substitions for the method with the name `name`
110+
/// definition and substitutions for the method with the name `name`
111111
/// the kind `kind`, and trait method substitutions `substs`, in
112112
/// that impl, a less specialized impl, or the trait default,
113113
/// whichever applies.
@@ -305,7 +305,7 @@ pub(super) fn specialization_graph_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx
305305
// The coherence checking implementation seems to rely on impls being
306306
// iterated over (roughly) in definition order, so we are sorting by
307307
// negated CrateNum (so remote definitions are visited first) and then
308-
// by a flattend version of the DefIndex.
308+
// by a flattened version of the DefIndex.
309309
trait_impls.sort_unstable_by_key(|def_id| {
310310
(-(def_id.krate.as_u32() as i64),
311311
def_id.index.address_space().index(),

src/librustc_data_structures/obligation_forest/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ enum NodeState {
117117
/// non-ambiguous result.
118118
Pending,
119119

120-
/// This obligation was selected successfuly, but may or
120+
/// This obligation was selected successfully, but may or
121121
/// may not have subobligations.
122122
Success,
123123

124-
/// This obligation was selected sucessfully, but it has
124+
/// This obligation was selected successfully, but it has
125125
/// a pending subobligation.
126126
Waiting,
127127

src/librustc_mir/dataflow/move_paths/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
259259
/// NOTE: lvalues behind references *do not* get a move path, which is
260260
/// problematic for borrowck.
261261
///
262-
/// Maybe we should have seperate "borrowck" and "moveck" modes.
262+
/// Maybe we should have separate "borrowck" and "moveck" modes.
263263
fn move_path_for(&mut self, lval: &Lvalue<'tcx>)
264264
-> Result<MovePathIndex, MovePathError>
265265
{

src/librustc_trans/partitioning.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub fn partition<'a, 'tcx, I>(scx: &SharedCrateContext<'a, 'tcx>,
251251
exported_symbols,
252252
trans_items);
253253

254-
debug_dump(tcx, "INITIAL PARTITONING:", initial_partitioning.codegen_units.iter());
254+
debug_dump(tcx, "INITIAL PARTITIONING:", initial_partitioning.codegen_units.iter());
255255

256256
// If the partitioning should produce a fixed count of codegen units, merge
257257
// until that count is reached.
@@ -261,7 +261,7 @@ pub fn partition<'a, 'tcx, I>(scx: &SharedCrateContext<'a, 'tcx>,
261261
debug_dump(tcx, "POST MERGING:", initial_partitioning.codegen_units.iter());
262262
}
263263

264-
// In the next step, we use the inlining map to determine which addtional
264+
// In the next step, we use the inlining map to determine which additional
265265
// translation items have to go into each codegen unit. These additional
266266
// translation items can be drop-glue, functions from external crates, and
267267
// local functions the definition of which is marked with #[inline].

src/libserialize/serialize.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,15 @@ pub trait SpecializationError {
729729
/// `S` is the encoder/decoder state type,
730730
/// `T` is the type being encoded/decoded, and
731731
/// the arguments are the names of the trait
732-
/// and method that should've been overriden.
732+
/// and method that should've been overridden.
733733
fn not_found<S, T: ?Sized>(trait_name: &'static str,
734734
method_name: &'static str) -> Self;
735735
}
736736

737737
impl<E> SpecializationError for E {
738738
default fn not_found<S, T: ?Sized>(trait_name: &'static str,
739739
method_name: &'static str) -> E {
740-
panic!("missing specializaiton: `<{} as {}<{}>>::{}` not overriden",
740+
panic!("missing specialization: `<{} as {}<{}>>::{}` not overridden",
741741
unsafe { intrinsics::type_name::<S>() },
742742
trait_name,
743743
unsafe { intrinsics::type_name::<T>() },

src/libstd/collections/hash/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ const DISPLACEMENT_THRESHOLD: usize = 128;
203203
// so we round that up to 128.
204204
//
205205
// At a load factor of α, the odds of finding the target bucket after exactly n
206-
// unsuccesful probes[1] are
206+
// unsuccessful probes[1] are
207207
//
208208
// Pr_α{displacement = n} =
209209
// (1 - α) / α * ∑_{k≥1} e^(-kα) * (kα)^(k+n) / (k + n)! * (1 - kα / (k + n + 1))

src/libstd/path.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ impl<'a> Hash for PrefixComponent<'a> {
476476

477477
/// A single component of a path.
478478
///
479-
/// A `Component` roughtly corresponds to a substring between path separators
479+
/// A `Component` roughly corresponds to a substring between path separators
480480
/// (`/` or `\`).
481481
///
482482
/// This `enum` is created by iterating over [`Components`], which in turn is
@@ -571,7 +571,7 @@ impl<'a> AsRef<OsStr> for Component<'a> {
571571
}
572572
}
573573

574-
/// An interator over the [`Component`]s of a [`Path`].
574+
/// An iterator over the [`Component`]s of a [`Path`].
575575
///
576576
/// This `struct` is created by the [`components`] method on [`Path`].
577577
/// See its documentation for more.
@@ -2019,7 +2019,7 @@ impl Path {
20192019
/// * Repeated separators are ignored, so `a/b` and `a//b` both have
20202020
/// `a` and `b` as components.
20212021
///
2022-
/// * Occurences of `.` are normalized away, except if they are at the
2022+
/// * Occurrences of `.` are normalized away, except if they are at the
20232023
/// beginning of the path. For example, `a/./b`, `a/b/`, `a/b/.` and
20242024
/// `a/b` all have `a` and `b` as components, but `./a/b` starts with
20252025
/// an additional [`CurDir`] component.

src/libstd/thread/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub use self::local::{LocalKey, LocalKeyState, AccessError};
190190
/// - [`name`]: allows to give a name to the thread which is currently
191191
/// only used in `panic` messages.
192192
/// - [`stack_size`]: specifies the desired stack size. Note that this can
193-
/// be overriden by the OS.
193+
/// be overridden by the OS.
194194
///
195195
/// If the [`stack_size`] field is not specified, the stack size
196196
/// will be the `RUST_MIN_STACK` environment variable. If it is
@@ -529,7 +529,7 @@ pub fn current() -> Thread {
529529
/// Thus the pattern of `yield`ing after a failed poll is rather common when
530530
/// implementing low-level shared resources or synchronization primitives.
531531
///
532-
/// However programmers will usualy prefer to use, [`channel`]s, [`Condvar`]s,
532+
/// However programmers will usually prefer to use, [`channel`]s, [`Condvar`]s,
533533
/// [`Mutex`]es or [`join`] for their synchronisation routines, as they avoid
534534
/// thinking about thread schedulling.
535535
///
@@ -770,7 +770,7 @@ pub fn park_timeout_ms(ms: u32) {
770770
/// preemption or platform differences that may not cause the maximum
771771
/// amount of time waited to be precisely `dur` long.
772772
///
773-
/// See the [park dococumentation][park] for more details.
773+
/// See the [park documentation][park] for more details.
774774
///
775775
/// # Platform behavior
776776
///
@@ -891,7 +891,7 @@ struct Inner {
891891
/// The [`thread::current`] function is available even for threads not spawned
892892
/// by the APIs of this module.
893893
///
894-
/// There is usualy no need to create a `Thread` struct yourself, one
894+
/// There is usually no need to create a `Thread` struct yourself, one
895895
/// should instead use a function like `spawn` to create new threads, see the
896896
/// docs of [`Builder`] and [`spawn`] for more details.
897897
///

src/libsyntax_pos/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl MultiSpan {
312312
&self.primary_spans
313313
}
314314

315-
/// Replaces all occurances of one Span with another. Used to move Spans in areas that don't
315+
/// Replaces all occurrences of one Span with another. Used to move Spans in areas that don't
316316
/// display well (like std macros). Returns true if replacements occurred.
317317
pub fn replace(&mut self, before: Span, after: Span) -> bool {
318318
let mut replacements_occurred = false;

src/test/parse-fail/default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// compile-flags: -Z parse-only
1212

13-
// Test successful and unsucessful parsing of the `default` contextual keyword
13+
// Test successful and unsuccessful parsing of the `default` contextual keyword
1414

1515
trait Foo {
1616
fn foo<T: Default>() -> T;

src/test/run-pass/backtrace-debuginfo-aux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn callback<F>(f: F) where F: FnOnce((&'static str, u32)) {
1616
}
1717

1818
// LLVM does not yet output the required debug info to support showing inlined
19-
// function calls in backtraces when targetting MSVC, so disable inlining in
19+
// function calls in backtraces when targeting MSVC, so disable inlining in
2020
// this case.
2121
#[cfg_attr(not(target_env = "msvc"), inline(always))]
2222
#[cfg_attr(target_env = "msvc", inline(never))]

src/test/run-pass/backtrace-debuginfo.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// We disable tail merging here because it can't preserve debuginfo and thus
1212
// potentially breaks the backtraces. Also, subtle changes can decide whether
13-
// tail merging suceeds, so the test might work today but fail tomorrow due to a
13+
// tail merging succeeds, so the test might work today but fail tomorrow due to a
1414
// seemingly completely unrelated change.
1515
// Unfortunately, LLVM has no "disable" option for this, so we have to set
1616
// "enable" to 0 instead.
@@ -88,7 +88,7 @@ fn inner(counter: &mut i32, main_pos: Pos, outer_pos: Pos) {
8888
}
8989

9090
// LLVM does not yet output the required debug info to support showing inlined
91-
// function calls in backtraces when targetting MSVC, so disable inlining in
91+
// function calls in backtraces when targeting MSVC, so disable inlining in
9292
// this case.
9393
#[cfg_attr(not(target_env = "msvc"), inline(always))]
9494
#[cfg_attr(target_env = "msvc", inline(never))]

0 commit comments

Comments
 (0)