mirror of https://github.com/rust-lang/rust.git
Fix some doc/comment typos.
This commit is contained in:
parent
3cf2c04c79
commit
539df8121b
|
@ -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])*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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,
|
||||
|
||||
|
|
|
@ -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>
|
||||
{
|
||||
|
|
|
@ -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].
|
||||
|
|
|
@ -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<S, T: ?Sized>(trait_name: &'static str,
|
||||
method_name: &'static str) -> Self;
|
||||
}
|
||||
|
@ -737,7 +737,7 @@ pub trait SpecializationError {
|
|||
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>() },
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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<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.
|
||||
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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))]
|
||||
|
|
|
@ -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))]
|
||||
|
|
Loading…
Reference in New Issue