Skip to content

Commit 5012b85

Browse files
committed
auto merge of #15378 : mdinger/rust/Issue_15333, r=alexcrichton
Here's the issue: #15333 Tested it. It works. FYI, in case anyone doesn't know: keyboard shortcut `'` restricts text search to only links on Firefox allowing this to be checked easily.
2 parents 9766b49 + 4afe310 commit 5012b85

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/doc/rust.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ A temporary's lifetime equals the largest lifetime of any reference that points
25392539
#### Moved and copied types
25402540

25412541
When a [local variable](#memory-slots) is used
2542-
as an [rvalue](#lvalues-rvalues-and-temporaries)
2542+
as an [rvalue](#lvalues,-rvalues-and-temporaries)
25432543
the variable will either be moved or copied, depending on its type.
25442544
For types that contain [owning pointers](#pointer-types)
25452545
or values that implement the special trait `Drop`,
@@ -2562,7 +2562,7 @@ string, boolean value, or the unit value.
25622562
### Path expressions
25632563

25642564
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).
25662566

25672567
### Tuple expressions
25682568

@@ -2675,7 +2675,7 @@ foo().x;
26752675
(Struct {a: 10, b: 20}).a;
26762676
~~~~
26772677

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.
26792679
When the type providing the field inherits mutabilty, it can be [assigned](#assignment-expressions) to.
26802680

26812681
Also, if the type of the expression to the left of the dot is a pointer,
@@ -2711,7 +2711,7 @@ idx_expr : expr '[' expr ']' ;
27112711

27122712
[Vector](#vector-types)-typed expressions can be indexed by writing a
27132713
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.
27152715

27162716
Indices are zero-based, and may be of any integral type. Vector access
27172717
is bounds-checked at run-time. When the check fails, it will put the
@@ -2737,7 +2737,7 @@ before the expression they apply to.
27372737
: Negation. May only be applied to numeric types.
27382738
* `*`
27392739
: 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.
27412741
On non-pointer types, it calls the `deref` method of the `std::ops::Deref` trait, or the
27422742
`deref_mut` method of the `std::ops::DerefMut` trait (if implemented by the type and required
27432743
for an outer expression that will or could mutate the dereference), and produces the
@@ -2872,8 +2872,8 @@ fn avg(v: &[f64]) -> f64 {
28722872

28732873
#### Assignment expressions
28742874

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.
28772877

28782878
Evaluating an assignment expression [either copies or moves](#moved-and-copied-types) its right-hand operand to its left-hand operand.
28792879

@@ -3186,7 +3186,7 @@ fn main() {
31863186
~~~~
31873187

31883188
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).
31903190
If the head expression is an rvalue, it is
31913191
first evaluated into a temporary location, and the resulting value
31923192
is sequentially compared to the patterns in the arms until a match
@@ -3550,7 +3550,7 @@ There are four varieties of pointer in Rust:
35503550
: These point to memory _owned by some other value_.
35513551
References arise by (automatic) conversion from owning pointers, managed pointers,
35523552
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).
35543554
References are written `&content`, or in some cases `&'f content` for some lifetime-variable `f`,
35553555
for example `&int` means a reference to an integer.
35563556
Copying a reference is a "shallow" operation:
@@ -3852,7 +3852,7 @@ references to any boxes; the remainder of its heap is immediately freed.
38523852
A task's stack contains slots.
38533853

38543854
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.
38563856

38573857
A _local variable_ (or *stack-local* allocation) holds a value directly,
38583858
allocated within the stack's memory. The value is a part of the stack frame.

0 commit comments

Comments
 (0)