about summary refs log tree commit diff
path: root/src/doc/trpl
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2015-04-30 13:55:03 -0400
committerSteve Klabnik <steve@steveklabnik.com>2015-04-30 15:10:58 -0400
commit8c38dfd537eba8947d2397b9e3f4a56bdb0647fe (patch)
tree766ede710256354a250271d847be65f5d7b87f96 /src/doc/trpl
parent2f613bfaeb81ce25b116835a5f09750384b888c7 (diff)
downloadrust-8c38dfd537eba8947d2397b9e3f4a56bdb0647fe.tar.gz
rust-8c38dfd537eba8947d2397b9e3f4a56bdb0647fe.zip
Describe (a,) vs (a) in docs
Fixes #24730
Diffstat (limited to 'src/doc/trpl')
-rw-r--r--src/doc/trpl/primitive-types.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/doc/trpl/primitive-types.md b/src/doc/trpl/primitive-types.md
index aca6e327c3b..e017e222c74 100644
--- a/src/doc/trpl/primitive-types.md
+++ b/src/doc/trpl/primitive-types.md
@@ -248,6 +248,14 @@ or “breaks up” the tuple, and assigns the bits to three bindings.
 
 This pattern is very powerful, and we’ll see it repeated more later.
 
+You can disambiguate a single-element tuple from a value in parentheses with a
+comma:
+
+```
+(0,); // single-element tuple
+(0); // zero in parentheses
+```
+
 ## Tuple Indexing
 
 You can also access fields of a tuple with indexing syntax: