Rollup merge of #26174 - mcast:trpl-assignment-empty-tuple, r=steveklabnik

Doc patch for #26120.  Extra words here, because "value" is repeated.

I haven't read about whether/how it should go to stable (sorry), but I think it would help newcomers.

Thanks,
This commit is contained in:
Manish Goregaokar 2015-06-10 22:07:10 +05:30
commit c8519c9793

View File

@ -144,7 +144,9 @@ an expression, and a `let` can only begin a statement, not an expression.
Note that assigning to an already-bound variable (e.g. `y = 5`) is still an
expression, although its value is not particularly useful. Unlike other
languages where an assignment evaluates to the assigned value (e.g. `5` in the
previous example), in Rust the value of an assignment is an empty tuple `()`:
previous example), in Rust the value of an assignment is an empty tuple `()`
because the assigned value can have [just one owner](ownership.html), and any
other returned value would be too surprising:
```rust
let mut y = 5;