Skip to content

Commit

Permalink
Clean up wording around uninitialized values.
Browse files Browse the repository at this point in the history
Fixes #20840
  • Loading branch information
steveklabnik committed Jan 12, 2015
1 parent b21a6da commit 95f9e30
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/doc/trpl/variable-bindings.md
Expand Up @@ -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:

Expand Down

0 comments on commit 95f9e30

Please sign in to comment.