mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Operator-assignment expressions -> Compound assignment expressions.
Also add note about type.
This commit is contained in:
parent
febd7ee239
commit
d67314d5fc
@ -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…
Reference in New Issue
Block a user