From 95f9e309f7307ace9218307f943f29662e21a1e5 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Mon, 12 Jan 2015 11:49:54 -0500 Subject: [PATCH] Clean up wording around uninitialized values. Fixes #20840 --- src/doc/trpl/variable-bindings.md | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/doc/trpl/variable-bindings.md b/src/doc/trpl/variable-bindings.md index 59085c5cf5d..e57fc7a1206 100644 --- a/src/doc/trpl/variable-bindings.md +++ b/src/doc/trpl/variable-bindings.md @@ -89,25 +89,7 @@ what you need, so it's not verboten. Let's get back to bindings. Rust variable bindings have one more aspect that differs from other languages: bindings are required to be initialized with a -value before you're allowed to use them. If we try... - -```{ignore} -let x; -``` - -...we'll get an error: - -```text -src/main.rs:2:9: 2:10 error: unable to infer enough type information about `_`; type annotations required -src/main.rs:2 let x; - ^ -``` - -Giving it a type will compile, though: - -```{rust} -let x: i32; -``` +value before you're allowed to use them. Let's try it out. Change your `src/main.rs` file to look like this: