@@ -342,7 +342,7 @@ Once you have this file in place, we should be ready to build! Try this:
342
342
343
343
``` {bash}
344
344
$ cargo build
345
- Compiling hello_world v0.1.0 (file:///home/yourname/projects/hello_world)
345
+ Compiling hello_world v0.0.1 (file:///home/yourname/projects/hello_world)
346
346
$ ./target/hello_world
347
347
Hello, world!
348
348
```
@@ -486,7 +486,7 @@ You can use `cargo build` on the command line to build it. You'll get a warning,
486
486
but it will still print "Hello, world!":
487
487
488
488
``` {ignore,notrust}
489
- Compiling hello_world v0.1.0 (file:///home/you/projects/hello_world)
489
+ Compiling hello_world v0.0.1 (file:///home/you/projects/hello_world)
490
490
src/hello_world.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)] on by default
491
491
src/hello_world.rs:2 let x: int;
492
492
^
@@ -508,7 +508,7 @@ And try to build it. You'll get an error:
508
508
509
509
``` {bash}
510
510
$ cargo build
511
- Compiling hello_world v0.1.0 (file:///home/you/projects/hello_world)
511
+ Compiling hello_world v0.0.1 (file:///home/you/projects/hello_world)
512
512
src/hello_world.rs:4:39: 4:40 error: use of possibly uninitialized variable: `x`
513
513
src/hello_world.rs:4 println!("The value of x is: {}", x);
514
514
^
@@ -2279,7 +2279,7 @@ print an error message and return. Let's give this a shot:
2279
2279
2280
2280
``` {notrust,ignore}
2281
2281
$ cargo build
2282
- Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2282
+ Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2283
2283
$ ./target/guessing_game
2284
2284
Guess the number!
2285
2285
The secret number is: 17
@@ -2671,7 +2671,7 @@ Let's double check our work by compiling:
2671
2671
2672
2672
``` {bash,ignore}
2673
2673
$ cargo build
2674
- Compiling modules v0.1.0 (file:///home/you/projects/modules)
2674
+ Compiling modules v0.0.1 (file:///home/you/projects/modules)
2675
2675
$ ./target/modules
2676
2676
Hello, world!
2677
2677
```
@@ -2732,7 +2732,7 @@ mod hello {
2732
2732
It gives an error:
2733
2733
2734
2734
``` {notrust,ignore}
2735
- Compiling modules v0.1.0 (file:///home/you/projects/modules)
2735
+ Compiling modules v0.0.1 (file:///home/you/projects/modules)
2736
2736
src/main.rs:2:5: 2:23 error: function `print_hello` is private
2737
2737
src/main.rs:2 hello::print_hello();
2738
2738
^~~~~~~~~~~~~~~~~~
@@ -2756,7 +2756,7 @@ This will work:
2756
2756
2757
2757
``` {notrust,ignore}
2758
2758
$ cargo build
2759
- Compiling modules v0.1.0 (file:///home/you/projects/modules)
2759
+ Compiling modules v0.0.1 (file:///home/you/projects/modules)
2760
2760
$
2761
2761
```
2762
2762
@@ -2766,7 +2766,7 @@ Try it out:
2766
2766
2767
2767
``` {notrust,ignore}
2768
2768
$ cargo run
2769
- Compiling modules v0.1.0 (file:///home/steve/tmp/modules)
2769
+ Compiling modules v0.0.1 (file:///home/steve/tmp/modules)
2770
2770
Running `target/modules`
2771
2771
Hello, world!
2772
2772
$
@@ -2816,7 +2816,7 @@ This doesn't _quite_ work yet. Try it:
2816
2816
2817
2817
``` {notrust,ignore}
2818
2818
$ cargo build
2819
- Compiling modules v0.1.0 (file:///home/you/projects/modules)
2819
+ Compiling modules v0.0.1 (file:///home/you/projects/modules)
2820
2820
/home/you/projects/modules/src/lib.rs:2:5: 4:6 warning: code is never used: `print_hello`, #[warn(dead_code)] on by default
2821
2821
/home/you/projects/modules/src/lib.rs:2 pub fn print_hello() {
2822
2822
/home/you/projects/modules/src/lib.rs:3 println!("Hello, world!");
@@ -2852,7 +2852,7 @@ And everything should work:
2852
2852
2853
2853
``` {notrust,ignore}
2854
2854
$ cargo run
2855
- Compiling modules v0.1.0 (file:///home/you/projects/modules)
2855
+ Compiling modules v0.0.1 (file:///home/you/projects/modules)
2856
2856
Running `target/modules`
2857
2857
Hello, world!
2858
2858
```
@@ -2918,7 +2918,7 @@ This should all compile as usual:
2918
2918
2919
2919
``` {notrust,ignore}
2920
2920
$ cargo build
2921
- Compiling modules v0.1.0 (file:///home/you/projects/modules)
2921
+ Compiling modules v0.0.1 (file:///home/you/projects/modules)
2922
2922
$
2923
2923
```
2924
2924
@@ -3090,7 +3090,7 @@ And try it out:
3090
3090
3091
3091
``` {notrust,ignore}
3092
3092
$ cargo run
3093
- Compiling testing v0.1.0 (file:///home/you/projects/testing)
3093
+ Compiling testing v0.0.1 (file:///home/you/projects/testing)
3094
3094
Running `target/testing`
3095
3095
Hello, world!
3096
3096
$
@@ -3123,7 +3123,7 @@ it `false`, so this test should fail. Let's try it!
3123
3123
3124
3124
``` {notrust,ignore}
3125
3125
$ cargo test
3126
- Compiling testing v0.1.0 (file:///home/you/projects/testing)
3126
+ Compiling testing v0.0.1 (file:///home/you/projects/testing)
3127
3127
/home/you/projects/testing/src/main.rs:1:1: 3:2 warning: code is never used: `main`, #[warn(dead_code)] on by default
3128
3128
/home/you/projects/testing/src/main.rs:1 fn main() {
3129
3129
/home/you/projects/testing/src/main.rs:2 println!("Hello, world");
@@ -3156,7 +3156,7 @@ Lots of output! Let's break this down:
3156
3156
3157
3157
``` {notrust,ignore}
3158
3158
$ cargo test
3159
- Compiling testing v0.1.0 (file:///home/you/projects/testing)
3159
+ Compiling testing v0.0.1 (file:///home/you/projects/testing)
3160
3160
```
3161
3161
3162
3162
You can run all of your tests with ` cargo test ` . This runs both your tests in
@@ -3231,7 +3231,7 @@ And then try to run our tests again:
3231
3231
3232
3232
``` {notrust,ignore}
3233
3233
$ cargo test
3234
- Compiling testing v0.1.0 (file:///home/you/projects/testing)
3234
+ Compiling testing v0.0.1 (file:///home/you/projects/testing)
3235
3235
/home/you/projects/testing/src/main.rs:1:1: 3:2 warning: code is never used: `main`, #[warn(dead_code)] on by default
3236
3236
/home/you/projects/testing/src/main.rs:1 fn main() {
3237
3237
/home/you/projects/testing/src/main.rs:2 println!("Hello, world");
@@ -3270,7 +3270,7 @@ With this attribute, we won't get the warning:
3270
3270
3271
3271
``` {notrust,ignore}
3272
3272
$ cargo test
3273
- Compiling testing v0.1.0 (file:///home/you/projects/testing)
3273
+ Compiling testing v0.0.1 (file:///home/you/projects/testing)
3274
3274
3275
3275
running 0 tests
3276
3276
@@ -3299,7 +3299,7 @@ And try to run the test:
3299
3299
3300
3300
``` {notrust,ignore}
3301
3301
$ cargo test
3302
- Compiling testing v0.1.0 (file:///home/youg/projects/testing)
3302
+ Compiling testing v0.0.1 (file:///home/youg/projects/testing)
3303
3303
/home/youg/projects/testing/tests/lib.rs:3:18: 3:38 error: unresolved name `add_three_times_four`.
3304
3304
/home/youg/projects/testing/tests/lib.rs:3 let result = add_three_times_four(5i);
3305
3305
^~~~~~~~~~~~~~~~~~~~
@@ -3358,7 +3358,7 @@ Let's give it a run:
3358
3358
3359
3359
``` {ignore,notrust}
3360
3360
$ cargo test
3361
- Compiling testing v0.1.0 (file:///home/you/projects/testing)
3361
+ Compiling testing v0.0.1 (file:///home/you/projects/testing)
3362
3362
3363
3363
running 0 tests
3364
3364
@@ -3398,7 +3398,7 @@ If you run `cargo test`, you should get the same output:
3398
3398
3399
3399
``` {ignore,notrust}
3400
3400
$ cargo test
3401
- Compiling testing v0.1.0 (file:///home/you/projects/testing)
3401
+ Compiling testing v0.0.1 (file:///home/you/projects/testing)
3402
3402
3403
3403
running 0 tests
3404
3404
@@ -3442,7 +3442,7 @@ fn test_add_three() {
3442
3442
We'd get this error:
3443
3443
3444
3444
``` {notrust,ignore}
3445
- Compiling testing v0.1.0 (file:///home/you/projects/testing)
3445
+ Compiling testing v0.0.1 (file:///home/you/projects/testing)
3446
3446
/home/you/projects/testing/tests/lib.rs:3:5: 3:24 error: function `add_three` is private
3447
3447
/home/you/projects/testing/tests/lib.rs:3 use testing::add_three;
3448
3448
^~~~~~~~~~~~~~~~~~~
@@ -3485,7 +3485,7 @@ Let's give it a shot:
3485
3485
3486
3486
``` {ignore,notrust}
3487
3487
$ cargo test
3488
- Compiling testing v0.1.0 (file:///home/you/projects/testing)
3488
+ Compiling testing v0.0.1 (file:///home/you/projects/testing)
3489
3489
3490
3490
running 1 test
3491
3491
test test::test_times_four ... ok
0 commit comments