Skip to content

Commit 9c4b7a1

Browse files
committed
Added explanation of the inclusion of "&&" on the borrow operator production
1 parent b307133 commit 9c4b7a1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/expressions/operator-expr.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ let mut array = [-2, 3, 9];
8282
}
8383
```
8484

85+
For ease of typing, consecutive borrow expressions can be expressed by the
86+
single token `&&` as if they were separated:
87+
88+
```rust
89+
// same meanings:
90+
let a = && 10;
91+
let a = & & 10;
92+
93+
// same meanings:
94+
let a = && mut 10;
95+
let a = & & mut 10;
96+
```
97+
8598
## The dereference operator
8699

87100
> **<sup>Syntax</sup>**

0 commit comments

Comments
 (0)