Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing basic typos in Doc Comments #42812

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ impl Build {
}

/// Returns the root output directory for all Cargo output in a given stage,
/// running a particular compiler, wehther or not we're building the
/// running a particular compiler, whether or not we're building the
/// standard library, and targeting the specified architecture.
fn cargo_out(&self,
compiler: &Compiler,
Expand Down Expand Up @@ -1036,7 +1036,7 @@ impl Build {
}

impl<'a> Compiler<'a> {
/// Creates a new complier for the specified stage/host
/// Creates a new compiler for the specified stage/host
fn new(stage: u32, host: &'a str) -> Compiler<'a> {
Compiler { stage: stage, host: host }
}
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! Compilation of native dependencies like LLVM.
//!
//! Native projects like LLVM unfortunately aren't suited just yet for
//! compilation in build scripts that Cargo has. This is because thie
//! compilation in build scripts that Cargo has. This is because the
//! compilation takes a *very* long time but also because we don't want to
//! compile LLVM 3 times as part of a normal bootstrap (we want it cached).
//!
Expand Down
12 changes: 6 additions & 6 deletions src/liballoc/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn size_align<T>() -> (usize, usize) {
///
/// (Note however that layouts are *not* required to have positive
/// size, even though many allocators require that all memory
/// requeusts have positive size. A caller to the `Alloc::alloc`
/// requests have positive size. A caller to the `Alloc::alloc`
/// method must either ensure that conditions like this are met, or
/// use specific allocators with looser requirements.)
#[derive(Clone, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -213,7 +213,7 @@ impl Layout {
///
/// Returns `Some((k, offset))`, where `k` is layout of the concatenated
/// record and `offset` is the relative location, in bytes, of the
/// start of the `next` embedded witnin the concatenated record
/// start of the `next` embedded within the concatenated record
/// (assuming that the record itself starts at offset 0).
///
/// On arithmetic overflow, returns `None`.
Expand Down Expand Up @@ -266,11 +266,11 @@ impl Layout {
/// Creates a layout describing the record for `self` followed by
/// `next` with no additional padding between the two. Since no
/// padding is inserted, the alignment of `next` is irrelevant,
/// and is not incoporated *at all* into the resulting layout.
/// and is not incorporated *at all* into the resulting layout.
///
/// Returns `(k, offset)`, where `k` is layout of the concatenated
/// record and `offset` is the relative location, in bytes, of the
/// start of the `next` embedded witnin the concatenated record
/// start of the `next` embedded within the concatenated record
/// (assuming that the record itself starts at offset 0).
///
/// (The `offset` is always the same as `self.size()`; we use this
Expand Down Expand Up @@ -497,7 +497,7 @@ pub unsafe trait Alloc {
/// to allocate that block of memory.
unsafe fn dealloc(&mut self, ptr: *mut u8, layout: Layout);

/// Allocator-specific method for signalling an out-of-memory
/// Allocator-specific method for signaling an out-of-memory
/// condition.
///
/// `oom` aborts the thread or process, optionally performing
Expand All @@ -508,7 +508,7 @@ pub unsafe trait Alloc {
/// unsatisfied allocation request (signaled by an error such as
/// `AllocErr::Exhausted`), and wish to abandon computation rather
/// than attempt to recover locally. Such clients should pass the
/// signalling error value back into `oom`, where the allocator
/// signaling error value back into `oom`, where the allocator
/// may incorporate that error value into its diagnostic report
/// before aborting.
///
Expand Down
6 changes: 3 additions & 3 deletions src/liballoc/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<K, V> InternalNode<K, V> {

/// An owned pointer to a node. This basically is either `Box<LeafNode<K, V>>` or
/// `Box<InternalNode<K, V>>`. However, it contains no information as to which of the two types
/// of nodes is acutally behind the box, and, partially due to this lack of information, has no
/// of nodes is actually behind the box, and, partially due to this lack of information, has no
/// destructor.
struct BoxedNode<K, V> {
ptr: Unique<LeafNode<K, V>>
Expand Down Expand Up @@ -270,7 +270,7 @@ impl<K, V> Root<K, V> {
// correct variance.
/// A reference to a node.
///
/// This type has a number of paramaters that controls how it acts:
/// This type has a number of parameters that controls how it acts:
/// - `BorrowType`: This can be `Immut<'a>` or `Mut<'a>` for some `'a` or `Owned`.
/// When this is `Immut<'a>`, the `NodeRef` acts roughly like `&'a Node`,
/// when this is `Mut<'a>`, the `NodeRef` acts roughly like `&'a mut Node`,
Expand Down Expand Up @@ -775,7 +775,7 @@ impl<Node: Copy, Type> Clone for Handle<Node, Type> {
}

impl<Node, Type> Handle<Node, Type> {
/// Retrieves the node that contains the edge of key/value pair this handle pointes to.
/// Retrieves the node that contains the edge of key/value pair this handle points to.
pub fn into_node(self) -> Node {
self.node
}
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,12 @@ impl<T, A: Alloc> RawVec<T, A> {
/// Attempts to ensure that the buffer contains at least enough space to hold
/// `used_cap + needed_extra_cap` elements. If it doesn't already have
/// enough capacity, will reallocate in place enough space plus comfortable slack
/// space to get amortized `O(1)` behaviour. Will limit this behaviour
/// space to get amortized `O(1)` behavior. Will limit this behaviour
/// if it would needlessly cause itself to panic.
///
/// If `used_cap` exceeds `self.cap()`, this may fail to actually allocate
/// the requested space. This is not really unsafe, but the unsafe
/// code *you* write that relies on the behaviour of this function may break.
/// code *you* write that relies on the behavior of this function may break.
///
/// Returns true if the reallocation attempt has succeeded, or false otherwise.
///
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ unsafe impl<A, B> TrustedLen for Zip<A, B>
/// Now consider this twist where we add a call to `rev`. This version will
/// print `('c', 1), ('b', 2), ('a', 3)`. Note that the letters are reversed,
/// but the values of the counter still go in order. This is because `map()` is
/// still being called lazilly on each item, but we are popping items off the
/// still being called lazily on each item, but we are popping items off the
/// back of the vector now, instead of shifting them from the front.
///
/// ```rust
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pub trait Extend<A> {
/// In a similar fashion to the [`Iterator`] protocol, once a
/// `DoubleEndedIterator` returns `None` from a `next_back()`, calling it again
/// may or may not ever return `Some` again. `next()` and `next_back()` are
/// interchangable for this purpose.
/// interchangeable for this purpose.
///
/// [`Iterator`]: trait.Iterator.html
///
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/num/dec2flt/rawfp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ pub trait RawFloat : Float + Copy + Debug + LowerExp
/// The number of bits in the exponent.
const EXP_BITS: u8;

/// The number of bits in the singificand, *including* the hidden bit.
/// The number of bits in the significand, *including* the hidden bit.
const SIG_BITS: u8;

/// The number of bits in the singificand, *excluding* the hidden bit.
/// The number of bits in the significand, *excluding* the hidden bit.
const EXPLICIT_SIG_BITS: u8;

/// The maximum legal exponent in fractional representation.
Expand All @@ -123,7 +123,7 @@ pub trait RawFloat : Float + Copy + Debug + LowerExp
/// `MIN_EXP` for integral representation, i.e., with the shift applied.
const MIN_EXP_INT: i16;

/// The maximum normalized singificand in integral representation.
/// The maximum normalized significand in integral representation.
const MAX_SIG: u64;

/// The minimal normalized significand in integral representation.
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ops/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub trait Place<Data: ?Sized> {
/// or `Copy`, since the `make_place` method takes `self` by value.
#[unstable(feature = "placement_new_protocol", issue = "27779")]
pub trait Placer<Data: ?Sized> {
/// `Place` is the intermedate agent guarding the
/// `Place` is the intermediate agent guarding the
/// uninitialized state for `Data`.
type Place: InPlace<Data>;

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ops/try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

/// A trait for customizing the behaviour of the `?` operator.
/// A trait for customizing the behavior of the `?` operator.
///
/// A type implementing `Try` is one that has a canonical way to view it
/// in terms of a success/failure dichotomy. This trait allows both
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ unsafe fn atomic_xor<T>(dst: *mut T, val: T, order: Ordering) -> T {
///
/// pub fn lock(&self) {
/// while !self.flag.compare_and_swap(false, true, Ordering::Relaxed) {}
/// // This fence syncronizes-with store in `unlock`.
/// // This fence synchronizes-with store in `unlock`.
/// fence(Ordering::Acquire);
/// }
///
Expand Down
6 changes: 3 additions & 3 deletions src/libgraphviz/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! Generate files suitable for use with [Graphviz](http://www.graphviz.org/)
//!
//! The `render` function generates output (e.g. an `output.dot` file) for
//! use with [Graphviz](http://www.graphviz.org/) by walking a labelled
//! use with [Graphviz](http://www.graphviz.org/) by walking a labeled
//! graph. (Graphviz can then automatically lay out the nodes and edges
//! of the graph, and also optionally render the graph as an image or
//! other [output formats](
Expand Down Expand Up @@ -150,7 +150,7 @@
//!
//! The output from this example renders four nodes that make up the
//! Hasse-diagram for the subsets of the set `{x, y}`. Each edge is
//! labelled with the &sube; character (specified using the HTML character
//! labeled with the &sube; character (specified using the HTML character
//! entity `&sube`).
//!
//! ```rust
Expand Down Expand Up @@ -789,7 +789,7 @@ mod tests {
}

struct LabelledGraph {
/// The name for this graph. Used for labelling generated `digraph`.
/// The name for this graph. Used for labeling generated `digraph`.
name: &'static str,

/// Each node is an index into `node_labels`; these labels are
Expand Down
2 changes: 1 addition & 1 deletion src/librand/distributions/gamma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl IndependentSample<f64> for ChiSquared {

/// The Fisher F distribution `F(m, n)`.
///
/// This distribution is equivalent to the ratio of two normalised
/// This distribution is equivalent to the ratio of two normalized
/// chi-squared distributions, that is, `F(m,n) = (χ²(m)/m) /
/// (χ²(n)/n)`.
pub struct FisherF {
Expand Down
4 changes: 2 additions & 2 deletions src/librand/isaac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl IsaacRng {
rng
}

/// Initialises `self`. If `use_rsl` is true, then use the current value
/// Initializes `self`. If `use_rsl` is true, then use the current value
/// of `rsl` as a seed, otherwise construct one algorithmically (not
/// randomly).
fn init(&mut self, use_rsl: bool) {
Expand Down Expand Up @@ -367,7 +367,7 @@ impl Isaac64Rng {
rng
}

/// Initialises `self`. If `use_rsl` is true, then use the current value
/// Initializes `self`. If `use_rsl` is true, then use the current value
/// of `rsl` as a seed, otherwise construct one algorithmically (not
/// randomly).
fn init(&mut self, use_rsl: bool) {
Expand Down
2 changes: 1 addition & 1 deletion src/librand/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub trait Rng: Sized {
/// This method does *not* have a requirement to bear any fixed
/// relationship to the other methods, for example, it does *not*
/// have to result in the same output as progressively filling
/// `dest` with `self.gen::<u8>()`, and any such behaviour should
/// `dest` with `self.gen::<u8>()`, and any such behavior should
/// not be relied upon.
///
/// This method should guarantee that `dest` is entirely filled
Expand Down
2 changes: 1 addition & 1 deletion src/librand/reseeding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct ReseedingRng<R, Rsdr> {
rng: R,
generation_threshold: usize,
bytes_generated: usize,
/// Controls the behaviour when reseeding the RNG.
/// Controls the behavior when reseeding the RNG.
pub reseeder: Rsdr,
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub enum NestedVisitorMap<'this, 'tcx: 'this> {
/// Do not visit nested item-like things, but visit nested things
/// that are inside of an item-like.
///
/// **This is the most common choice.** A very commmon pattern is
/// **This is the most common choice.** A very common pattern is
/// to use `visit_all_item_likes()` as an outer loop,
/// and to have the visitor that visits the contents of each item
/// using this setting.
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ pub struct Map<'hir> {
pub forest: &'hir Forest,

/// Same as the dep_graph in forest, just available with one fewer
/// deref. This is a gratuitious micro-optimization.
/// deref. This is a gratuitous micro-optimization.
pub dep_graph: DepGraph,

/// NodeIds are sequential integers from 0, so we can be
Expand Down Expand Up @@ -658,7 +658,7 @@ impl<'hir> Map<'hir> {

/// Returns the nearest enclosing scope. A scope is an item or block.
/// FIXME it is not clear to me that all items qualify as scopes - statics
/// and associated types probably shouldn't, for example. Behaviour in this
/// and associated types probably shouldn't, for example. Behavior in this
/// regard should be expected to be highly unstable.
pub fn get_enclosing_scope(&self, id: NodeId) -> Option<NodeId> {
match self.walk_parent_nodes(id, |node| match *node {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ impl Crate {
&self.impl_items[&id]
}

/// Visits all items in the crate in some determinstic (but
/// Visits all items in the crate in some deterministic (but
/// unspecified) order. If you just need to process every item,
/// but don't care about nesting, this method is the best choice.
///
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//! a span, but also more information so that we can generate a meaningful
//! error message.
//!
//! Having a catalogue of all the different reasons an error can arise is
//! Having a catalog of all the different reasons an error can arise is
//! also useful for other reasons, like cross-referencing FAQs etc, though
//! we are not really taking advantage of this yet.
//!
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 @@ -616,7 +616,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
(result, map)
}

/// Searches the region constriants created since `snapshot` was started
/// Searches the region constraints created since `snapshot` was started
/// and checks to determine whether any of the skolemized regions created
/// in `skol_map` would "escape" -- meaning that they are related to
/// other regions in some way. If so, the higher-ranked subtyping doesn't
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for OpportunisticTypeResolver<'a, 'g
}

/// The opportunistic type and region resolver is similar to the
/// opportunistic type resolver, but also opportunistly resolves
/// opportunistic type resolver, but also opportunistically resolves
/// regions. It is useful for canonicalization.
pub struct OpportunisticTypeAndRegionResolver<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub struct LintStore {
/// is true if the lint group was added by a plugin.
lint_groups: FxHashMap<&'static str, (Vec<LintId>, bool)>,

/// Extra info for future incompatibility lints, descibing the
/// Extra info for future incompatibility lints, describing the
/// issue or RFC that caused the incompatibility.
future_incompatible: FxHashMap<LintId, FutureIncompatibleInfo>,
}
Expand Down Expand Up @@ -163,7 +163,7 @@ pub struct FutureIncompatibleInfo {
pub reference: &'static str // e.g., a URL for an issue/PR/RFC or error code
}

/// The targed of the `by_name` map, which accounts for renaming/deprecation.
/// The target of the `by_name` map, which accounts for renaming/deprecation.
enum TargetLint {
/// A direct lint target
Id(LintId),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ use mir::transform::MirSource;
/// (M1.): Misc extent of the whole `let a = ...;` statement.
/// (M2.): Misc extent of the `f()` expression.
/// (M3.): Misc extent of the `f().g(..)` expression.
/// (M4.): Misc extent of the block labelled `'b:`.
/// (M4.): Misc extent of the block labeled `'b:`.
/// (M5.): Misc extent of the `let x = d();` statement
/// (D6.): DestructionScope for temporaries created during M5.
/// (R7.): Remainder extent for block `'b:`, stmt 0 (let x = ...).
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ impl<'tcx> Debug for TerminatorKind<'tcx> {

impl<'tcx> TerminatorKind<'tcx> {
/// Write the "head" part of the terminator; that is, its name and the data it uses to pick the
/// successor basic block, if any. The only information not inlcuded is the list of possible
/// successor basic block, if any. The only information not included is the list of possible
/// successors, which may be rendered differently between the text and the graphviz format.
pub fn fmt_head<W: Write>(&self, fmt: &mut W) -> fmt::Result {
use self::TerminatorKind::*;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/mir/traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {
///
/// Reverse postorder is the reverse order of a postorder traversal.
/// This is different to a preorder traversal and represents a natural
/// linearisation of control-flow.
/// linearization of control-flow.
///
/// ```text
///
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub struct Session {

/// Map from imported macro spans (which consist of
/// the localized span for the macro body) to the
/// macro name and defintion span in the source crate.
/// macro name and definition span in the source crate.
pub imported_macro_spans: RefCell<HashMap<Span, (String, Span)>>,

incr_comp_session: RefCell<IncrCompSession>,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct GlobalFulfilledPredicates<'tcx> {
/// consists of a list of obligations that must be (eventually)
/// satisfied. The job is to track which are satisfied, which yielded
/// errors, and which are still pending. At any point, users can call
/// `select_where_possible`, and the fulfilment context will try to do
/// `select_where_possible`, and the fulfillment context will try to do
/// selection, retaining only those obligations that remain
/// ambiguous. This may be helpful in pushing type inference
/// along. Once all type inference constraints have been generated, the
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ impl<'tcx> ProjectionCache<'tcx> {
}

/// Try to start normalize `key`; returns an error if
/// normalization already occured (this error corresponds to a
/// normalization already occurred (this error corresponds to a
/// cache hit, so it's actually a good thing).
fn try_start(&mut self, key: ty::ProjectionTy<'tcx>)
-> Result<(), ProjectionCacheEntry<'tcx>> {
Expand Down
Loading