diff --git a/doc/rust.md b/doc/rust.md index cbe4525eac1d8..43c7d5dfc368f 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -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