Skip to content

Commit 6af8495

Browse files
Merge pull request #283 from tbroadley/fix-typos
Fix typos
2 parents 19dd3dd + e7ce748 commit 6af8495

9 files changed

+16
-16
lines changed

src/destructors.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
When an [initialized] [variable] in Rust goes out of scope or a [temporary]
44
is no longer needed its _destructor_ is run. [Assignment] also runs the
5-
destructor of its left-hand operand, unless it's an unitialized variable. If a
5+
destructor of its left-hand operand, unless it's an uninitialized variable. If a
66
[struct] variable has been partially initialized, only its initialized fields
77
are dropped.
88

9-
The destrutor of a type consists of
9+
The destructor of a type consists of
1010

1111
1. Calling its [`std::ops::Drop::drop`] method, if it has one.
1212
2. Recursively running the destructor of all of its fields.

src/dynamically-sized-types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ types">DSTs</abbr>. Such types can only be used in certain cases:
1414
type arguments when a bound of `?Sized`. By default any type parameter
1515
has a `Sized` bound.
1616
* Traits may be implemented for <abbr title="dynamically sized
17-
types">DSTs</abbr>. Unlike type parameters`Self: ?Sized` by default in trait
17+
types">DSTs</abbr>. Unlike type parameters `Self: ?Sized` by default in trait
1818
definitions.
1919
* Structs may contain a <abbr title="dynamically sized type">DST</abbr> as the
2020
last field, this makes the struct itself a

src/expressions/operator-expr.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ assert_eq!(*y, 11);
109109
> _ErrorPropagationExpression_ :
110110
> &nbsp;&nbsp; [_Expression_] `?`
111111
112-
The question mark operator (`?`) unwraps valid values or returns errornous
112+
The question mark operator (`?`) unwraps valid values or returns erroneous
113113
values, propagating them to the calling function. It is a unary postfix
114114
operator that can only be applied to the types `Result<T, E>` and `Option<T>`.
115115

116116
When applied to values of the `Result<T, E>` type, it propagates errors. If
117117
the value is `Err(e)`, then it will return `Err(From::from(e))` from the
118118
enclosing function or closure. If applied to `Ok(x)`, then it will unwrap the
119-
value to evaulate to `x`.
119+
value to evaluate to `x`.
120120

121121
```rust
122122
# use std::num::ParseIntError;
@@ -393,7 +393,7 @@ An _assignment expression_ consists of a [place expression] followed by an
393393
equals sign (`=`) and a [value expression].
394394

395395
Evaluating an assignment expression [drops](destructors.html) the left-hand
396-
operand, unless it's an unitialized local variable or field of a local variable,
396+
operand, unless it's an uninitialized local variable or field of a local variable,
397397
and [either copies or moves](expressions.html#moved-and-copied-types) its
398398
right-hand operand to its left-hand operand. The left-hand operand must be a
399399
place expression: using a value expression results in a compiler error, rather

src/items/associated-items.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The identifier if the name of the function. The generics, parameter list,
3333
return type, and where clause of the associated function must be the same as the
3434
associated function declarations's.
3535

36-
An *associated function definiton* defines a function associated with another
36+
An *associated function definition* defines a function associated with another
3737
type. It is written the same as a [function item].
3838

3939
An example of a common associated function is a `new` function that returns

src/items/implementations.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The implementing type implements the implemented trait.
5454

5555
A trait implementation must define all non-default associated items declared
5656
by the implemented trait, may redefine default associated items defined by the
57-
implemented trait trait, and cannot define any other items.
57+
implemented trait, and cannot define any other items.
5858

5959
The path to the associated items is `<` followed by a path to the implementing
6060
type followed by `as` followed by a path to the trait followed by `>` as a path
@@ -95,7 +95,7 @@ impl Shape for Circle {
9595
### Trait Implementation Coherence
9696

9797
A trait implementation is consider incoherent if either the orphan check fails
98-
or there are overlapping implementation instaces.
98+
or there are overlapping implementation instances.
9999

100100
Two trait implementations overlap when there is a non-empty intersection of the
101101
traits the implementation is for, the implementations can be instantiated with

src/keywords.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Rust divides keywords into three categories:
88

99
## Strict keywords
1010

11-
These keywords can only be used in their correct contexts. They cannnot
11+
These keywords can only be used in their correct contexts. They cannot
1212
be used as the names of:
1313

1414
* [Items]

src/macros.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A number of minor features of Rust are not central enough to have their own
44
syntax, and yet are not implementable as functions. Instead, they are given
55
names, and invoked through a consistent syntax: `some_extension!(...)`.
66

7-
Thre are two ways to define new macros:
7+
There are two ways to define new macros:
88

99
* [Macros by Example] define new syntax in a higher-level, declarative way.
1010
* [Procedural Macros] can be used to implement custom derive.

src/type-layout.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ reference does not change the layout.
6666

6767
Pointers to sized types have the same size and alignment as `usize`.
6868

69-
Pointers to unsized types are sized. The size and alignemnt is guaranteed to be
69+
Pointers to unsized types are sized. The size and alignment is guaranteed to be
7070
at least equal to the size and alignment of a pointer.
7171

7272
> Note: Though you should not rely on this, all pointers to <abbr
@@ -88,7 +88,7 @@ Slices have the same layout as the section of the array they slice.
8888
8989
## Tuple Layout
9090

91-
Tuples do not have any guarantes about their layout.
91+
Tuples do not have any guarantees about their layout.
9292

9393
The exception to this is the unit tuple (`()`) which is guaranteed as a
9494
zero-sized type to have a size of 0 and an alignment of 1.
@@ -170,7 +170,7 @@ is now. Then increase the current offset by the size of the field.
170170
Finally, the size of the struct is the current offset rounded up to the nearest
171171
multiple of the struct's alignment.
172172

173-
Here is this algorithm described in psudeocode.
173+
Here is this algorithm described in pseudocode.
174174

175175
```rust,ignore
176176
struct.alignment = struct.fields().map(|field| field.alignment).max();
@@ -238,7 +238,7 @@ the default `enum` size and alignment for the target platform's C ABI.
238238
> mostly a `typedef` plus some named constants; in other words, an object of an
239239
> `enum` type can hold any integer value. For example, this is often used for
240240
> bitflags in `C`. In contrast, Rust’s C-like enumerations can only legally hold
241-
> the discrimnant values, everything else is undefined behaviour. Therefore,
241+
> the discriminant values, everything else is undefined behaviour. Therefore,
242242
> using a C-like enumeration in FFI to model a C `enum` is often wrong.
243243
244244
It is an error for [zero-variant enumerations] to have the `C` representation.

src/types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ type signature of `print`, and the cast expression in `main`.
585585
Since a trait object can contain references, the lifetimes of those references
586586
need to be expressed as part of the trait object. This lifetime is written as
587587
`Trait + 'a`. There are [defaults] that allow this lifetime to usually be
588-
infered with a sensible choice.
588+
inferred with a sensible choice.
589589

590590
[defaults]: lifetime-elision.html#default-trait-object-lifetimes
591591

0 commit comments

Comments
 (0)