Skip to content

Commit

Permalink
Merge pull request rust-lang#124 from brauliobz/unit_is_not_literal
Browse files Browse the repository at this point in the history
The unit value is not a literal, it is a tuple expression
  • Loading branch information
Havvy authored Oct 2, 2017
2 parents d512441 + f58d003 commit b5aeaa2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,9 @@ exist in `core::ops` and `core::cmp` with the same names.

A _literal expression_ consists of one of the [literal](tokens.html#literals)
forms described earlier. It directly describes a number, character, string,
boolean value, or the unit value.
or boolean value.

```rust
(); // unit type
"hello"; // string type
'5'; // character type
5; // integer type
Expand Down Expand Up @@ -272,6 +271,7 @@ values.
```rust
(0.0, 4.5);
("a", 4usize, true);
();
```

You can disambiguate a single-element tuple from a value in parentheses with a
Expand Down

0 comments on commit b5aeaa2

Please sign in to comment.