Skip to content

Commit 18f1f5a

Browse files
committed
guide: Remove reference to uninitialized bindings
There isn't a good way to fit this in, so let's just not mention it. Fixes #16792.
1 parent 6f34760 commit 18f1f5a

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/doc/guide.md

+2-11
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,8 @@ error: aborting due to previous error
520520
Could not compile `hello_world`.
521521
```
522522

523-
Rust will not let us use a value that has not been initialized. So why let us
524-
declare a binding without initializing it? You'd think our first example would
525-
have errored. Well, Rust is smarter than that. Before we get to that, let's talk
526-
about this stuff we've added to `println!`.
523+
Rust will not let us use a value that has not been initialized. Next, let's
524+
talk about this stuff we've added to `println!`.
527525

528526
If you include two curly braces (`{}`, some call them moustaches...) in your
529527
string to print, Rust will interpret this as a request to interpolate some sort
@@ -538,12 +536,6 @@ format in a more detailed manner, there are a [wide number of options
538536
available](std/fmt/index.html). For now, we'll just stick to the default:
539537
integers aren't very complicated to print.
540538

541-
So, we've cleared up all of the confusion around bindings, with one exception:
542-
why does Rust let us declare a variable binding without an initial value if we
543-
must initialize the binding before we use it? And how does it know that we have
544-
or have not initialized the binding? For that, we need to learn our next
545-
concept: `if`.
546-
547539
# If
548540

549541
Rust's take on `if` is not particularly complex, but it's much more like the
@@ -582,7 +574,6 @@ if x == 5i {
582574

583575
This is all pretty standard. However, you can also do this:
584576

585-
586577
```
587578
let x = 5i;
588579

0 commit comments

Comments
 (0)