Skip to content

Commit

Permalink
Rollup merge of rust-lang#55901 - euclio:speling, r=petrochenkov
Browse files Browse the repository at this point in the history
fix various typos in doc comments
  • Loading branch information
pietroalbini authored Nov 15, 2018
2 parents fb45532 + 4e35cbb commit 66fcb3c
Show file tree
Hide file tree
Showing 48 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/liballoc/collections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct LeafNode<K, V> {

/// This node's index into the parent node's `edges` array.
/// `*node.parent.edges[node.parent_idx]` should be the same thing as `node`.
/// This is only guaranteed to be initialized when `parent` is nonnull.
/// This is only guaranteed to be initialized when `parent` is non-null.
parent_idx: MaybeUninit<u16>,

/// The number of keys and values this node stores.
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use boxed::Box;
/// This enables you to use capacity growing logic catch the overflows in your length
/// that might occur with zero-sized types.
///
/// However this means that you need to be careful when roundtripping this type
/// However this means that you need to be careful when round-tripping this type
/// with a `Box<[T]>`: `cap()` won't yield the len. However `with_capacity`,
/// `shrink_to_fit`, and `from_box` will actually set RawVec's private capacity
/// field. This allows zero-sized types to not be special-cased by consumers of
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ impl f32 {
/// signaling NaNs on MIPS are quiet NaNs on x86, and vice-versa.
///
/// Rather than trying to preserve signaling-ness cross-platform, this
/// implementation favours preserving the exact bits. This means that
/// implementation favors preserving the exact bits. This means that
/// any payloads encoded in NaNs will be preserved even if the result of
/// this method is sent over the network from an x86 machine to a MIPS one.
///
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/task/wake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl Drop for Waker {
/// is ready to be run.
///
/// This is similar to the `Waker` type, but cannot be sent across threads.
/// Task executors can use this type to implement more optimized singlethreaded wakeup
/// Task executors can use this type to implement more optimized single-threaded wakeup
/// behavior.
#[repr(transparent)]
#[derive(Clone)]
Expand Down
12 changes: 6 additions & 6 deletions src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ impl TokenTree {
}
}

/// Prints token treee in a form convenient for debugging.
/// Prints token tree in a form convenient for debugging.
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
impl fmt::Debug for TokenTree {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -730,7 +730,7 @@ impl fmt::Debug for Group {

/// An `Punct` is an single punctuation character like `+`, `-` or `#`.
///
/// Multicharacter operators like `+=` are represented as two instances of `Punct` with different
/// Multi-character operators like `+=` are represented as two instances of `Punct` with different
/// forms of `Spacing` returned.
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
#[derive(Clone)]
Expand Down Expand Up @@ -788,7 +788,7 @@ impl Punct {

/// Returns the spacing of this punctuation character, indicating whether it's immediately
/// followed by another `Punct` in the token stream, so they can potentially be combined into
/// a multicharacter operator (`Joint`), or it's followed by some other token or whitespace
/// a multi-character operator (`Joint`), or it's followed by some other token or whitespace
/// (`Alone`) so the operator has certainly ended.
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
pub fn spacing(&self) -> Spacing {
Expand Down Expand Up @@ -947,7 +947,7 @@ macro_rules! suffixed_int_literals {
/// This function will create an integer like `1u32` where the integer
/// value specified is the first part of the token and the integral is
/// also suffixed at the end.
/// Literals created from negative numbers may not survive rountrips through
/// Literals created from negative numbers may not survive round-trips through
/// `TokenStream` or strings and may be broken into two tokens (`-` and positive literal).
///
/// Literals created through this method have the `Span::call_site()`
Expand Down Expand Up @@ -1047,7 +1047,7 @@ impl Literal {

/// Creates a new suffixed floating-point literal.
///
/// This consturctor will create a literal like `1.0f32` where the value
/// This constructor will create a literal like `1.0f32` where the value
/// specified is the preceding part of the token and `f32` is the suffix of
/// the token. This token will always be inferred to be an `f32` in the
/// compiler.
Expand Down Expand Up @@ -1096,7 +1096,7 @@ impl Literal {

/// Creates a new suffixed floating-point literal.
///
/// This consturctor will create a literal like `1.0f64` where the value
/// This constructor will create a literal like `1.0f64` where the value
/// specified is the preceding part of the token and `f64` is the suffix of
/// the token. This token will always be inferred to be an `f64` in the
/// compiler.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/dep_graph/cgu_reuse_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

//! Some facilities for tracking how codegen-units are reused during incremental
//! compilition. This is used for incremental compiliation tests and debug
//! compilation. This is used for incremental compilation tests and debug
//! output.

use session::Session;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub enum NonMacroAttrKind {
Tool,
/// Single-segment custom attribute registered by a derive macro (`#[serde(default)]`).
DeriveHelper,
/// Single-segment custom attriubte registered by a legacy plugin (`register_attribute`).
/// Single-segment custom attribute registered by a legacy plugin (`register_attribute`).
LegacyPluginHelper,
/// Single-segment custom attribute not registered in any way (`#[my_attr]`).
Custom,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/canonical/canonicalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

//! This module contains the "canonicalizer" itself.
//!
//! For an overview of what canonicaliation is and how it fits into
//! For an overview of what canonicalization is and how it fits into
//! rustc, check out the [chapter in the rustc guide][c].
//!
//! [c]: https://rust-lang-nursery.github.io/rustc-guide/traits/canonicalization.html
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/canonical/query_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
}

/// Given two sets of values for the same set of canonical variables, unify them.
/// The second set is produced lazilly by supplying indices from the first set.
/// The second set is produced lazily by supplying indices from the first set.
fn unify_canonical_vars(
&self,
cause: &ObligationCause<'tcx>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/canonical/substitute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! This module contains code to substitute new values into a
//! `Canonical<'tcx, T>`.
//!
//! For an overview of what canonicaliation is and how it fits into
//! For an overview of what canonicalization is and how it fits into
//! rustc, check out the [chapter in the rustc guide][c].
//!
//! [c]: https://rust-lang-nursery.github.io/rustc-guide/traits/canonicalization.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use util::common::ErrorReported;
use infer::lexical_region_resolve::RegionResolutionError::SubSupConflict;

impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
/// Print the error message for lifetime errors when binding excapes a closure.
/// Print the error message for lifetime errors when binding escapes a closure.
///
/// Consider a case where we have
///
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/higher_ranked/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
///
/// This routine is only intended to be used when the leak-check has
/// passed; currently, it's used in the trait matching code to create
/// a set of nested obligations frmo an impl that matches against
/// a set of nested obligations from an impl that matches against
/// something higher-ranked. More details can be found in
/// `librustc/middle/traits/README.md`.
///
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,10 +1160,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
}

/// Takes ownership of the list of variable regions. This implies
/// that all the region constriants have already been taken, and
/// that all the region constraints have already been taken, and
/// hence that `resolve_regions_and_report_errors` can never be
/// called. This is used only during NLL processing to "hand off" ownership
/// of the set of region vairables into the NLL region context.
/// of the set of region variables into the NLL region context.
pub fn take_region_var_origins(&self) -> VarInfos {
let (var_infos, data) = self.region_constraints
.borrow_mut()
Expand Down Expand Up @@ -1478,7 +1478,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
}

/// Clears the selection, evaluation, and projection caches. This is useful when
/// repeatedly attemping to select an Obligation while changing only
/// repeatedly attempting to select an Obligation while changing only
/// its ParamEnv, since FulfillmentContext doesn't use 'probe'
pub fn clear_caches(&self) {
self.selection_cache.clear();
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/type_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
/// but which have only been unified since `s` started, and
/// return the types with which they were unified. So if we had
/// a type variable `V0`, then we started the snapshot, then we
/// created a type variable `V1`, unifed `V0` with `T0`, and
/// created a type variable `V1`, unified `V0` with `T0`, and
/// unified `V1` with `T1`, this function would return `{T0}`.
pub fn types_escaping_snapshot(&mut self, s: &Snapshot<'tcx>) -> Vec<Ty<'tcx>> {
let mut new_elem_threshold = u32::MAX;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl<'a> LintLevelsBuilder<'a> {
/// This function will perform a number of tasks:
///
/// * It'll validate all lint-related attributes in `attrs`
/// * It'll mark all lint-related attriutes as used
/// * It'll mark all lint-related attributes as used
/// * Lint levels will be updated based on the attributes provided
/// * Lint attributes are validated, e.g. a #[forbid] can't be switched to
/// #[allow]
Expand Down
12 changes: 6 additions & 6 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl Default for ErrorOutputType {

// Use tree-based collections to cheaply get a deterministic Hash implementation.
// DO NOT switch BTreeMap out for an unsorted container type! That would break
// dependency tracking for commandline arguments.
// dependency tracking for command-line arguments.
#[derive(Clone, Hash)]
pub struct OutputTypes(BTreeMap<OutputType, Option<PathBuf>>);

Expand Down Expand Up @@ -273,7 +273,7 @@ impl OutputTypes {

// Use tree-based collections to cheaply get a deterministic Hash implementation.
// DO NOT switch BTreeMap or BTreeSet out for an unsorted container type! That
// would break dependency tracking for commandline arguments.
// would break dependency tracking for command-line arguments.
#[derive(Clone, Hash)]
pub struct Externs(BTreeMap<String, BTreeSet<Option<String>>>);

Expand Down Expand Up @@ -339,7 +339,7 @@ macro_rules! top_level_options {
);
}

// The top-level commandline options struct
// The top-level command-line options struct
//
// For each option, one has to specify how it behaves with regard to the
// dependency tracking system of incremental compilation. This is done via the
Expand Down Expand Up @@ -2377,11 +2377,11 @@ impl fmt::Display for CrateType {
}
}

/// Commandline arguments passed to the compiler have to be incorporated with
/// Command-line arguments passed to the compiler have to be incorporated with
/// the dependency tracking system for incremental compilation. This module
/// provides some utilities to make this more convenient.
///
/// The values of all commandline arguments that are relevant for dependency
/// The values of all command-line arguments that are relevant for dependency
/// tracking are hashed into a single value that determines whether the
/// incremental compilation cache can be re-used or not. This hashing is done
/// via the DepTrackingHash trait defined below, since the standard Hash
Expand All @@ -2394,7 +2394,7 @@ impl fmt::Display for CrateType {
/// impl_dep_tracking_hash_via_hash!() macro that allows to simply reuse the
/// Hash implementation for DepTrackingHash. It's important though that
/// we have an opt-in scheme here, so one is hopefully forced to think about
/// how the hash should be calculated when adding a new commandline argument.
/// how the hash should be calculated when adding a new command-line argument.
mod dep_tracking {
use lint;
use middle::cstore;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/query/dropck_outlives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl_stable_hash_for!(struct DtorckConstraint<'tcx> {
/// trivial for dropck-outlives.
///
/// Note also that `needs_drop` requires a "global" type (i.e., one
/// with erased regions), but this funtcion does not.
/// with erased regions), but this function does not.
pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
match ty.sty {
// None of these types have a destructor and hence they do not
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/ty/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ pub fn shift_vars<'a, 'gcx, 'tcx, T>(
///
/// Note that what I'm calling an "escaping var" is often just called a "free var". However,
/// we already use the term "free var". It refers to the regions or types that we use to represent
/// bound regions or type params on a fn definition while we are typechecking its body.
/// bound regions or type params on a fn definition while we are type checking its body.
///
/// To clarify, conceptually there is no particular difference between
/// an "escaping" var and a "free" var. However, there is a big
Expand Down Expand Up @@ -857,7 +857,7 @@ struct LateBoundRegionsCollector {

/// If true, we only want regions that are known to be
/// "constrained" when you equate this type with another type. In
/// partcular, if you have e.g. `&'a u32` and `&'b u32`, equating
/// particular, if you have e.g. `&'a u32` and `&'b u32`, equating
/// them constraints `'a == 'b`. But if you have `<&'a u32 as
/// Trait>::Foo` and `<&'b u32 as Trait>::Foo`, normalizing those
/// types may mean that `'a` and `'b` don't appear in the results,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
/// Type size "skeleton", i.e. the only information determining a type's size.
/// While this is conservative, (aside from constant sizes, only pointers,
/// newtypes thereof and null pointer optimized enums are allowed), it is
/// enough to statically check common usecases of transmute.
/// enough to statically check common use cases of transmute.
#[derive(Copy, Clone, Debug)]
pub enum SizeSkeleton<'tcx> {
/// Any statically computable Layout.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2400,7 +2400,7 @@ impl<'a, 'gcx, 'tcx> FieldDef {

/// Represents the various closure traits in the Rust language. This
/// will determine the type of the environment (`self`, in the
/// desuaring) argument that the closure expects.
/// desugaring) argument that the closure expects.
///
/// You can get the environment type of a closure using
/// `tcx.closure_env_ty()`.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ pub fn codegen_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
///
/// In the process of working on rust-lang/rust#55238 a mysterious segfault was
/// stumbled upon. The segfault was never reproduced locally, but it was
/// suspected to be releated to the fact that codegen worker threads were
/// suspected to be related to the fact that codegen worker threads were
/// sticking around by the time the main thread was exiting, causing issues.
///
/// This structure is an attempt to fix that issue where the `codegen_aborted`
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_utils/symbol_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
//! - In order to be able to also use symbols from two versions of the same
//! crate (which naturally also have the same name), a stronger measure is
//! required: The compiler accepts an arbitrary "disambiguator" value via the
//! `-C metadata` commandline argument. This disambiguator is then fed into
//! `-C metadata` command-line argument. This disambiguator is then fed into
//! the symbol hash of every exported item. Consequently, the symbols in two
//! identical crates but with different disambiguators are not in conflict
//! with each other. This facility is mainly intended to be used by build
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_data_structures/graph/scc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct SccData<S: Idx> {
/// successors can be found.
ranges: IndexVec<S, Range<usize>>,

/// Contains the succcessors for all the Sccs, concatenated. The
/// Contains the successors for all the Sccs, concatenated. The
/// range of indices corresponding to a given SCC is found in its
/// SccData.
all_successors: Vec<S>,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_data_structures/owning_ref/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ impl<O, T: ?Sized> OwningRef<O, T> {
/// use owning_ref::{OwningRef, Erased};
///
/// fn main() {
/// // NB: Using the concrete types here for explicitnes.
/// // NB: Using the concrete types here for explicitness.
/// // For less verbose code type aliases like `BoxRef` are provided.
///
/// let owning_ref_a: OwningRef<Box<[i32; 4]>, [i32; 4]>
Expand Down Expand Up @@ -722,7 +722,7 @@ impl<O, T: ?Sized> OwningRefMut<O, T> {
/// use owning_ref::{OwningRefMut, Erased};
///
/// fn main() {
/// // NB: Using the concrete types here for explicitnes.
/// // NB: Using the concrete types here for explicitness.
/// // For less verbose code type aliases like `BoxRef` are provided.
///
/// let owning_ref_mut_a: OwningRefMut<Box<[i32; 4]>, [i32; 4]>
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_data_structures/sorted_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::mem;
use std::ops::{RangeBounds, Bound, Index, IndexMut};

/// `SortedMap` is a data structure with similar characteristics as BTreeMap but
/// slightly different trade-offs: lookup, inseration, and removal are O(log(N))
/// slightly different trade-offs: lookup, insertion, and removal are O(log(N))
/// and elements can be iterated in order cheaply.
///
/// `SortedMap` can be faster than a `BTreeMap` for small sizes (<50) since it
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ impl Compilation {
}
}

/// A trait for customising the compilation process. Offers a number of hooks for
/// executing custom code or customising input.
/// A trait for customizing the compilation process. Offers a number of hooks for
/// executing custom code or customizing input.
pub trait CompilerCalls<'a> {
/// Hook for a callback early in the process of handling arguments. This will
/// be called straight after options have been parsed but before anything
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_incremental/persist/dirty_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const LABELS_FN_IN_TRAIT: &[&[&str]] = &[
EXTRA_TRAIT,
];

/// For generic cases like inline-assemply/mod/etc
/// For generic cases like inline-assembly/mod/etc
const LABELS_HIR_ONLY: &[&[&str]] = &[
BASE_HIR,
];
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ declare_lint! {
"detects edition keywords being used as an identifier"
}

/// Checks for uses of edtion keywords used as an identifier
/// Checks for uses of edition keywords used as an identifier
#[derive(Clone)]
pub struct KeywordIdents;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/borrow_check/nll/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ mod relate_tys;
/// - `liveness` -- results of a liveness computation on the MIR; used to create liveness
/// constraints for the regions in the types of variables
/// - `flow_inits` -- results of a maybe-init dataflow analysis
/// - `move_data` -- move-data constructed when performing the maybe-init dataflow analysiss
/// - `move_data` -- move-data constructed when performing the maybe-init dataflow analysis
pub(crate) fn type_check<'gcx, 'tcx>(
infcx: &InferCtxt<'_, 'gcx, 'tcx>,
param_env: ty::ParamEnv<'gcx>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/borrow_check/places_conflict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ struct PlaceComponents<'p, 'tcx: 'p> {
impl<'p, 'tcx> PlaceComponents<'p, 'tcx> {
/// Converts a list of `Place` components into an iterator; this
/// iterator yields up a never-ending stream of `Option<&Place>`.
/// These begin with the "innermst" place and then with each
/// These begin with the "innermost" place and then with each
/// projection therefrom. So given a place like `a.b.c` it would
/// yield up:
///
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/build/matches/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use std::cmp::Ordering;
impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
/// Identifies what test is needed to decide if `match_pair` is applicable.
///
/// It is a bug to call this with a simplifyable pattern.
/// It is a bug to call this with a simplifiable pattern.
pub fn test<'pat>(&mut self, match_pair: &MatchPair<'pat, 'tcx>) -> Test<'tcx> {
match *match_pair.pattern.kind {
PatternKind::Variant { ref adt_def, substs: _, variant_index: _, subpatterns: _ } => {
Expand Down
Loading

0 comments on commit 66fcb3c

Please sign in to comment.