Skip to content

Commit

Permalink
Auto merge of #24738 - joliv:patch-2, r=steveklabnik
Browse files Browse the repository at this point in the history
The "unit value" is a value of the "unit type," not the "unit value type." Regardless of correctness, this straight syntax is easier to grok.

Part of #16676

Sorry if something's off here, it's my first pull request to rust!
  • Loading branch information
bors committed Jun 16, 2015
2 parents 520a471 + b87056f commit 1035645
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/doc/reference.md
Expand Up @@ -638,7 +638,7 @@ apply to the crate as a whole.
```

A crate that contains a `main` function can be compiled to an executable. If a
`main` function is present, its return type must be [`unit`](#primitive-types)
`main` function is present, its return type must be [`unit`](#tuple-types)
and it must take no arguments.

# Items and attributes
Expand Down Expand Up @@ -2873,7 +2873,7 @@ 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 [`unit`](#primitive-types) type.
Any such expression always has the [`unit`](#tuple-types) type.

#### Operator precedence

Expand Down Expand Up @@ -3315,6 +3315,9 @@ assert!(b != "world");
assert!(p.0 == 10);
```

For historical reasons and convenience, the tuple type with no elements (`()`)
is often called ‘unit’ or ‘the unit type’.

### Array, and Slice types

Rust has two different types for a list of items:
Expand Down

0 comments on commit 1035645

Please sign in to comment.