Skip to content

Commit ea92a5e

Browse files
Use hello_world instead of the guessing_game
1 parent f2fa559 commit ea92a5e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/doc/guide.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ let x;
449449
...we'll get an error:
450450

451451
```{ignore}
452-
src/guessing_game.rs:2:9: 2:10 error: cannot determine a type for this local variable: unconstrained type
453-
src/guessing_game.rs:2 let x;
452+
src/hello_world.rs:2:9: 2:10 error: cannot determine a type for this local variable: unconstrained type
453+
src/hello_world.rs:2 let x;
454454
^
455455
```
456456

@@ -460,7 +460,7 @@ Giving it a type will compile, though:
460460
let x: int;
461461
```
462462

463-
Let's try it out. Change your `src/guessing_game.rs` file to look like this:
463+
Let's try it out. Change your `src/hello_world.rs` file to look like this:
464464

465465
```{rust}
466466
fn main() {
@@ -474,9 +474,9 @@ You can use `cargo build` on the command line to build it. You'll get a warning,
474474
but it will still print "Hello, world!":
475475

476476
```{ignore,notrust}
477-
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
478-
src/guessing_game.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)] on by default
479-
src/guessing_game.rs:2 let x: int;
477+
Compiling hello_world v0.1.0 (file:/home/you/projects/hello_world)
478+
src/hello_world.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)] on by default
479+
src/hello_world.rs:2 let x: int;
480480
^
481481
```
482482

@@ -496,16 +496,16 @@ And try to build it. You'll get an error:
496496

497497
```{bash}
498498
$ cargo build
499-
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
500-
src/guessing_game.rs:4:39: 4:40 error: use of possibly uninitialized variable: `x`
501-
src/guessing_game.rs:4 println!("The value of x is: {}", x);
499+
Compiling hello_world v0.1.0 (file:/home/you/projects/hello_world)
500+
src/hello_world.rs:4:39: 4:40 error: use of possibly uninitialized variable: `x`
501+
src/hello_world.rs:4 println!("The value of x is: {}", x);
502502
^
503503
note: in expansion of format_args!
504504
<std macros>:2:23: 2:77 note: expansion site
505505
<std macros>:1:1: 3:2 note: in expansion of println!
506-
src/guessing_game.rs:4:5: 4:42 note: expansion site
506+
src/hello_world.rs:4:5: 4:42 note: expansion site
507507
error: aborting due to previous error
508-
Could not execute process `rustc src/guessing_game.rs --crate-type bin --out-dir /home/you/projects/guessing_game/target -L /home/you/projects/guessing_game/target -L /home/you/projects/guessing_game/target/deps` (status=101)
508+
Could not execute process `rustc src/hello_world.rs --crate-type bin --out-dir /home/you/projects/hello_world/target -L /home/you/projects/hello_world/target -L /home/you/projects/hello_world/target/deps` (status=101)
509509
```
510510

511511
Rust will not let us use a value that has not been initialized. So why let us

0 commit comments

Comments
 (0)