From 539df8121bf799526bcb36a1613ac3fd3e255a61 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sun, 23 Jul 2017 22:06:16 +0700 Subject: [PATCH] Fix some doc/comment typos. --- src/libcore/str/mod.rs | 2 +- src/libcore/str/pattern.rs | 6 +++--- src/librustc/traits/specialize/mod.rs | 8 ++++---- src/librustc_data_structures/obligation_forest/mod.rs | 4 ++-- src/librustc_mir/dataflow/move_paths/mod.rs | 2 +- src/librustc_trans/partitioning.rs | 4 ++-- src/libserialize/serialize.rs | 4 ++-- src/libstd/collections/hash/map.rs | 2 +- src/libstd/path.rs | 6 +++--- src/libstd/thread/mod.rs | 8 ++++---- src/libsyntax_pos/lib.rs | 2 +- src/test/parse-fail/default.rs | 2 +- src/test/run-pass/backtrace-debuginfo-aux.rs | 2 +- src/test/run-pass/backtrace-debuginfo.rs | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 1df69a1b598e4..95b27751a6aaf 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -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])* diff --git a/src/libcore/str/pattern.rs b/src/libcore/str/pattern.rs index 3c9c1d6cab479..c4ff95b1d6a49 100644 --- a/src/libcore/str/pattern.rs +++ b/src/libcore/str/pattern.rs @@ -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 } @@ -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; @@ -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 diff --git a/src/librustc/traits/specialize/mod.rs b/src/librustc/traits/specialize/mod.rs index 18734e2dbc3f1..46e5510296652 100644 --- a/src/librustc/traits/specialize/mod.rs +++ b/src/librustc/traits/specialize/mod.rs @@ -88,7 +88,7 @@ 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; } @@ -96,7 +96,7 @@ pub fn translate_substs<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>, 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, @@ -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. @@ -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(), diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs index 3515e5c5ede35..6e70944ce642f 100644 --- a/src/librustc_data_structures/obligation_forest/mod.rs +++ b/src/librustc_data_structures/obligation_forest/mod.rs @@ -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, diff --git a/src/librustc_mir/dataflow/move_paths/mod.rs b/src/librustc_mir/dataflow/move_paths/mod.rs index d7ed0938e886a..648c376de1cdb 100644 --- a/src/librustc_mir/dataflow/move_paths/mod.rs +++ b/src/librustc_mir/dataflow/move_paths/mod.rs @@ -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 { diff --git a/src/librustc_trans/partitioning.rs b/src/librustc_trans/partitioning.rs index 7518948323b8b..904cfb2acd741 100644 --- a/src/librustc_trans/partitioning.rs +++ b/src/librustc_trans/partitioning.rs @@ -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. @@ -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]. diff --git a/src/libserialize/serialize.rs b/src/libserialize/serialize.rs index c6847249803e3..6d67bbc06cc1b 100644 --- a/src/libserialize/serialize.rs +++ b/src/libserialize/serialize.rs @@ -729,7 +729,7 @@ 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(trait_name: &'static str, method_name: &'static str) -> Self; } @@ -737,7 +737,7 @@ pub trait SpecializationError { impl SpecializationError for E { default fn not_found(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::() }, trait_name, unsafe { intrinsics::type_name::() }, diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 746e18047f945..12241b3f88187 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -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)) diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 432605cf3b25b..619d079542142 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -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 @@ -571,7 +571,7 @@ impl<'a> AsRef 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. @@ -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. diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 07a3a01ce8666..c35676f2709cc 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -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 @@ -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. /// @@ -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 /// @@ -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. /// diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index ad5f3845e2be7..820adc60999a4 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -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; diff --git a/src/test/parse-fail/default.rs b/src/test/parse-fail/default.rs index d18401e67646c..6c3bc45d34aa4 100644 --- a/src/test/parse-fail/default.rs +++ b/src/test/parse-fail/default.rs @@ -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; diff --git a/src/test/run-pass/backtrace-debuginfo-aux.rs b/src/test/run-pass/backtrace-debuginfo-aux.rs index 48df600214ad0..1236acf351121 100644 --- a/src/test/run-pass/backtrace-debuginfo-aux.rs +++ b/src/test/run-pass/backtrace-debuginfo-aux.rs @@ -16,7 +16,7 @@ pub fn callback(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))] diff --git a/src/test/run-pass/backtrace-debuginfo.rs b/src/test/run-pass/backtrace-debuginfo.rs index 88fee9ed25b8d..b2ab25c44b82a 100644 --- a/src/test/run-pass/backtrace-debuginfo.rs +++ b/src/test/run-pass/backtrace-debuginfo.rs @@ -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. @@ -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))]