From d67314d5fcfeb75da8281794f8e6af3583705c2f Mon Sep 17 00:00:00 2001 From: alexrp Date: Thu, 9 Aug 2012 01:19:48 +0200 Subject: [PATCH] Operator-assignment expressions -> Compound assignment expressions. Also add note about type. --- doc/rust.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/rust.md b/doc/rust.md index cbe4525eac1..43c7d5dfc36 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