@@ -2539,7 +2539,7 @@ A temporary's lifetime equals the largest lifetime of any reference that points
2539
2539
#### Moved and copied types
2540
2540
2541
2541
When a [ local variable] ( #memory-slots ) is used
2542
- as an [ rvalue] ( #lvalues-rvalues-and-temporaries )
2542
+ as an [ rvalue] ( #lvalues, -rvalues-and-temporaries )
2543
2543
the variable will either be moved or copied, depending on its type.
2544
2544
For types that contain [ owning pointers] ( #pointer-types )
2545
2545
or values that implement the special trait ` Drop ` ,
@@ -2562,7 +2562,7 @@ string, boolean value, or the unit value.
2562
2562
### Path expressions
2563
2563
2564
2564
A [ path] ( #paths ) used as an expression context denotes either a local variable or an item.
2565
- Path expressions are [ lvalues] ( #lvalues-rvalues-and-temporaries ) .
2565
+ Path expressions are [ lvalues] ( #lvalues, -rvalues-and-temporaries ) .
2566
2566
2567
2567
### Tuple expressions
2568
2568
@@ -2675,7 +2675,7 @@ foo().x;
2675
2675
(Struct {a: 10, b: 20}).a;
2676
2676
~~~~
2677
2677
2678
- A field access is an [ lvalue] ( #lvalues-rvalues-and-temporaries ) referring to the value of that field.
2678
+ A field access is an [ lvalue] ( #lvalues, -rvalues-and-temporaries ) referring to the value of that field.
2679
2679
When the type providing the field inherits mutabilty, it can be [ assigned] ( #assignment-expressions ) to.
2680
2680
2681
2681
Also, if the type of the expression to the left of the dot is a pointer,
@@ -2711,7 +2711,7 @@ idx_expr : expr '[' expr ']' ;
2711
2711
2712
2712
[ Vector] ( #vector-types ) -typed expressions can be indexed by writing a
2713
2713
square-bracket-enclosed expression (the index) after them. When the
2714
- vector is mutable, the resulting [ lvalue] ( #lvalues-rvalues-and-temporaries ) can be assigned to.
2714
+ vector is mutable, the resulting [ lvalue] ( #lvalues, -rvalues-and-temporaries ) can be assigned to.
2715
2715
2716
2716
Indices are zero-based, and may be of any integral type. Vector access
2717
2717
is bounds-checked at run-time. When the check fails, it will put the
@@ -2737,7 +2737,7 @@ before the expression they apply to.
2737
2737
: Negation. May only be applied to numeric types.
2738
2738
* ` * `
2739
2739
: Dereference. When applied to a [ pointer] ( #pointer-types ) it denotes the pointed-to location.
2740
- For pointers to mutable locations, the resulting [ lvalue] ( #lvalues-rvalues-and-temporaries ) can be assigned to.
2740
+ For pointers to mutable locations, the resulting [ lvalue] ( #lvalues, -rvalues-and-temporaries ) can be assigned to.
2741
2741
On non-pointer types, it calls the ` deref ` method of the ` std::ops::Deref ` trait, or the
2742
2742
` deref_mut ` method of the ` std::ops::DerefMut ` trait (if implemented by the type and required
2743
2743
for an outer expression that will or could mutate the dereference), and produces the
@@ -2872,8 +2872,8 @@ fn avg(v: &[f64]) -> f64 {
2872
2872
2873
2873
#### Assignment expressions
2874
2874
2875
- An _ assignment expression_ consists of an [ lvalue] ( #lvalues-rvalues-and-temporaries ) expression followed by an
2876
- equals sign (` = ` ) and an [ rvalue] ( #lvalues-rvalues-and-temporaries ) expression.
2875
+ An _ assignment expression_ consists of an [ lvalue] ( #lvalues, -rvalues-and-temporaries ) expression followed by an
2876
+ equals sign (` = ` ) and an [ rvalue] ( #lvalues, -rvalues-and-temporaries ) expression.
2877
2877
2878
2878
Evaluating an assignment expression [ either copies or moves] ( #moved-and-copied-types ) its right-hand operand to its left-hand operand.
2879
2879
@@ -3186,7 +3186,7 @@ fn main() {
3186
3186
~~~~
3187
3187
3188
3188
A ` match ` behaves differently depending on whether or not the head expression
3189
- is an [ lvalue or an rvalue] ( #lvalues-rvalues-and-temporaries ) .
3189
+ is an [ lvalue or an rvalue] ( #lvalues, -rvalues-and-temporaries ) .
3190
3190
If the head expression is an rvalue, it is
3191
3191
first evaluated into a temporary location, and the resulting value
3192
3192
is sequentially compared to the patterns in the arms until a match
@@ -3550,7 +3550,7 @@ There are four varieties of pointer in Rust:
3550
3550
: These point to memory _ owned by some other value_ .
3551
3551
References arise by (automatic) conversion from owning pointers, managed pointers,
3552
3552
or by applying the borrowing operator ` & ` to some other value,
3553
- including [ lvalues, rvalues or temporaries] ( #lvalues-rvalues-and-temporaries ) .
3553
+ including [ lvalues, rvalues or temporaries] ( #lvalues, -rvalues-and-temporaries ) .
3554
3554
References are written ` &content ` , or in some cases ` &'f content ` for some lifetime-variable ` f ` ,
3555
3555
for example ` &int ` means a reference to an integer.
3556
3556
Copying a reference is a "shallow" operation:
@@ -3852,7 +3852,7 @@ references to any boxes; the remainder of its heap is immediately freed.
3852
3852
A task's stack contains slots.
3853
3853
3854
3854
A _ slot_ is a component of a stack frame, either a function parameter,
3855
- a [ temporary] ( #lvalues-rvalues-and-temporaries ) , or a local variable.
3855
+ a [ temporary] ( #lvalues, -rvalues-and-temporaries ) , or a local variable.
3856
3856
3857
3857
A _ local variable_ (or * stack-local* allocation) holds a value directly,
3858
3858
allocated within the stack's memory. The value is a part of the stack frame.
0 commit comments