diff options
| author | Toni Cárdenas <toni@tcardenas.me> | 2015-01-14 15:24:41 +0100 |
|---|---|---|
| committer | Toni Cárdenas <toni@tcardenas.me> | 2015-01-14 15:24:41 +0100 |
| commit | 428da78de10310744a33b5e5b7d85e1a11e8e7ed (patch) | |
| tree | d885a605a71f2eac85e4e6a2acabae0b7e331438 | |
| parent | d52398ef8cd93c6089ceacb176ae0dbe213d301e (diff) | |
| download | rust-428da78de10310744a33b5e5b7d85e1a11e8e7ed.tar.gz rust-428da78de10310744a33b5e5b7d85e1a11e8e7ed.zip | |
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.
| -rw-r--r-- | src/doc/trpl/closures.md | 2 |
1 files changed, 1 insertions, 1 deletions
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); }; |
