]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #15121 : steveklabnik/rust/matching_docs, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 25 Jun 2014 15:21:26 +0000 (15:21 +0000)
committerbors <bors@rust-lang.org>
Wed, 25 Jun 2014 15:21:26 +0000 (15:21 +0000)
Fixes #11113.

src/doc/tutorial.md

index d4f446b29334ffb17d756d1dae8c804262d0a3cc..65ed2680dd654d493b5b7949b21e0ac0ac62b580 100644 (file)
@@ -566,9 +566,14 @@ tuple, introducing two variables at once: `a` and `b`.
 let (a, b) = get_tuple_of_two_ints();
 ~~~~
 
-Let bindings only work with _irrefutable_ patterns: that is, patterns
-that can never fail to match. This excludes `let` from matching
-literals and most `enum` variants.
+Let bindings only work with _irrefutable_ patterns: that is, patterns that can
+never fail to match. This excludes `let` from matching literals and most `enum`
+variants as binding patterns, since most such patterns are not irrefutable. For
+example, this will not compile:
+
+~~~~{ignore}
+let (a, 2) = (1, 2);
+~~~~
 
 ## Loops