Skip to content

Commit bffc973

Browse files
committed
Auto merge of #43794 - Eijebong:fix_typos, r=lukaramu,steveklanik,imperio
Fix some typos I wrote a really naive script and found those typos in the documentation.
2 parents 2fa5340 + ea5be96 commit bffc973

File tree

24 files changed

+27
-27
lines changed

24 files changed

+27
-27
lines changed

src/liballoc/allocator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn size_align<T>() -> (usize, usize) {
4040
///
4141
/// (Note however that layouts are *not* required to have positive
4242
/// size, even though many allocators require that all memory
43-
/// requeusts have positive size. A caller to the `Alloc::alloc`
43+
/// requests have positive size. A caller to the `Alloc::alloc`
4444
/// method must either ensure that conditions like this are met, or
4545
/// use specific allocators with looser requirements.)
4646
#[derive(Clone, Debug, PartialEq, Eq)]

src/liballoc/btree/node.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<K, V> InternalNode<K, V> {
132132

133133
/// An owned pointer to a node. This basically is either `Box<LeafNode<K, V>>` or
134134
/// `Box<InternalNode<K, V>>`. However, it contains no information as to which of the two types
135-
/// of nodes is acutally behind the box, and, partially due to this lack of information, has no
135+
/// of nodes is actually behind the box, and, partially due to this lack of information, has no
136136
/// destructor.
137137
struct BoxedNode<K, V> {
138138
ptr: Unique<LeafNode<K, V>>
@@ -264,7 +264,7 @@ impl<K, V> Root<K, V> {
264264
// correct variance.
265265
/// A reference to a node.
266266
///
267-
/// This type has a number of paramaters that controls how it acts:
267+
/// This type has a number of parameters that controls how it acts:
268268
/// - `BorrowType`: This can be `Immut<'a>` or `Mut<'a>` for some `'a` or `Owned`.
269269
/// When this is `Immut<'a>`, the `NodeRef` acts roughly like `&'a Node`,
270270
/// when this is `Mut<'a>`, the `NodeRef` acts roughly like `&'a mut Node`,

src/libcore/iter/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ unsafe impl<A, B> TrustedLen for Zip<A, B>
10351035
/// Now consider this twist where we add a call to `rev`. This version will
10361036
/// print `('c', 1), ('b', 2), ('a', 3)`. Note that the letters are reversed,
10371037
/// but the values of the counter still go in order. This is because `map()` is
1038-
/// still being called lazilly on each item, but we are popping items off the
1038+
/// still being called lazily on each item, but we are popping items off the
10391039
/// back of the vector now, instead of shifting them from the front.
10401040
///
10411041
/// ```rust

src/libcore/iter/traits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ pub trait Extend<A> {
345345
/// In a similar fashion to the [`Iterator`] protocol, once a
346346
/// `DoubleEndedIterator` returns `None` from a `next_back()`, calling it again
347347
/// may or may not ever return `Some` again. `next()` and `next_back()` are
348-
/// interchangable for this purpose.
348+
/// interchangeable for this purpose.
349349
///
350350
/// [`Iterator`]: trait.Iterator.html
351351
///

src/libcore/num/dec2flt/algorithm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ pub fn algorithm_m<T: RawFloat>(f: &Big, e: i16) -> T {
336336
round_by_remainder(v, rem, q, z)
337337
}
338338

339-
/// Skip over most AlgorithmM iterations by checking the bit length.
339+
/// Skip over most Algorithm M iterations by checking the bit length.
340340
fn quick_start<T: RawFloat>(u: &mut Big, v: &mut Big, k: &mut i16) {
341341
// The bit length is an estimate of the base two logarithm, and log(u / v) = log(u) - log(v).
342342
// The estimate is off by at most 1, but always an under-estimate, so the error on log(u)

src/libcore/ops/unsize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use marker::Unsize;
2424
/// Such an impl can only be written if `Foo<T>` has only a single non-phantomdata
2525
/// field involving `T`. If the type of that field is `Bar<T>`, an implementation
2626
/// of `CoerceUnsized<Bar<U>> for Bar<T>` must exist. The coercion will work by
27-
/// by coercing the `Bar<T>` field into `Bar<U>` and filling in the rest of the fields
27+
/// coercing the `Bar<T>` field into `Bar<U>` and filling in the rest of the fields
2828
/// from `Foo<T>` to create a `Foo<U>`. This will effectively drill down to a pointer
2929
/// field and coerce that.
3030
///

src/libcore/tests/num/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ assume_usize_width! {
566566
);
567567
}
568568

569-
/// Conversinos where neither the min nor the max of $source can be represented by
569+
/// Conversions where neither the min nor the max of $source can be represented by
570570
/// $target, but max/min of the target can be represented by the source.
571571
macro_rules! test_impl_try_from_signed_to_unsigned_err {
572572
($fn_name:ident, $source:ty, $target:ty) => {

src/libproc_macro/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl fmt::Display for TokenStream {
111111

112112
/// `quote!(..)` accepts arbitrary tokens and expands into a `TokenStream` describing the input.
113113
/// For example, `quote!(a + b)` will produce a expression, that, when evaluated, constructs
114-
/// constructs the `TokenStream` `[Word("a"), Op('+', Alone), Word("b")]`.
114+
/// the `TokenStream` `[Word("a"), Op('+', Alone), Word("b")]`.
115115
///
116116
/// Unquoting is done with `$`, and works by taking the single next ident as the unquoted term.
117117
/// To quote `$` itself, use `$$`.

src/librustc/traits/specialize/specialization_graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use util::nodemap::{DefIdMap, FxHashMap};
3131
///
3232
/// - Parent extraction. In particular, the graph can give you the *immediate*
3333
/// parents of a given specializing impl, which is needed for extracting
34-
/// default items amongst other thigns. In the simple "chain" rule, every impl
34+
/// default items amongst other things. In the simple "chain" rule, every impl
3535
/// has at most one parent.
3636
pub struct Graph {
3737
// all impls have a parent; the "root" impls have as their parent the def_id

src/librustc/ty/adjustment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use ty::subst::Substs;
2929
/// by `autoref`, to either a raw or borrowed pointer. In these cases unsize is
3030
/// `false`.
3131
///
32-
/// 2. A thin-to-fat coercon involves unsizing the underlying data. We start
32+
/// 2. A thin-to-fat coercion involves unsizing the underlying data. We start
3333
/// with a thin pointer, deref a number of times, unsize the underlying data,
3434
/// then autoref. The 'unsize' phase may change a fixed length array to a
3535
/// dynamically sized one, a concrete object to a trait object, or statically
@@ -52,7 +52,7 @@ use ty::subst::Substs;
5252
/// that case, we have the pointer we need coming in, so there are no
5353
/// autoderefs, and no autoref. Instead we just do the `Unsize` transformation.
5454
/// At some point, of course, `Box` should move out of the compiler, in which
55-
/// case this is analogous to transformating a struct. E.g., Box<[i32; 4]> ->
55+
/// case this is analogous to transforming a struct. E.g., Box<[i32; 4]> ->
5656
/// Box<[i32]> is an `Adjust::Unsize` with the target `Box<[i32]>`.
5757
#[derive(Clone, RustcEncodable, RustcDecodable)]
5858
pub struct Adjustment<'tcx> {

src/librustc_data_structures/stable_hasher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl<W> Hasher for StableHasher<W> {
193193

194194

195195
/// Something that implements `HashStable<CTX>` can be hashed in a way that is
196-
/// stable across multiple compiliation sessions.
196+
/// stable across multiple compilation sessions.
197197
pub trait HashStable<CTX> {
198198
fn hash_stable<W: StableHasherResult>(&self,
199199
hcx: &mut CTX,

src/librustc_driver/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ pub fn source_name(input: &Input) -> String {
315315
/// This is a somewhat higher level controller than a Session - the Session
316316
/// controls what happens in each phase, whereas the CompileController controls
317317
/// whether a phase is run at all and whether other code (from outside the
318-
/// the compiler) is run between phases.
318+
/// compiler) is run between phases.
319319
///
320320
/// Note that if compilation is set to stop and a callback is provided for a
321321
/// given entry point, the callback is called before compilation is stopped.

src/librustc_mir/dataflow/impls/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<'a, 'tcx: 'a> HasMoveData<'tcx> for DefinitelyInitializedLvals<'a, 'tcx> {
213213
/// you if an l-value *might* be uninitialized at a given point in the
214214
/// control flow. But `MovingOutStatements` also includes the added
215215
/// data of *which* particular statement causing the deinitialization
216-
/// that the borrow checker's error meessage may need to report.
216+
/// that the borrow checker's error message may need to report.
217217
#[allow(dead_code)]
218218
pub struct MovingOutStatements<'a, 'tcx: 'a> {
219219
tcx: TyCtxt<'a, 'tcx, 'tcx>,

src/librustc_mir/hair/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub enum StmtKind<'tcx> {
8080

8181
/// The Hair trait implementor translates their expressions (`&'tcx H::Expr`)
8282
/// into instances of this `Expr` enum. This translation can be done
83-
/// basically as lazilly or as eagerly as desired: every recursive
83+
/// basically as lazily or as eagerly as desired: every recursive
8484
/// reference to an expression in this enum is an `ExprRef<'tcx>`, which
8585
/// may in turn be another instance of this enum (boxed), or else an
8686
/// untranslated `&'tcx H::Expr`. Note that instances of `Expr` are very

src/librustc_trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub fn compare_simd_types<'a, 'tcx>(
191191
/// adjustment.
192192
///
193193
/// The `old_info` argument is a bit funny. It is intended for use
194-
/// in an upcast, where the new vtable for an object will be drived
194+
/// in an upcast, where the new vtable for an object will be derived
195195
/// from the old one.
196196
pub fn unsized_info<'ccx, 'tcx>(ccx: &CrateContext<'ccx, 'tcx>,
197197
source: Ty<'tcx>,

src/librustc_typeck/check/dropck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use util::nodemap::FxHashSet;
2222

2323
use syntax_pos::Span;
2424

25-
/// check_drop_impl confirms that the Drop implementation identfied by
25+
/// check_drop_impl confirms that the Drop implementation identified by
2626
/// `drop_impl_did` is not any more specialized than the type it is
2727
/// attached to (Issue #8142).
2828
///

src/librustc_typeck/constrained_type_params.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub fn identify_constrained_type_params<'tcx>(tcx: ty::TyCtxt,
9898

9999
/// Order the predicates in `predicates` such that each parameter is
100100
/// constrained before it is used, if that is possible, and add the
101-
/// paramaters so constrained to `input_parameters`. For example,
101+
/// parameters so constrained to `input_parameters`. For example,
102102
/// imagine the following impl:
103103
///
104104
/// impl<T: Debug, U: Iterator<Item=T>> Trait for U

src/librustc_typeck/variance/constraints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub struct Constraint<'a> {
5151
pub variance: &'a VarianceTerm<'a>,
5252
}
5353

54-
/// To build constriants, we visit one item (type, trait) at a time
54+
/// To build constraints, we visit one item (type, trait) at a time
5555
/// and look at its contents. So e.g. if we have
5656
///
5757
/// struct Foo<T> {

src/librustdoc/clean/inline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ fn build_static(cx: &DocContext, did: DefId, mutable: bool) -> clean::Static {
495495

496496
/// A trait's generics clause actually contains all of the predicates for all of
497497
/// its associated types as well. We specifically move these clauses to the
498-
/// associated types instead when displaying, so when we're genering the
498+
/// associated types instead when displaying, so when we're generating the
499499
/// generics for the trait itself we need to be sure to remove them.
500500
/// We also need to remove the implied "recursive" Self: Trait bound.
501501
///

src/libstd/panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub use panicking::{take_hook, set_hook, PanicInfo, Location};
3737
/// In Rust a function can "return" early if it either panics or calls a
3838
/// function which transitively panics. This sort of control flow is not always
3939
/// anticipated, and has the possibility of causing subtle bugs through a
40-
/// combination of two cricial components:
40+
/// combination of two criticial components:
4141
///
4242
/// 1. A data structure is in a temporarily invalid state when the thread
4343
/// panics.

src/libstd/sys/redox/syscall/call.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub unsafe fn brk(addr: usize) -> Result<usize> {
4040
///
4141
/// * `EACCES` - permission is denied for one of the components of `path`, or `path`
4242
/// * `EFAULT` - `path` does not point to the process's addressible memory
43-
/// * `EIO` - an I/O error occured
43+
/// * `EIO` - an I/O error occurred
4444
/// * `ENOENT` - `path` does not exit
4545
/// * `ENOTDIR` - `path` is not a directory
4646
pub fn chdir(path: &str) -> Result<usize> {
@@ -290,7 +290,7 @@ pub fn waitpid(pid: usize, status: &mut usize, options: usize) -> Result<usize>
290290
/// * `EAGAIN` - the file descriptor was opened with `O_NONBLOCK` and writing would block
291291
/// * `EBADF` - the file descriptor is not valid or is not open for writing
292292
/// * `EFAULT` - `buf` does not point to the process's addressible memory
293-
/// * `EIO` - an I/O error occured
293+
/// * `EIO` - an I/O error occurred
294294
/// * `ENOSPC` - the device containing the file descriptor has no room for data
295295
/// * `EPIPE` - the file descriptor refers to a pipe or socket whose reading end is closed
296296
pub fn write(fd: usize, buf: &[u8]) -> Result<usize> {

src/libstd/thread/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ pub fn current() -> Thread {
531531
///
532532
/// However programmers will usually prefer to use, [`channel`]s, [`Condvar`]s,
533533
/// [`Mutex`]es or [`join`] for their synchronisation routines, as they avoid
534-
/// thinking about thread schedulling.
534+
/// thinking about thread scheduling.
535535
///
536536
/// Note that [`channel`]s for example are implemented using this primitive.
537537
/// Indeed when you call `send` or `recv`, which are blocking, they will yield

src/libsyntax/attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ pub fn mk_attr_inner(span: Span, id: AttrId, item: MetaItem) -> Attribute {
435435
mk_spanned_attr_inner(span, id, item)
436436
}
437437

438-
/// Returns an innter attribute with the given value and span.
438+
/// Returns an inner attribute with the given value and span.
439439
pub fn mk_spanned_attr_inner(sp: Span, id: AttrId, item: MetaItem) -> Attribute {
440440
Attribute {
441441
id: id,

src/libsyntax/parse/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub fn parse_expr_from_source_str(name: String, source: String, sess: &ParseSess
124124

125125
/// Parses an item.
126126
///
127-
/// Returns `Ok(Some(item))` when successful, `Ok(None)` when no item was found, and`Err`
127+
/// Returns `Ok(Some(item))` when successful, `Ok(None)` when no item was found, and `Err`
128128
/// when a syntax error occurred.
129129
pub fn parse_item_from_source_str(name: String, source: String, sess: &ParseSess)
130130
-> PResult<Option<P<ast::Item>>> {

0 commit comments

Comments
 (0)