From 53627dd1f21820f295d366fc491e5fa88be40fd1 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Mon, 23 Jun 2014 14:02:42 -0400 Subject: [PATCH] Make an example more clear with sample code. Fixes #11113. --- src/doc/tutorial.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index e6d9cef7a3108..ba80444aaa3e3 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -559,9 +559,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