@@ -40,14 +40,13 @@ assert_eq!(y, 20);
40
40
41
41
The ` & ` (shared borrow) and ` &mut ` (mutable borrow) operators are unary prefix
42
42
operators. When applied to a [ place expression] , this expressions produces a
43
- reference (pointer) to the location that the value refers to. The place is also
44
- placed into a borrowed state for the duration of the reference. For a shared
45
- borrow (` & ` ), this implies that the place may not be mutated, but it may be read
46
- or shared again. For a mutable borrow (` &mut ` ), the place may not be accessed in
47
- any way until the borrow expires. ` &mut ` evaluates its operand in a mutable
48
- place expression context. If the ` & ` or ` &mut ` operators are applied to a [ value
49
- expression] , then a temporary value is created; the lifetime of this temporary
50
- value is defined by [ syntactic rules] .
43
+ reference (pointer) to the location that the value refers to. The memory
44
+ location is also placed into a borrowed state for the duration of the reference.
45
+ For a shared borrow (` & ` ), this implies that the place may not be mutated, but
46
+ it may be read or shared again. For a mutable borrow (` &mut ` ), the place may not
47
+ be accessed in any way until the borrow expires. ` &mut ` evaluates its operand in
48
+ a mutable place expression context. If the ` & ` or ` &mut ` operators are applied
49
+ to a [ value expression] , then a [ temporary value] is created.
51
50
52
51
These operators cannot be overloaded.
53
52
@@ -70,8 +69,8 @@ The `*` (dereference) operator is also a unary prefix operator. When applied to
70
69
a [ pointer] ( types.html#pointer-types ) it denotes the pointed-to location. If
71
70
the expression is of type ` &mut T ` and ` *mut T ` , and is either a local
72
71
variable, a (nested) field of a local variance or is a mutable [ place
73
- expression] , then the resulting place can be assigned to. Dereferencing a raw
74
- pointer requires ` unsafe ` .
72
+ expression] , then the resulting memory location can be assigned to.
73
+ Dereferencing a raw pointer requires ` unsafe ` .
75
74
76
75
On non-pointer types ` *x ` is equivalent to ` *std::ops::Deref::deref(&x) ` in an
77
76
[ immutable place expression context] ( expressions.html#mutability ) and
@@ -336,7 +335,7 @@ assert_eq!(x, 14);
336
335
337
336
[ place expression ] : expressions.html#place-expressions-and-value-expressions
338
337
[ value expression ] : expressions.html#place-expressions-and-value-expressions
339
- [ syntactic rules ] : expressions.html#temporary-lifetimes
338
+ [ temporary value ] : expressions.html#temporary-lifetimes
340
339
[ float-int ] : https://github.com/rust-lang/rust/issues/10184
341
340
[ float-float ] : https://github.com/rust-lang/rust/issues/15536
342
341
[ `unit` type ] : types.html#tuple-types
0 commit comments