Fix links and sentence structure

This commit is contained in:
Matthew Jasper 2019-01-20 12:58:54 +00:00 committed by Eric Huss
parent 62191f6b4e
commit 79fcc6e445
7 changed files with 16 additions and 14 deletions

View File

@ -278,7 +278,8 @@ scope of the initializer expression is extended.
#### Extending based on expressions
For a let statement with an initializer, an *extending expression* if it is
For a let statement with an initializer, an *extending expression* is an
expression which is one of the following:
* The initializer expression.
* The operand of a extending [borrow expression].
@ -342,8 +343,9 @@ variable or field from being dropped automatically.
[initialized]: glossary.md#initialized
[interior mutability]: interior-mutability.md
[lazy boolean expression]: expressions/operator-expr.md#lazy-boolean-operators
[place context]: expressions.md#place-expressions-and-value-expressions
[statement]: statements.md
[temporary]: expressions.md#temporary-lifetimes
[temporary]: expressions.md#temporaries
[variable]: variables.md
[array]: types/array.md

View File

@ -125,7 +125,7 @@ the remaining situations if that type is [`Sized`], then it may be possible to
move the value. Only the following place expressions may be moved out of:
* [Variables] which are not currently borrowed.
* [Temporary values](#temporary-lifetimes).
* [Temporary values](#temporaries).
* [Fields][field] of a place expression which can be moved out of and
doesn't implement [`Drop`].
* The result of [dereferencing][deref] an expression with type [`Box<T>`] and
@ -163,9 +163,8 @@ The following expressions can be mutable place expression contexts:
When using a value expression in most place expression contexts, a temporary
unnamed memory location is created initialized to that value and the expression
evaluates to that location instead, except if [promoted](#constant-promotion)
to a `static`. The [drop scope] of the temporary is usually the end of the
enclosing statement.
evaluates to that location instead, except if [promoted] to a `static`. The
[drop scope] of the temporary is usually the end of the enclosing statement.
### Implicit Borrows
@ -260,10 +259,11 @@ They are never allowed before:
[let statement]: statements.md#let-statements
[Mutable `static` items]: items/static-items.md#mutable-statics
[scrutinee]: glossary.md#scrutinee
[promoted]: destructors.md#constant-promotion
[slice]: types/slice.md
[statement]: statements.md
[static variables]: items/static-items.md
[Temporary values]: #temporary-lifetimes
[Temporary values]: #temporaries
[Variables]: variables.md
[_ArithmeticOrLogicalExpression_]: expressions/operator-expr.md#arithmetic-and-logical-binary-operators

View File

@ -295,6 +295,6 @@ expression `()`.
[_Pattern_]: ../patterns.md
[`match` expression]: match-expr.md
[scrutinee]: ../glossary.md#scrutinee
[temporary values]: ../expressions.md#temporary-lifetimes
[temporary values]: ../expressions.md#temporaries
[_LazyBooleanOperatorExpression_]: operator-expr.md#lazy-boolean-operators
[`if let` expressions]: if-expr.md#if-let-expressions

View File

@ -455,7 +455,7 @@ assert_eq!(x, 14);
[place expression]: ../expressions.md#place-expressions-and-value-expressions
[value expression]: ../expressions.md#place-expressions-and-value-expressions
[temporary value]: ../expressions.md#temporary-lifetimes
[temporary value]: ../expressions.md#temporaries
[float-int]: https://github.com/rust-lang/rust/issues/10184
[float-float]: https://github.com/rust-lang/rust/issues/15536
[`unit` type]: ../types/tuple.md

View File

@ -139,9 +139,9 @@ attention to making those sections the best that they can be.
[_Expression_]: expressions.md
[cargo book]: ../cargo/index.html
[cargo reference]: ../cargo/reference/index.html
[expressions chapter]: expressions.md
[lifetime of temporaries]: expressions.md#temporary-lifetimes
[linkage]: linkage.md
[expressions chapter]: expressions.html
[lifetime of temporaries]: expressions.html#temporaries
[linkage]: linkage.html
[rustc book]: ../rustc/index.html
[Notation]: notation.md
[Discord]: https://discord.gg/rust-lang

View File

@ -56,4 +56,4 @@ and raw pointers.
[_TypeNoBounds_]: ../types.md#type-expressions
[`unsafe` operation]: ../unsafety.md
[dynamically sized types]: ../dynamically-sized-types.md
[temporary value]: ../expressions.md#temporary-lifetimes
[temporary value]: ../expressions.md#temporaries

View File

@ -1,7 +1,7 @@
# Variables
A _variable_ is a component of a stack frame, either a named function parameter,
an anonymous [temporary](expressions.md#temporary-lifetimes), or a named local
an anonymous [temporary](expressions.md#temporaries), or a named local
variable.
A _local variable_ (or *stack-local* allocation) holds a value directly,