Operator-assignment expressions -> Compound assignment expressions.

Also add note about type.
This commit is contained in:
alexrp 2012-08-09 01:19:48 +02:00
parent febd7ee239
commit d67314d5fc

View File

@ -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