Skip to content

Commit 3621189

Browse files
committed
minor grammar and typo fixes
1 parent 8f598e2 commit 3621189

13 files changed

+21
-20
lines changed

src/destructors.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ temporary variable that holds the result of that expression when used in a
154154
[place context], unless it is [promoted].
155155

156156
Apart from lifetime extension, the temporary scope of an expression is the
157-
smallest scope that contains the expression and is for one of the following:
157+
smallest scope that contains the expression and is one of the following:
158158

159159
* The entire function body.
160160
* A statement.
@@ -246,7 +246,8 @@ loop {
246246
### Constant promotion
247247

248248
Promotion of a value expression to a `'static` slot occurs when the expression
249-
could be written in a constant, borrowed, and dereferencing that borrow where
249+
could be written in a constant and borrowed, and that borrow could be dereferenced
250+
where
250251
the expression was originally written, without changing the runtime behavior.
251252
That is, the promoted expression can be evaluated at compile-time and the
252253
resulting value does not contain [interior mutability] or [destructors] (these

src/dynamically-sized-types.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ types">DSTs</abbr>. Such types can only be used in certain cases:
1111
* Pointers to slices also store the number of elements of the slice.
1212
* Pointers to trait objects also store a pointer to a vtable.
1313
* <abbr title="dynamically sized types">DSTs</abbr> can be provided as
14-
type arguments when a bound of `?Sized`. By default any type parameter
14+
type arguments where a bound of `?Sized` is present. 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
20-
last field, this makes the struct itself a
20+
last field; this makes the struct itself a
2121
<abbr title="dynamically sized type">DST</abbr>.
2222

2323
> **Note**: [variables], function parameters, [const] items, and [static] items must be

src/expressions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ move the value. Only the following place expressions may be moved out of:
179179
* [Variables] which are not currently borrowed.
180180
* [Temporary values](#temporaries).
181181
* [Fields][field] of a place expression which can be moved out of and
182-
doesn't implement [`Drop`].
182+
don't implement [`Drop`].
183183
* The result of [dereferencing][deref] an expression with type [`Box<T>`] and
184184
that can also be moved out of.
185185

186-
Moving out of a place expression that evaluates to a local variable, the
186+
After moving out of a place expression that evaluates to a local variable, the
187187
location is deinitialized and cannot be read from again until it is
188188
reinitialized. In all other cases, trying to use a place expression in a value
189189
expression context is an error.
@@ -222,7 +222,7 @@ evaluates to that location instead, except if [promoted] to a `static`. The
222222

223223
Certain expressions will treat an expression as a place expression by implicitly
224224
borrowing it. For example, it is possible to compare two unsized [slices][slice] for
225-
equality directly, because the `==` operator implicitly borrows it's operands:
225+
equality directly, because the `==` operator implicitly borrows its operands:
226226

227227
```rust
228228
# let c = [1, 2, 3];

src/expressions/method-call-expr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ These cases require a [disambiguating function call syntax] for method and funct
7171
***Warning:*** For [trait objects], if there is an inherent method of the same name as a trait method, it will give a compiler error when trying to call the method in a method call expression.
7272
Instead, you can call the method using [disambiguating function call syntax], in which case it calls the trait method, not the inherent method.
7373
There is no way to call the inherent method.
74-
Just don't define inherent methods on trait objects with the same name a trait method and you'll be fine.
74+
Just don't define inherent methods on trait objects with the same name as a trait method and you'll be fine.
7575
7676
</div>
7777

src/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ implementation.
125125

126126
A variable is initialized if it has been assigned a value and hasn't since been
127127
moved from. All other memory locations are assumed to be uninitialized. Only
128-
unsafe Rust can create such a memory without initializing it.
128+
unsafe Rust can create a memory location without initializing it.
129129

130130
### Local trait
131131

src/items/extern-crates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ by using an underscore with the form `extern crate foo as _`. This may be
6464
useful for crates that only need to be linked, but are never referenced, and
6565
will avoid being reported as unused.
6666

67-
The [`macro_use` attribute] works as usual and import the macro names
67+
The [`macro_use` attribute] works as usual and imports the macro names
6868
into the [`macro_use` prelude].
6969

7070
## The `no_link` attribute

src/items/external-blocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ External blocks provide _declarations_ of items that are not _defined_ in the
1717
current crate and are the basis of Rust's foreign function interface. These are
1818
akin to unchecked imports.
1919

20-
Two kind of item _declarations_ are allowed in external blocks: [functions] and
20+
Two kinds of item _declarations_ are allowed in external blocks: [functions] and
2121
[statics]. Calling functions or accessing statics that are declared in external
2222
blocks is only allowed in an `unsafe` context.
2323

src/items/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ If the first parameter is a _SelfParam_, this indicates that the function is a
7474
function] in a [trait] or [implementation].
7575

7676
A parameter with the `...` token indicates a [variadic function], and may only
77-
be used as the last parameter of a [external block] function. The variadic
77+
be used as the last parameter of an [external block] function. The variadic
7878
parameter may have an optional identifier, such as `args: ...`.
7979

8080
## Function body

src/items/implementations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ fn main() {
8787
## Trait Implementations
8888

8989
A _trait implementation_ is defined like an inherent implementation except that
90-
the optional generic type declarations is followed by a [trait] followed
91-
by the keyword `for`. Followed by a path to a nominal type.
90+
the optional generic type declarations are followed by a [trait], followed
91+
by the keyword `for`, followed by a path to a nominal type.
9292

9393
<!-- To understand this, you have to back-reference to the previous section. :( -->
9494

@@ -265,7 +265,7 @@ impl<'a> HasAssocType for Struct {
265265

266266
Implementations may contain outer [attributes] before the `impl` keyword and
267267
inner [attributes] inside the brackets that contain the associated items. Inner
268-
attributes must come before any associated items. That attributes that have
268+
attributes must come before any associated items. The attributes that have
269269
meaning here are [`cfg`], [`deprecated`], [`doc`], and [the lint check
270270
attributes].
271271

src/items/modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ contents in a file named `mod.rs` within that directory. The above example can
6565
alternately be expressed with `crate::util`'s contents in a file named
6666
`util/mod.rs`. It is not allowed to have both `util.rs` and `util/mod.rs`.
6767

68-
> **Note**: Previous to `rustc` 1.30, using `mod.rs` files was the way to load
68+
> **Note**: Prior to `rustc` 1.30, using `mod.rs` files was the way to load
6969
> a module with nested children. It is encouraged to use the new naming
7070
> convention as it is more consistent, and avoids having many files named
7171
> `mod.rs` within a project.

src/lifetime-elision.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ If neither of those rules apply, then the bounds on the trait are used:
103103
// For the following trait...
104104
trait Foo { }
105105

106-
// These two are the same as Box<T> has no lifetime bound on T
106+
// These two are the same because Box<T> has no lifetime bound on T
107107
type T1 = Box<dyn Foo>;
108108
type T2 = Box<dyn Foo + 'static>;
109109

src/names/preludes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A *prelude* is a collection of names that are automatically brought into scope
44
of every module in a crate.
55

6-
These prelude names are not part of the module itself, they are implicitly
6+
These prelude names are not part of the module itself: they are implicitly
77
queried during [name resolution]. For example, even though something like
88
[`Box`] is in scope in every module, you cannot refer to it as `self::Box`
99
because it is not a member of the current module.

src/types/tuple.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ And so on.
2222
The type of each field is the type of the same position in the tuple's list of types.
2323

2424
For convenience and historical reasons, the tuple type with no fields (`()`) is often called *unit* or *the unit type*.
25-
It's one value is also called *unit* or *the unit value*.
25+
Its one value is also called *unit* or *the unit value*.
2626

2727
Some examples of tuple types:
2828

0 commit comments

Comments
 (0)