summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/rust.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/rust.md b/doc/rust.md
index 3a3c371accd..210e07d198a 100644
--- a/doc/rust.md
+++ b/doc/rust.md
@@ -876,6 +876,13 @@ fn add(x: int, y: int) -> int {
}
~~~~
+As with `let` bindings, function arguments are irrefutable patterns,
+so any pattern that is valid in a let binding is also valid as an argument.
+
+~~~
+fn first((value, _): (int, int)) -> int { value }
+~~~
+
#### Generic functions