Skip to content

Commit 8942f34

Browse files
authored
Merge pull request rust-lang#65 from matthewjasper/fix-expr-links
Fix expr links
2 parents 6da5968 + 09ff1b4 commit 8942f34

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/expressions.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ the following lvalues may be moved out of:
4949
* [Variables](variables.html) which are not currently borrowed.
5050
* [Temporary values](#temporary-lifetimes).
5151
* [Fields](#field-expressions) of an lvalue which can be moved out of and
52-
doesn't implement [`Drop`](#the-drop-trait).
52+
doesn't implement [`Drop`](the-drop-trait.html).
5353
* The result of [dereferencing](#the-dereference-operator) an expression with
5454
type `Box<T>` and that can also be moved out of.
5555

@@ -123,8 +123,8 @@ Here are some examples:
123123

124124
Certain expressions will treat an expression as an lvalue by implicitly
125125
borrowing it. For example, it is possible to compare two unsized
126-
[slices](#array-and-slice-types) for equality directly, because the `==`
127-
operator implicitly borrows it's operands:
126+
[slices](types.html#array-and-slice-types) for equality directly, because the
127+
`==` operator implicitly borrows it's operands:
128128

129129
```rust
130130
# let c = [1, 2, 3];
@@ -155,17 +155,17 @@ Certain types of expressions can be evaluated at compile time. These are called
155155
_constant expressions_. Certain places, such as in
156156
[constants](items.html#constant-items) and [statics](items.html#static-items),
157157
require a constant expression, and are always evaluated at compile time. In
158-
other places, such as in [`let` statements](let-statements), constant
159-
expressions may be evaluated at compile time. If errors, such as out of bounds
160-
[array access](#index-expressions) or [overflow](#overflow) occurs, then it is
161-
a compiler error if the value must be evaluated at compile time, otherwise it
162-
is just a warning, but the code will most likely panic when run.
158+
other places, such as in [`let` statements](statements.html#let-statements),
159+
constant expressions may be evaluated at compile time. If errors, such as out
160+
of bounds [array access](#index-expressions) or [overflow](#overflow) occurs,
161+
then it is a compiler error if the value must be evaluated at compile time,
162+
otherwise it is just a warning, but the code will most likely panic when run.
163163

164164
The following expressions are constant expressions, so long as any operands are
165165
also constant expressions:
166166

167167
* [Literals](#literal-expressions).
168-
* [Paths](#paths) to [functions](items.html#functions) and constants.
168+
* [Paths](#path-expressions) to [functions](items.html#functions) and constants.
169169
Recursively defining constants is not allowed.
170170
* Paths to statics, so long as only their address, not their value, is used.
171171
This includes using their value indirectly through a compilicated expression.
@@ -190,7 +190,7 @@ also constant expressions:
190190
boolean](#lazy-boolean-operators) operators used on integer and floating
191191
point types, `bool` and `char`.
192192
* Shared [borrow expressions](#borrow-operators).
193-
* The [dereference operator](#dereference-operator), but not to circumvent the
193+
* The [dereference operator](#the-dereference-operator), but not to circumvent the
194194
rule on statics.
195195
* [Grouped expressions](#grouped-expressions).
196196
* [Cast expressions](#type-cast-expressions), except pointer to address and
@@ -223,7 +223,7 @@ A [path](paths.html) used as an expression context denotes either a local
223223
variable or an item. Path expressions that resolve to local or static variables
224224
are [lvalues](expressions.html#lvalues-and-rvalues), other paths
225225
are rvalues. Using a `static mut` variable requires an [`unsafe`
226-
block](#unsafe-block).
226+
block](#unsafe-blocks).
227227

228228
```rust
229229
# mod globals {
@@ -452,17 +452,17 @@ mystruct.method(); // Method expression
452452
(mystruct.function_field)() // Call expression containing a field expression
453453
```
454454

455-
A field access is an [lvalue](expressions.html#lvalues-and-rvalues)
456-
referring to the value of that field. When the subexpression is
457-
[mutable](#mutability), the field expression is also mutable.
455+
A field access is an [lvalue](lvalues-and-rvalues) referring to the value of
456+
that field. When the subexpression is [mutable](#mutability), the field
457+
expression is also mutable.
458458

459459
Also, if the type of the expression to the left of the dot is a pointer, it is
460460
automatically dereferenced as many times as necessary to make the field access
461461
possible. In cases of ambiguity, we prefer fewer autoderefs to more.
462462

463463
Finally the fields of a struct, a reference to a struct are treated as separate
464464
entities when borrowing. If the struct does not implement
465-
[`Drop`](#the-drop-trait) this also applies to moving out of each of its fields
465+
[`Drop`](the-drop-trait.html) this also applies to moving out of each of its fields
466466
where possible. This also does not apply if automatic dereferencing is done
467467
though user defined types.
468468

src/tokens.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ otherwise appear as [unary operators], [binary
319319
operators], or [keywords].
320320
They are catalogued in [the Symbols section][symbols] of the Grammar document.
321321

322-
[unary operators]: expressions.html#unary-operator-expressions
323-
[binary operators]: expressions.html#binary-operator-expressions
322+
[unary operators]: expressions.html#borrow-operators
323+
[binary operators]: expressions.html#arithmetic-and-logical-binary-operators
324324
[tokens]: #tokens
325325
[symbols]: ../grammar.html#symbols
326-
[keywords]: ../grammar.html#keywords
326+
[keywords]: ../grammar.html#keywords

src/variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Variables
22

33
A _variable_ is a component of a stack frame, either a named function parameter,
4-
an anonymous [temporary](expressions.html#lvalues-and-rvalues), or a named local
4+
an anonymous [temporary](expressions.html#temporary-lifetimes), or a named local
55
variable.
66

77
A _local variable_ (or *stack-local* allocation) holds a value directly,

0 commit comments

Comments
 (0)