Skip to content

Commit

Permalink
Update to Rust 1.41.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Feb 3, 2020
1 parent 1d0b5e6 commit a2bd349
Show file tree
Hide file tree
Showing 53 changed files with 147 additions and 146 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,7 @@ dist: trusty
language: rust
cache: cargo
rust:
- 1.40.0
- 1.41.0
branches:
only:
- master
Expand Down
4 changes: 2 additions & 2 deletions listings/ch02-guessing-game-tutorial/listing-02-04/output.txt
Expand Up @@ -10,8 +10,8 @@ error[E0308]: mismatched types
22 | match guess.cmp(&secret_number) {
| ^^^^^^^^^^^^^^ expected struct `std::string::String`, found integer
|
= note: expected type `&std::string::String`
found type `&{integer}`
= note: expected reference `&std::string::String`
found reference `&{integer}`

error: aborting due to previous error

Expand Down
Expand Up @@ -4,10 +4,7 @@ error[E0308]: mismatched types
--> src/main.rs:3:14
|
3 | spaces = spaces.len();
| ^^^^^^^^^^^^ expected &str, found usize
|
= note: expected type `&str`
found type `usize`
| ^^^^^^^^^^^^ expected `&str`, found `usize`

error: aborting due to previous error

Expand Down
Expand Up @@ -4,14 +4,11 @@ error[E0308]: mismatched types
--> src/main.rs:7:24
|
7 | fn plus_one(x: i32) -> i32 {
| -------- ^^^ expected i32, found ()
| -------- ^^^ expected `i32`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
8 | x + 1;
| - help: consider removing this semicolon
|
= note: expected type `i32`
found type `()`

error: aborting due to previous error

Expand Down
Expand Up @@ -4,10 +4,7 @@ error[E0308]: mismatched types
--> src/main.rs:4:8
|
4 | if number {
| ^^^^^^ expected bool, found integer
|
= note: expected type `bool`
found type `{integer}`
| ^^^^^^ expected `bool`, found integer

error: aborting due to previous error

Expand Down
Expand Up @@ -4,12 +4,9 @@ error[E0308]: if and else have incompatible types
--> src/main.rs:4:44
|
4 | let number = if condition { 5 } else { "six" };
| - ^^^^^ expected integer, found &str
| - ^^^^^ expected integer, found `&str`
| |
| expected because of this
|
= note: expected type `{integer}`
found type `&str`

error: aborting due to previous error

Expand Down
Expand Up @@ -2,5 +2,5 @@ $ cargo run
Compiling collections v0.1.0 (file:///projects/collections)
Finished dev [unoptimized + debuginfo] target(s) in 0.43s
Running `target/debug/collections`
thread 'main' panicked at 'byte index 1 is not a char boundary; it is inside 'З' (bytes 0..2) of `Здравствуйте`', src/libcore/str/mod.rs:2068:5
thread 'main' panicked at 'byte index 1 is not a char boundary; it is inside 'З' (bytes 0..2) of `Здравствуйте`', src/libcore/str/mod.rs:2069:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2 changes: 1 addition & 1 deletion listings/ch09-error-handling/listing-09-01/output.txt
Expand Up @@ -2,5 +2,5 @@ $ cargo run
Compiling panic v0.1.0 (file:///projects/panic)
Finished dev [unoptimized + debuginfo] target(s) in 0.27s
Running `target/debug/panic`
thread 'main' panicked at 'index out of bounds: the len is 3 but the index is 99', /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/slice/mod.rs:2796:10
thread 'main' panicked at 'index out of bounds: the len is 3 but the index is 99', /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src/libcore/slice/mod.rs:2806:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
Expand Up @@ -4,10 +4,12 @@ error[E0308]: mismatched types
--> src/main.rs:4:18
|
4 | let f: u32 = File::open("hello.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^ expected u32, found enum `std::result::Result`
| --- ^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found enum `std::result::Result`
| |
| expected due to this
|
= note: expected type `u32`
found type `std::result::Result<std::fs::File, std::io::Error>`
found enum `std::result::Result<std::fs::File, std::io::Error>`

error: aborting due to previous error

Expand Down
Expand Up @@ -3,8 +3,11 @@ $ cargo run
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> src/main.rs:4:13
|
4 | let f = File::open("hello.txt")?;
| ^^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
3 | / fn main() {
4 | | let f = File::open("hello.txt")?;
| | ^^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
5 | | }
| |_- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::from_error`
Expand Down
Expand Up @@ -5,9 +5,6 @@ error[E0308]: mismatched types
|
7 | let wont_work = Point { x: 5, y: 4.0 };
| ^^^ expected integer, found floating-point number
|
= note: expected type `{integer}`
found type `{float}`

error: aborting due to previous error

Expand Down
@@ -1,10 +1,10 @@
$ cargo run
Compiling chapter10 v0.1.0 (file:///projects/chapter10)
error[E0597]: `x` does not live long enough
--> src/main.rs:7:13
--> src/main.rs:7:17
|
7 | r = &x;
| ^^^^^^ borrowed value does not live long enough
| ^^ borrowed value does not live long enough
8 | }
| - `x` dropped here while still borrowed
9 |
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.57s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 1 test
test tests::it_works ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.72s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 2 tests
test tests::another ... FAILED
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling rectangle v0.1.0 (file:///projects/rectangle)
Finished test [unoptimized + debuginfo] target(s) in 0.66s
Running target/debug/deps/rectangle-6fe0c0eff9a70690
Running target/debug/deps/rectangle-6584c4561e48942e

running 1 test
test tests::larger_can_hold_smaller ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.58s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 1 test
test tests::it_adds_two ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished test [unoptimized + debuginfo] target(s) in 0.58s
Running target/debug/deps/guessing_game-1bf5eca04a7d401d
Running target/debug/deps/guessing_game-57d70c3acb738f4d

running 1 test
test tests::greater_than_100 ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling silly-function v0.1.0 (file:///projects/silly-function)
Finished test [unoptimized + debuginfo] target(s) in 0.58s
Running target/debug/deps/silly_function-b02a4796f0aeb021
Running target/debug/deps/silly_function-160869f38cff9166

running 2 tests
test tests::this_test_will_fail ... FAILED
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.62s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 3 tests
test tests::add_three_and_two ... ok
Expand Down
@@ -1,14 +1,14 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.73s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 1 test
test tests::internal ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Running target/debug/deps/integration_test-60fcbc66f73b2933
Running target/debug/deps/integration_test-82e7799c1bc62298

running 1 test
test it_adds_two ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.59s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 1 test
test tests::exploration ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling rectangle v0.1.0 (file:///projects/rectangle)
Finished test [unoptimized + debuginfo] target(s) in 0.66s
Running target/debug/deps/rectangle-6fe0c0eff9a70690
Running target/debug/deps/rectangle-6584c4561e48942e

running 2 tests
test tests::larger_can_hold_smaller ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling rectangle v0.1.0 (file:///projects/rectangle)
Finished test [unoptimized + debuginfo] target(s) in 0.66s
Running target/debug/deps/rectangle-6fe0c0eff9a70690
Running target/debug/deps/rectangle-6584c4561e48942e

running 2 tests
test tests::larger_can_hold_smaller ... FAILED
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.61s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 1 test
test tests::it_adds_two ... FAILED
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling greeter v0.1.0 (file:///projects/greeter)
Finished test [unoptimized + debuginfo] target(s) in 0.91s
Running target/debug/deps/greeter-01c2d86f487c60e6
Running target/debug/deps/greeter-170b942eb5bf5e3a

running 1 test
test tests::greeting_contains_name ... FAILED
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling greeter v0.1.0 (file:///projects/greeter)
Finished test [unoptimized + debuginfo] target(s) in 0.93s
Running target/debug/deps/greeter-01c2d86f487c60e6
Running target/debug/deps/greeter-170b942eb5bf5e3a

running 1 test
test tests::greeting_contains_name ... FAILED
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished test [unoptimized + debuginfo] target(s) in 0.62s
Running target/debug/deps/guessing_game-1bf5eca04a7d401d
Running target/debug/deps/guessing_game-57d70c3acb738f4d

running 1 test
test tests::greater_than_100 ... FAILED
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished test [unoptimized + debuginfo] target(s) in 0.66s
Running target/debug/deps/guessing_game-1bf5eca04a7d401d
Running target/debug/deps/guessing_game-57d70c3acb738f4d

running 1 test
test tests::greater_than_100 ... FAILED
Expand All @@ -11,7 +11,9 @@ failures:
---- tests::greater_than_100 stdout ----
thread 'main' panicked at 'Guess value must be greater than or equal to 1, got 200.', src/lib.rs:13:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
note: panic did not include expected string 'Guess value must be less than or equal to 100'
note: panic did not contain expected string
panic message: `"Guess value must be greater than or equal to 1, got 200."`,
expected substring: `"Guess value must be less than or equal to 100"`

failures:
tests::greater_than_100
Expand Down
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.60s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 2 tests
test expensive_test ... ignored
Expand Down
@@ -1,20 +1,20 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.89s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 1 test
test tests::internal ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Running target/debug/deps/common-a282abfe78e5b141
Running target/debug/deps/common-7064e1b6d2e271be

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Running target/debug/deps/integration_test-60fcbc66f73b2933
Running target/debug/deps/integration_test-82e7799c1bc62298

running 1 test
test it_adds_two ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test -- --show-output
Compiling silly-function v0.1.0 (file:///projects/silly-function)
Finished test [unoptimized + debuginfo] target(s) in 0.60s
Running target/debug/deps/silly_function-b02a4796f0aeb021
Running target/debug/deps/silly_function-160869f38cff9166

running 2 tests
test tests::this_test_will_fail ... FAILED
Expand Down
@@ -1,7 +1,7 @@
$ cargo test one_hundred
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.69s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 1 test
test tests::one_hundred ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test add
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.61s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 2 tests
test tests::add_three_and_two ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test -- --ignored
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.61s
Running target/debug/deps/adder-076f0528706a8604
Running target/debug/deps/adder-92948b65e88960b4

running 1 test
test expensive_test ... ok
Expand Down
@@ -1,7 +1,7 @@
$ cargo test --test integration_test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.64s
Running target/debug/deps/integration_test-60fcbc66f73b2933
Running target/debug/deps/integration_test-82e7799c1bc62298

running 1 test
test it_adds_two ... ok
Expand Down
2 changes: 1 addition & 1 deletion listings/ch12-an-io-project/listing-12-16/output.txt
@@ -1,7 +1,7 @@
$ cargo test
Compiling minigrep v0.1.0 (file:///projects/minigrep)
Finished test [unoptimized + debuginfo] target(s) in 0.97s
Running target/debug/deps/minigrep-7003bffd2dda3b01
Running target/debug/deps/minigrep-4672b652f7794785

running 1 test
test tests::one_result ... FAILED
Expand Down

0 comments on commit a2bd349

Please sign in to comment.