Skip to content

Proposed update to documentation to reflect 1-tuples being legal (as of 0.6) #5782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions doc/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -1653,11 +1653,12 @@ Path expressions are [lvalues](#lvalues-rvalues-and-temporaries).

### Tuple expressions

Tuples are written by enclosing two or more comma-separated
Tuples are written by enclosing one or more comma-separated
expressions in parentheses. They are used to create [tuple-typed](#tuple-types)
values.

~~~~~~~~ {.tuple}
(0,);
(0f, 4.5f);
("a", 4u, true);
~~~~~~~~
Expand Down Expand Up @@ -2578,7 +2579,7 @@ to the record type-constructor. The differences are as follows:

Tuple types and values are denoted by listing the types or values of their
elements, respectively, in a parenthesized, comma-separated
list. Single-element tuples are not legal; all tuples have two or more values.
list.

The members of a tuple are laid out in memory contiguously, like a record, in
order specified by the tuple type.
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ fn area(sh: Shape) -> float {

Tuples in Rust behave exactly like structs, except that their fields
do not have names. Thus, you cannot access their fields with dot notation.
Tuples can have any arity except for 0 or 1 (though you may consider
Tuples can have any arity except for 0 (though you may consider
unit, `()`, as the empty tuple if you like).

~~~~
Expand Down