Skip to content

Commit cbfa189

Browse files
author
Alexis Hunt
committed
Update links in nested directories.
1 parent 124d5eb commit cbfa189

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+490
-503
lines changed

src/expressions/array-expr.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
> &nbsp;&nbsp; &nbsp;&nbsp; [_Expression_] ( `,` [_Expression_] )<sup>\*</sup> `,`<sup>?</sup>\
1111
> &nbsp;&nbsp; | [_Expression_] `;` [_Expression_]
1212
13-
An _[array](types/array.html) expression_ can be written by
13+
An _[array] expression_ can be written by
1414
enclosing zero or more comma-separated expressions of uniform type in square
1515
brackets. This produces and array containing each of these values in the
1616
order they are written.
1717

1818
Alternatively there can be exactly two expressions inside the brackets,
1919
separated by a semi-colon. The expression after the `;` must be a have type
20-
`usize` and be a [constant expression],
21-
such as a [literal](tokens.html#literals) or a [constant
22-
item](items/constant-items.html). `[a; b]` creates an array containing `b`
20+
`usize` and be a [constant expression], such as a
21+
[literal](../tokens.html#literals) or a [constant
22+
item](../items/constant-items.html). `[a; b]` creates an array containing `b`
2323
copies of the value of `a`. If the expression after the semi-colon has a value
2424
greater than 1 then this requires that the type of `a` is
2525
[`Copy`](special-types-and-traits.html#copy).
@@ -42,9 +42,8 @@ expressions].
4242

4343
> **<sup>Syntax</sup>**\
4444
> _IndexExpression_ :\
45-
> &nbsp;&nbsp; [_Expression_] `[` [_Expression_] `]`
4645
47-
[Array](types/array.html) and [slice](types/slice.html)-typed expressions can be
46+
[Array][array] and [slice](../types/slice.html)-typed expressions can be
4847
indexed by writing a square-bracket-enclosed expression of type `usize` (the
4948
index) after them. When the array is mutable, the resulting [memory location]
5049
can be assigned to.
@@ -81,11 +80,12 @@ arr[10]; // warning: index out of bounds
8180
The array index expression can be implemented for types other than arrays and slices
8281
by implementing the [Index] and [IndexMut] traits.
8382

83+
[array]: ../types/array.html
8484
[IndexMut]: ../std/ops/trait.IndexMut.html
8585
[Index]: ../std/ops/trait.Index.html
86-
[Inner attributes]: attributes.html
87-
[_Expression_]: expressions.html
88-
[_InnerAttribute_]: attributes.html
89-
[attributes on block expressions]: expressions/block-expr.html#attributes-on-block-expressions
90-
[constant expression]: const_eval.html#constant-expressions
91-
[memory location]: expressions.html#place-expressions-and-value-expressions
86+
[Inner attributes]: ../attributes.html
87+
[_Expression_]: ../expressions.html
88+
[_InnerAttribute_]: ../attributes.html
89+
[attributes on block expressions]: ../block-expr.html#attributes-on-block-expressions
90+
[constant expression]: ../const_eval.html#constant-expressions
91+
[memory location]: ../expressions.html#place-expressions-and-value-expressions

src/expressions/block-expr.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -129,26 +129,26 @@ fn is_unix_platform() -> bool {
129129
}
130130
```
131131

132-
[_ExpressionWithoutBlock_]: expressions.html
133-
[_InnerAttribute_]: attributes.html
134-
[_Statement_]: statements.html
135-
[`cfg`]: conditional-compilation.html
136-
[`for`]: expressions/loop-expr.html#iterator-loops
137-
[`loop`]: expressions/loop-expr.html#infinite-loops
138-
[`while let`]: expressions/loop-expr.html#predicate-pattern-loops
139-
[`while`]: expressions/loop-expr.html#predicate-loops
140-
[array expressions]: expressions/array-expr.html
141-
[call expressions]: expressions/call-expr.html
142-
[enum variant]: expressions/enum-variant-expr.html
143-
[expression attributes]: expressions.html#expression-attributes
144-
[expression]: expressions.html
145-
[function]: items/functions.html
146-
[inner attributes]: attributes.html
147-
[method]: items/associated-items.html#methods
148-
[statement]: statements.html
149-
[statements]: statements.html
150-
[struct]: expressions/struct-expr.html
151-
[the lint check attributes]: attributes.html#lint-check-attributes
152-
[tuple expressions]: expressions/tuple-expr.html
153-
[unsafe operations]: unsafety.html
154-
[value expressions]: expressions.html#place-expressions-and-value-expressions
132+
[_ExpressionWithoutBlock_]: ../expressions.html
133+
[_InnerAttribute_]: ../attributes.html
134+
[_Statement_]: ../statements.html
135+
[`cfg`]: ../conditional-compilation.html
136+
[`for`]: ../expressions/loop-expr.html#iterator-loops
137+
[`loop`]: ../expressions/loop-expr.html#infinite-loops
138+
[`while let`]: ../expressions/loop-expr.html#predicate-pattern-loops
139+
[`while`]: ../expressions/loop-expr.html#predicate-loops
140+
[array expressions]: ../expressions/array-expr.html
141+
[call expressions]: ../expressions/call-expr.html
142+
[enum variant]: ../expressions/enum-variant-expr.html
143+
[expression attributes]: ../expressions.html#expression-attributes
144+
[expression]: ../expressions.html
145+
[function]: ../items/functions.html
146+
[inner attributes]: ../attributes.html
147+
[method]: ../items/associated-items.html#methods
148+
[statement]: ../statements.html
149+
[statements]: ../statements.html
150+
[struct]: ../expressions/struct-expr.html
151+
[the lint check attributes]: ../attributes.html#lint-check-attributes
152+
[tuple expressions]: ../expressions/tuple-expr.html
153+
[unsafe operations]: ../unsafety.html
154+
[value expressions]: ../expressions.html#place-expressions-and-value-expressions

src/expressions/call-expr.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
A _call expression_ consists of an expression followed by a parenthesized
1111
expression-list. It invokes a function, providing zero or more input variables.
1212
If the function eventually returns, then the expression completes. For
13-
[non-function types](types/function-item.html), the expression f(...) uses
14-
the method on one of the [`std::ops::Fn`], [`std::ops::FnMut`] or
13+
[non-function types](types/function-item.html), the expression f(...) uses the
14+
method on one of the [`std::ops::Fn`], [`std::ops::FnMut`] or
1515
[`std::ops::FnOnce`] traits, which differ in whether they take the type by
1616
reference, mutable reference, or take ownership respectively. An automatic
1717
borrow will be taken if needed. Rust will also automatically dereference `f` as
@@ -93,9 +93,9 @@ fn main() {
9393

9494
Refer to [RFC 132] for further details and motivations.
9595

96-
[`std::ops::Fn`]: ../std/ops/trait.Fn.html
97-
[`std::ops::FnMut`]: ../std/ops/trait.FnMut.html
98-
[`std::ops::FnOnce`]: ../std/ops/trait.FnOnce.html
96+
[`std::ops::Fn`]: ../../std/ops/trait.Fn.html
97+
[`std::ops::FnMut`]: ../../std/ops/trait.FnMut.html
98+
[`std::ops::FnOnce`]: ../../std/ops/trait.FnOnce.html
9999
[RFC 132]: https://github.com/rust-lang/rfcs/blob/master/text/0132-ufcs.md
100-
101-
[_Expression_]: expressions.html
100+
[non-function types]: ../types.html#function-item-types
101+
[_Expression_]: ../expressions.html

src/expressions/closure-expr.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,21 @@ functions, as an abbreviation for defining and capturing a separate function.
3131

3232
Significantly, closure expressions _capture their environment_, which regular
3333
[function definitions] do not. Without the `move` keyword, the closure expression
34-
[infers how it captures each variable from its environment](types/closure.html#capture-modes),
35-
preferring to capture by shared reference, effectively borrowing
36-
all outer variables mentioned inside the closure's body. If needed the compiler
37-
will infer that instead mutable references should be taken, or that the values
38-
should be moved or copied (depending on their type) from the environment. A
39-
closure can be forced to capture its environment by copying or moving values by
40-
prefixing it with the `move` keyword. This is often used to ensure that the
34+
[infers how it captures each variable from its
35+
environment](../types/closure.html#capture-modes), preferring to capture by shared
36+
reference, effectively borrowing all outer variables mentioned inside the
37+
closure's body. If needed the compiler will infer that instead mutable
38+
references should be taken, or that the values should be moved or copied
39+
(depending on their type) from the environment. A closure can be forced to
40+
capture its environment by copying or moving values by prefixing it with the
41+
`move` keyword. This is often used to ensure that the
4142
closure's type is `'static`.
4243

4344
The compiler will determine which of the [closure
44-
traits](types/closure.html#call-traits-and-coercions) the closure's type will implement by how it
45-
acts on its captured variables. The closure will also implement
46-
[`Send`](special-types-and-traits.html#send) and/or
47-
[`Sync`](special-types-and-traits.html#sync) if all of its captured types do.
45+
traits](../types/closure.html#call-traits-and-coercions) the closure's type will
46+
implement by how it acts on its captured variables. The closure will also
47+
implement [`Send`](../special-types-and-traits.html#send) and/or
48+
[`Sync`](../special-types-and-traits.html#sync) if all of its captured types do.
4849
These traits allow functions to accept closures using generics, even though the
4950
exact types can't be named.
5051

@@ -67,14 +68,13 @@ let word = "konnichiwa".to_owned();
6768
ten_times(move |j| println!("{}, {}", word, j));
6869
```
6970

70-
[block]: expressions/block-expr.html
71-
[function definitions]: items/functions.html
72-
[patterns]: patterns.html
73-
74-
[_Expression_]: expressions.html
75-
[_BlockExpression_]: expressions/block-expr.html
76-
[_TypeNoBounds_]: types.html#type-expressions
77-
[_FunctionParameters_]: items/functions.html
78-
[_Pattern_]: patterns.html
79-
[_Type_]: types.html#type-expressions
80-
[`let` binding]: statements.html#let-statements
71+
[block]: ../expressions/block-expr.html
72+
[function definitions]: ../items/functions.html
73+
[patterns]: ../patterns.html
74+
[_Expression_]: ../expressions.html
75+
[_BlockExpression_]: ../expressions/block-expr.html
76+
[_TypeNoBounds_]: ../types.html#type-expressions
77+
[_FunctionParameters_]: ../items/functions.html
78+
[_Pattern_]: ../patterns.html
79+
[_Type_]: ../types.html#type-expressions
80+
[`let` binding]: ../statements.html#let-statements

src/expressions/enum-variant-expr.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ let m = Message::Move { x: 50, y: 200 };
4040
Enum variant expressions have the same syntax, behavior, and restrictions as [struct
4141
expressions][structs], except they do not support base update with the `..` syntax.
4242

43-
[IDENTIFIER]: identifiers.html
44-
[TUPLE_INDEX]: tokens.html#integer-literals
45-
[_Expression_]: expressions.html
46-
[_PathInExpression_]: paths.html#paths-in-expressions
47-
[structs]: expressions/struct-expr.html
43+
[IDENTIFIER]: ../identifiers.html
44+
[TUPLE_INDEX]: ../tokens.html#integer-literals
45+
[_Expression_]: ../expressions.html
46+
[_PathInExpression_]: ../paths.html#paths-in-expressions
47+
[structs]: ../expressions/struct-expr.html

src/expressions/field-expr.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ automatically dereferenced as many times as necessary to make the field access
2626
possible. In cases of ambiguity, we prefer fewer autoderefs to more.
2727

2828
Finally, the fields of a struct or a reference to a struct are treated as
29-
separate entities when borrowing. If the struct does not implement
30-
[`Drop`](special-types-and-traits.html#drop) and is stored in a local variable,
31-
this also applies to moving out of each of its fields. This also does not apply
32-
if automatic dereferencing is done though user defined types.
29+
separate entities when borrowing. If the struct does not implement [`Drop`] and
30+
is stored in a local variable, this also applies to moving out of each of its
31+
fields. This also does not apply if automatic dereferencing is done though user
32+
defined types.
3333

3434
```rust
3535
struct A { f1: String, f2: String, f3: String }
@@ -45,10 +45,11 @@ let c: &String = &x.f2; // Can borrow again
4545
let d: String = x.f3; // Move out of x.f3
4646
```
4747

48-
[_Expression_]: expressions.html
49-
[IDENTIFIER]: identifiers.html
50-
[method call expression]: expressions/method-call-expr.html
51-
[struct]: items/structs.html
52-
[union]: items/unions.html
53-
[place expression]: expressions.html#place-expressions-and-value-expressions
54-
[mutable]: expressions.html#mutability
48+
[_Expression_]: ../expressions.html
49+
[IDENTIFIER]: ../identifiers.html
50+
[method call expression]: ../method-call-expr.html
51+
[struct]: ../items/structs.html
52+
[union]: ../items/unions.html
53+
[place expression]: ../expressions.html#place-expressions-and-value-expressions
54+
[mutable]: ../expressions.html#mutability
55+
[`Drop`]: ../special-types-and-traits.html#drop

src/expressions/grouped-expr.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ assert_eq!((a.f)(), "The field f");
4141
group expression in the same expression contexts as [attributes on block
4242
expressions].
4343

44-
[Inner attributes]: attributes.html
45-
[_Expression_]: expressions.html
46-
[_InnerAttribute_]: attributes.html
47-
[attributes on block expressions]: expressions/block-expr.html#attributes-on-block-expressions
44+
[Inner attributes]: ../attributes.html
45+
[_Expression_]: ../expressions.html
46+
[_InnerAttribute_]: ../attributes.html
47+
[attributes on block expressions]: ../expressions/block-expr.html#attributes-on-block-expressions

src/expressions/if-expr.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ if let PAT = EXPR || EXPR { .. }
149149
if let PAT = ( EXPR || EXPR ) { .. }
150150
```
151151

152-
[_BlockExpression_]: expressions/block-expr.html
153-
[_Expression_]: expressions.html
154-
[_LazyBooleanOperatorExpression_]: expressions/operator-expr.html#lazy-boolean-operators
155-
[_MatchArmPatterns_]: expressions/match-expr.html
152+
[_BlockExpression_]: ../expressions/block-expr.html
153+
[_Expression_]: ../expressions.html
154+
[_LazyBooleanOperatorExpression_]: ../expressions/operator-expr.html#lazy-boolean-operators
155+
[_MatchArmPatterns_]: ../expressions/match-expr.html
156156
[_eRFCIfLetChain_]: https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#rollout-plan-and-transitioning-to-rust-2018
157-
[`match` expression]: expressions/match-expr.html
158-
[scrutinee]: glossary.html#scrutinee
157+
[`match` expression]: ../expressions/match-expr.html
158+
[scrutinee]: ../glossary.html#scrutinee

src/expressions/literal-expr.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
> &nbsp;&nbsp; | [FLOAT_LITERAL]\
1313
> &nbsp;&nbsp; | [BOOLEAN_LITERAL]
1414
15-
A _literal expression_ consists of one of the [literal](tokens.html#literals)
16-
forms described earlier. It directly describes a number, character, string,
17-
or boolean value.
15+
A _literal expression_ consists of one of the [literal] forms described earlier.
16+
It directly describes a number, character, string, or boolean value.
1817

1918
```rust
2019
"hello"; // string type
2120
'5'; // character type
2221
5; // integer type
2322
```
2423

25-
[CHAR_LITERAL]: tokens.html#character-literals
26-
[STRING_LITERAL]: tokens.html#string-literals
27-
[RAW_STRING_LITERAL]: tokens.html#raw-string-literals
28-
[BYTE_LITERAL]: tokens.html#byte-literals
29-
[BYTE_STRING_LITERAL]: tokens.html#byte-string-literals
30-
[RAW_BYTE_STRING_LITERAL]: tokens.html#raw-byte-string-literals
31-
[INTEGER_LITERAL]: tokens.html#integer-literals
32-
[FLOAT_LITERAL]: tokens.html#floating-point-literals
33-
[BOOLEAN_LITERAL]: tokens.html#boolean-literals
24+
[CHAR_LITERAL]: ../tokens.html#character-literals
25+
[STRING_LITERAL]: ../tokens.html#string-literals
26+
[RAW_STRING_LITERAL]: ../tokens.html#raw-string-literals
27+
[BYTE_LITERAL]: ../tokens.html#byte-literals
28+
[BYTE_STRING_LITERAL]: ../tokens.html#byte-string-literals
29+
[RAW_BYTE_STRING_LITERAL]: ../tokens.html#raw-byte-string-literals
30+
[INTEGER_LITERAL]: ../tokens.html#integer-literals
31+
[FLOAT_LITERAL]: ../tokens.html#floating-point-literals
32+
[BOOLEAN_LITERAL]: ../tokens.html#boolean-literals
33+
[literal]: ../tokens.html#literals

src/expressions/loop-expr.md

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
> &nbsp;&nbsp; &nbsp;&nbsp; | [_IteratorLoopExpression_]\
1010
> &nbsp;&nbsp; )
1111
12-
[_LoopLabel_]: #loop-labels
13-
[_InfiniteLoopExpression_]: #infinite-loops
14-
[_PredicateLoopExpression_]: #predicate-loops
15-
[_PredicatePatternLoopExpression_]: #predicate-pattern-loops
16-
[_IteratorLoopExpression_]: #iterator-loops
17-
1812
Rust supports four loop expressions:
1913

2014
* A [`loop` expression](#infinite-loops) denotes an infinite loop.
@@ -23,9 +17,9 @@ Rust supports four loop expressions:
2317
* A [`for` expression](#iterator-loops) extracts values from an iterator,
2418
looping until the iterator is empty.
2519

26-
All four types of loop support [`break` expressions](#break-expressions),
27-
[`continue` expressions](#continue-expressions), and [labels](#loop-labels).
28-
Only `loop` supports [evaluation to non-trivial values](#break-and-loop-values).
20+
All four types of loop support [`break` expressions],
21+
[`continue` expressions], and [labels].
22+
Only `loop` supports [evaluation to non-trivial values][loop values].
2923

3024
## Infinite loops
3125

@@ -37,9 +31,9 @@ A `loop` expression repeats execution of its body continuously:
3731
`loop { println!("I live."); }`.
3832

3933
A `loop` expression without an associated `break` expression is diverging and
40-
has type [`!`](types/never.html). A `loop` expression containing
41-
associated [`break` expression(s)](#break-expressions) may terminate, and must
42-
have type compatible with the value of the `break` expression(s).
34+
has type [`!`](../types/never.html). A `loop` expression containing associated
35+
[`break` expression(s)](#break-expressions) may terminate, and must have type
36+
compatible with the value of the `break` expression(s).
4337

4438
## Predicate loops
4539

@@ -202,8 +196,7 @@ a lifetime preceding the loop expression, as in `'foo: loop { break 'foo; }`,
202196
`'bar: while false {}`, `'humbug: for _ in 0..0 {}`.
203197
If a label is present, then labeled `break` and `continue` expressions nested
204198
within this loop may exit out of this loop or return control to its head.
205-
See [break expressions](#break-expressions) and [continue
206-
expressions](#continue-expressions).
199+
See [break expressions] and [continue expressions].
207200

208201
## `break` expressions
209202

@@ -226,7 +219,7 @@ assert_eq!(last, 12);
226219
```
227220

228221
A `break` expression is normally associated with the innermost `loop`, `for` or
229-
`while` loop enclosing the `break` expression, but a [label](#loop-labels) can
222+
`while` loop enclosing the `break` expression, but a [label][labels] can
230223
be used to specify which enclosing loop is affected. Example:
231224

232225
```rust
@@ -238,7 +231,7 @@ be used to specify which enclosing loop is affected. Example:
238231
```
239232

240233
A `break` expression is only permitted in the body of a loop, and has one of
241-
the forms `break`, `break 'label` or ([see below](#break-and-loop-values))
234+
the forms `break`, `break 'label` or ([see below][loop values])
242235
`break EXPR` or `break 'label EXPR`.
243236

244237
## `continue` expressions
@@ -282,12 +275,12 @@ and the `loop` must have a type compatible with each `break` expression.
282275
`break` without an expression is considered identical to `break` with
283276
expression `()`.
284277

285-
[IDENTIFIER]: identifiers.html
286-
[LIFETIME_OR_LABEL]: tokens.html#lifetimes-and-loop-labels
287-
[_BlockExpression_]: expressions/block-expr.html
288-
[_Expression_]: expressions.html
289-
[_MatchArmPatterns_]: expressions/match-expr.html
290-
[_Pattern_]: patterns.html
291-
[`match` expression]: expressions/match-expr.html
292-
[scrutinee]: glossary.html#scrutinee
293-
[temporary values]: expressions.html#temporary-lifetimes
278+
[IDENTIFIER]: ../identifiers.html
279+
[LIFETIME_OR_LABEL]: ../tokens.html#lifetimes-and-loop-labels
280+
[_BlockExpression_]: ../expressions/block-expr.html
281+
[_Expression_]: ../expressions.html
282+
[_MatchArmPatterns_]: ../expressions/match-expr.html
283+
[_Pattern_]: ../patterns.html
284+
[`match` expression]: ../expressions/match-expr.html
285+
[scrutinee]: ../glossary.html#scrutinee
286+
[temporary values]: ../expressions.html#temporary-lifetimes

0 commit comments

Comments
 (0)