Skip to content

Commit

Permalink
Fix some doc/comment typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Jul 23, 2017
1 parent 3cf2c04 commit 539df81
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/libcore/str/mod.rs
Expand Up @@ -847,7 +847,7 @@ macro_rules! generate_pattern_iterators {
internal:
$internal_iterator:ident yielding ($iterty:ty);

// Kind of delgation - either single ended or double ended
// Kind of delegation - either single ended or double ended
delegate $($t:tt)*
} => {
$(#[$forward_iterator_attribute])*
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/str/pattern.rs
Expand Up @@ -83,7 +83,7 @@ pub enum SearchStep {
/// Note that there might be more than one `Reject` between two `Match`es,
/// there is no requirement for them to be combined into one.
Reject(usize, usize),
/// Expresses that every byte of the haystack has been visted, ending
/// Expresses that every byte of the haystack has been visited, ending
/// the iteration.
Done
}
Expand All @@ -101,7 +101,7 @@ pub enum SearchStep {
/// the haystack. This enables consumers of this trait to
/// slice the haystack without additional runtime checks.
pub unsafe trait Searcher<'a> {
/// Getter for the underlaying string to be searched in
/// Getter for the underlying string to be searched in
///
/// Will always return the same `&str`
fn haystack(&self) -> &'a str;
Expand Down Expand Up @@ -1153,7 +1153,7 @@ impl TwoWaySearcher {
// The maximal suffix is a possible critical factorization (u', v') of `arr`.
//
// Returns `i` where `i` is the starting index of v', from the back;
// returns immedately when a period of `known_period` is reached.
// returns immediately when a period of `known_period` is reached.
//
// `order_greater` determines if lexical order is `<` or `>`. Both
// orders must be computed -- the ordering with the largest `i` gives
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/traits/specialize/mod.rs
Expand Up @@ -88,15 +88,15 @@ pub fn translate_substs<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
// vary across impls
let target_substs = match target_node {
specialization_graph::Node::Impl(target_impl) => {
// no need to translate if we're targetting the impl we started with
// no need to translate if we're targeting the impl we started with
if source_impl == target_impl {
return source_substs;
}

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

/// Given a selected impl described by `impl_data`, returns the
/// definition and substitions for the method with the name `name`
/// definition and substitutions for the method with the name `name`
/// the kind `kind`, and trait method substitutions `substs`, in
/// that impl, a less specialized impl, or the trait default,
/// whichever applies.
Expand Down Expand Up @@ -305,7 +305,7 @@ pub(super) fn specialization_graph_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx
// The coherence checking implementation seems to rely on impls being
// iterated over (roughly) in definition order, so we are sorting by
// negated CrateNum (so remote definitions are visited first) and then
// by a flattend version of the DefIndex.
// by a flattened version of the DefIndex.
trait_impls.sort_unstable_by_key(|def_id| {
(-(def_id.krate.as_u32() as i64),
def_id.index.address_space().index(),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_data_structures/obligation_forest/mod.rs
Expand Up @@ -117,11 +117,11 @@ enum NodeState {
/// non-ambiguous result.
Pending,

/// This obligation was selected successfuly, but may or
/// This obligation was selected successfully, but may or
/// may not have subobligations.
Success,

/// This obligation was selected sucessfully, but it has
/// This obligation was selected successfully, but it has
/// a pending subobligation.
Waiting,

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/dataflow/move_paths/mod.rs
Expand Up @@ -259,7 +259,7 @@ impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
/// NOTE: lvalues behind references *do not* get a move path, which is
/// problematic for borrowck.
///
/// Maybe we should have seperate "borrowck" and "moveck" modes.
/// Maybe we should have separate "borrowck" and "moveck" modes.
fn move_path_for(&mut self, lval: &Lvalue<'tcx>)
-> Result<MovePathIndex, MovePathError>
{
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_trans/partitioning.rs
Expand Up @@ -251,7 +251,7 @@ pub fn partition<'a, 'tcx, I>(scx: &SharedCrateContext<'a, 'tcx>,
exported_symbols,
trans_items);

debug_dump(tcx, "INITIAL PARTITONING:", initial_partitioning.codegen_units.iter());
debug_dump(tcx, "INITIAL PARTITIONING:", initial_partitioning.codegen_units.iter());

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

// In the next step, we use the inlining map to determine which addtional
// In the next step, we use the inlining map to determine which additional
// translation items have to go into each codegen unit. These additional
// translation items can be drop-glue, functions from external crates, and
// local functions the definition of which is marked with #[inline].
Expand Down
4 changes: 2 additions & 2 deletions src/libserialize/serialize.rs
Expand Up @@ -729,15 +729,15 @@ pub trait SpecializationError {
/// `S` is the encoder/decoder state type,
/// `T` is the type being encoded/decoded, and
/// the arguments are the names of the trait
/// and method that should've been overriden.
/// and method that should've been overridden.
fn not_found<S, T: ?Sized>(trait_name: &'static str,
method_name: &'static str) -> Self;
}

impl<E> SpecializationError for E {
default fn not_found<S, T: ?Sized>(trait_name: &'static str,
method_name: &'static str) -> E {
panic!("missing specializaiton: `<{} as {}<{}>>::{}` not overriden",
panic!("missing specialization: `<{} as {}<{}>>::{}` not overridden",
unsafe { intrinsics::type_name::<S>() },
trait_name,
unsafe { intrinsics::type_name::<T>() },
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/collections/hash/map.rs
Expand Up @@ -203,7 +203,7 @@ const DISPLACEMENT_THRESHOLD: usize = 128;
// so we round that up to 128.
//
// At a load factor of α, the odds of finding the target bucket after exactly n
// unsuccesful probes[1] are
// unsuccessful probes[1] are
//
// Pr_α{displacement = n} =
// (1 - α) / α * ∑_{k≥1} e^(-kα) * (kα)^(k+n) / (k + n)! * (1 - kα / (k + n + 1))
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/path.rs
Expand Up @@ -476,7 +476,7 @@ impl<'a> Hash for PrefixComponent<'a> {

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

/// An interator over the [`Component`]s of a [`Path`].
/// An iterator over the [`Component`]s of a [`Path`].
///
/// This `struct` is created by the [`components`] method on [`Path`].
/// See its documentation for more.
Expand Down Expand Up @@ -2019,7 +2019,7 @@ impl Path {
/// * Repeated separators are ignored, so `a/b` and `a//b` both have
/// `a` and `b` as components.
///
/// * Occurences of `.` are normalized away, except if they are at the
/// * Occurrences of `.` are normalized away, except if they are at the
/// beginning of the path. For example, `a/./b`, `a/b/`, `a/b/.` and
/// `a/b` all have `a` and `b` as components, but `./a/b` starts with
/// an additional [`CurDir`] component.
Expand Down
8 changes: 4 additions & 4 deletions src/libstd/thread/mod.rs
Expand Up @@ -190,7 +190,7 @@ pub use self::local::{LocalKey, LocalKeyState, AccessError};
/// - [`name`]: allows to give a name to the thread which is currently
/// only used in `panic` messages.
/// - [`stack_size`]: specifies the desired stack size. Note that this can
/// be overriden by the OS.
/// be overridden by the OS.
///
/// If the [`stack_size`] field is not specified, the stack size
/// will be the `RUST_MIN_STACK` environment variable. If it is
Expand Down Expand Up @@ -529,7 +529,7 @@ pub fn current() -> Thread {
/// Thus the pattern of `yield`ing after a failed poll is rather common when
/// implementing low-level shared resources or synchronization primitives.
///
/// However programmers will usualy prefer to use, [`channel`]s, [`Condvar`]s,
/// However programmers will usually prefer to use, [`channel`]s, [`Condvar`]s,
/// [`Mutex`]es or [`join`] for their synchronisation routines, as they avoid
/// thinking about thread schedulling.
///
Expand Down Expand Up @@ -770,7 +770,7 @@ pub fn park_timeout_ms(ms: u32) {
/// preemption or platform differences that may not cause the maximum
/// amount of time waited to be precisely `dur` long.
///
/// See the [park dococumentation][park] for more details.
/// See the [park documentation][park] for more details.
///
/// # Platform behavior
///
Expand Down Expand Up @@ -891,7 +891,7 @@ struct Inner {
/// The [`thread::current`] function is available even for threads not spawned
/// by the APIs of this module.
///
/// There is usualy no need to create a `Thread` struct yourself, one
/// There is usually no need to create a `Thread` struct yourself, one
/// should instead use a function like `spawn` to create new threads, see the
/// docs of [`Builder`] and [`spawn`] for more details.
///
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax_pos/lib.rs
Expand Up @@ -312,7 +312,7 @@ impl MultiSpan {
&self.primary_spans
}

/// Replaces all occurances of one Span with another. Used to move Spans in areas that don't
/// Replaces all occurrences of one Span with another. Used to move Spans in areas that don't
/// display well (like std macros). Returns true if replacements occurred.
pub fn replace(&mut self, before: Span, after: Span) -> bool {
let mut replacements_occurred = false;
Expand Down
2 changes: 1 addition & 1 deletion src/test/parse-fail/default.rs
Expand Up @@ -10,7 +10,7 @@

// compile-flags: -Z parse-only

// Test successful and unsucessful parsing of the `default` contextual keyword
// Test successful and unsuccessful parsing of the `default` contextual keyword

trait Foo {
fn foo<T: Default>() -> T;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/backtrace-debuginfo-aux.rs
Expand Up @@ -16,7 +16,7 @@ pub fn callback<F>(f: F) where F: FnOnce((&'static str, u32)) {
}

// LLVM does not yet output the required debug info to support showing inlined
// function calls in backtraces when targetting MSVC, so disable inlining in
// function calls in backtraces when targeting MSVC, so disable inlining in
// this case.
#[cfg_attr(not(target_env = "msvc"), inline(always))]
#[cfg_attr(target_env = "msvc", inline(never))]
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/backtrace-debuginfo.rs
Expand Up @@ -10,7 +10,7 @@

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

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

0 comments on commit 539df81

Please sign in to comment.