@@ -45,6 +45,7 @@ _in_ that memory location. If value is of a type that implements `Copy`, then
45
45
the value will be copied. In other situations if the type of the value is
46
46
[ ` Sized ` ] ( the-sized-trait.html ) it may be possible to move the value. Only the
47
47
following lvalues may be moved out of:
48
+
48
49
* [ Variables] ( #variables.html ) which are not currently borrowed.
49
50
* [ Temporary values] ( #temporary-lifetimes ) .
50
51
* [ Fields] ( #field-expressions ) of an lvalue which can be moved out of and
@@ -65,6 +66,7 @@ contexts _mutable_ lvalue contexts, other lvalue contexts are called
65
66
_ immutable_ .
66
67
67
68
The following expressions can create mutable lvalues:
69
+
68
70
* Mutable [ variables] ( #variables.html ) , which are not currently borrowed.
69
71
* [ Mutable ` static ` items] ( items.html#mutable-statics ) .
70
72
* [ Temporary values] ( #temporary-lifetimes ) .
@@ -133,6 +135,7 @@ let b: &[i32] = &vec![1, 2, 3];
133
135
```
134
136
135
137
Implicit borrows may be taken in the following expressions:
138
+
136
139
* Left operand in [ method-call expressions] ( #method-call-expressions ) .
137
140
* Left operand in [ field expressions] ( #field-expressions ) .
138
141
* Left operand in [ call expressions] ( #call-expressions ) .
@@ -400,6 +403,7 @@ following order:
400
403
401
404
Note: that in steps 1-4 the receiver is used, not the type of ` Self ` , which may
402
405
not be the same as ` A ` . For example
406
+
403
407
``` rust
404
408
// `Self` is `&A`, receiver is `&A`.
405
409
impl <'a > Trait for & 'a A {
@@ -866,6 +870,7 @@ functions and macros in the standard library can then use that assumption
866
870
(although not to ensure safety). Unlike the arithmetic and logical operators
867
871
above, these operators implicitly take shared borrows of their operands,
868
872
evaluating them in lvalue context:
873
+
869
874
``` rust
870
875
a == b ;
871
876
// is equivalent to
@@ -884,6 +889,7 @@ This means that the operands don't have to be moved out of.
884
889
| ` <= ` | Less than or equal to | ` std::cmp::PartialOrd::le ` |
885
890
886
891
Here are examples of the comparison operators being used.
892
+
887
893
``` rust
888
894
assert! (123 == 123 );
889
895
assert! (23 != - 12 );
@@ -1092,7 +1098,7 @@ the loop conditional expression evaluates to `true`, the loop body block
1092
1098
executes, then control returns to the loop conditional expression. If the loop
1093
1099
conditional expression evaluates to ` false ` , the ` while ` expression completes.
1094
1100
1095
- An example:
1101
+ An example:
1096
1102
1097
1103
``` rust
1098
1104
let mut i = 0 ;
0 commit comments