Merge pull request #3158 from alexrp/incoming
Operator-assignment expressions -> Compound assignment expressions.
This commit is contained in:
commit
1ffaceb3c8
1 changed files with 3 additions and 1 deletions
|
@ -1927,13 +1927,15 @@ x <- copy y;
|
|||
|
||||
The former is just more terse and familiar.
|
||||
|
||||
#### Operator-assignment expressions
|
||||
#### Compound assignment expressions
|
||||
|
||||
The `+`, `-`, `*`, `/`, `%`, `&`, `|`, `^`, `<<`, `>>`, and `>>>`
|
||||
operators may be composed with the `=` operator. The expression `lval
|
||||
OP= val` is equivalent to `lval = lval OP val`. For example, `x = x +
|
||||
1` may be written as `x += 1`.
|
||||
|
||||
Any such expression always has the [`nil`](#primitive-types) type.
|
||||
|
||||
#### Operator precedence
|
||||
|
||||
The precedence of Rust binary operators is ordered as follows, going
|
||||
|
|
Loading…
Add table
Reference in a new issue