Skip to content

Clean up wording around uninitialized values. #21023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions src/doc/trpl/variable-bindings.md
Original file line number Diff line number Diff line change
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