Skip to content

Commit 5b09b84

Browse files
committed
Merge pull request #21023 from steveklabnik/gh20840
Clean up wording around uninitialized values. Reviewed-by: alexcrichton
2 parents b351357 + 95f9e30 commit 5b09b84

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/doc/trpl/variable-bindings.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,7 @@ what you need, so it's not verboten.
8989

9090
Let's get back to bindings. Rust variable bindings have one more aspect that
9191
differs from other languages: bindings are required to be initialized with a
92-
value before you're allowed to use them. If we try...
93-
94-
```{ignore}
95-
let x;
96-
```
97-
98-
...we'll get an error:
99-
100-
```text
101-
src/main.rs:2:9: 2:10 error: unable to infer enough type information about `_`; type annotations required
102-
src/main.rs:2 let x;
103-
^
104-
```
105-
106-
Giving it a type will compile, though:
107-
108-
```{rust}
109-
let x: i32;
110-
```
92+
value before you're allowed to use them.
11193

11294
Let's try it out. Change your `src/main.rs` file to look like this:
11395

0 commit comments

Comments
 (0)