Skip to content

Commit 3fc50dc

Browse files
author
Bryan Dunsmore
committed
---
yaml --- r: 55962 b: refs/heads/auto c: f0d0cbf h: refs/heads/master v: v3
1 parent 0b5a94b commit 3fc50dc

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: ac9e694d595a95c75fd96b149bf5e7edce366027
17+
refs/heads/auto: f0d0cbfff8d1aadda1cdb3b914361f3355c9a9cc
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/doc/rust.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,12 +1653,11 @@ Path expressions are [lvalues](#lvalues-rvalues-and-temporaries).
16531653

16541654
### Tuple expressions
16551655

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

16601660
~~~~~~~~ {.tuple}
1661-
(0,);
16621661
(0f, 4.5f);
16631662
("a", 4u, true);
16641663
~~~~~~~~
@@ -2579,7 +2578,7 @@ to the record type-constructor. The differences are as follows:
25792578

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

25842583
The members of a tuple are laid out in memory contiguously, like a record, in
25852584
order specified by the tuple type.

branches/auto/doc/tutorial.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,10 @@ omitted.
495495

496496
A powerful application of pattern matching is *destructuring*:
497497
matching in order to bind names to the contents of data
498-
types. Assuming that `(float, float)` is a tuple of two floats:
498+
types.
499+
500+
> ***Note:*** The following code makes use of tuples (`(float, float)`) which
501+
> are explained later. For now you can think of tuples as a list of items.
499502
500503
~~~~
501504
fn angle(vector: (float, float)) -> float {
@@ -747,7 +750,7 @@ fn area(sh: Shape) -> float {
747750

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

753756
~~~~

0 commit comments

Comments
 (0)