Skip to content

Commit e79d1ef

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

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
@@ -85,6 +85,19 @@ let mut array = [-2, 3, 9];
8585
}
8686
```
8787

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

90103
> **<sup>Syntax</sup>**

0 commit comments

Comments
 (0)