From 428da78de10310744a33b5e5b7d85e1a11e8e7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20C=C3=A1rdenas?= Date: Wed, 14 Jan 2015 15:24:41 +0100 Subject: [PATCH] TRPL: Anti-example failing for the wrong reason. Really small correction. This anti-example in the Closures section is supposed to fail because of a borrow, but it was failing at the type inference because of insufficient type information. This makes it fail for the expected reason. --- src/doc/trpl/closures.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/trpl/closures.md b/src/doc/trpl/closures.md index 5b49df92fe3..51a0bb69a7c 100644 --- a/src/doc/trpl/closures.md +++ b/src/doc/trpl/closures.md @@ -51,7 +51,7 @@ defined. The closure borrows any variables it uses, so this will error: ```{rust,ignore} fn main() { - let mut x = 5; + let mut x: i32 = 5; let printer = |&:| { println!("x is: {}", x); };