mirror of https://github.com/rust-lang/book
Update to Rust 1.40
This commit is contained in:
parent
3c3484974a
commit
c642b72fc9
|
@ -3,7 +3,7 @@ dist: trusty
|
|||
language: rust
|
||||
cache: cargo
|
||||
rust:
|
||||
- 1.39.0
|
||||
- 1.40.0
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
|
|
@ -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/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/slice/mod.rs:2717:10
|
||||
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
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.22s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.57s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 1 test
|
||||
test tests::it_works ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.90s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.72s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 2 tests
|
||||
test tests::another ... FAILED
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling rectangle v0.1.0 (file:///projects/rectangle)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.74s
|
||||
Running target/debug/deps/rectangle-67b9f7dc7aa59cac
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.66s
|
||||
Running target/debug/deps/rectangle-6fe0c0eff9a70690
|
||||
|
||||
running 1 test
|
||||
test tests::larger_can_hold_smaller ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.62s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.58s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 1 test
|
||||
test tests::it_adds_two ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.56s
|
||||
Running target/debug/deps/guessing_game-8b48ad858a9927ad
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.58s
|
||||
Running target/debug/deps/guessing_game-1bf5eca04a7d401d
|
||||
|
||||
running 1 test
|
||||
test tests::greater_than_100 ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling silly-function v0.1.0 (file:///projects/silly-function)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.67s
|
||||
Running target/debug/deps/silly_function-eac5f06e00fcc415
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.58s
|
||||
Running target/debug/deps/silly_function-b02a4796f0aeb021
|
||||
|
||||
running 2 tests
|
||||
test tests::this_test_will_fail ... FAILED
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.64s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.62s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 3 tests
|
||||
test tests::add_three_and_two ... ok
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
$ cargo test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.31s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.73s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
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-c6387e91a17a7e28
|
||||
Running target/debug/deps/integration_test-60fcbc66f73b2933
|
||||
|
||||
running 1 test
|
||||
test it_adds_two ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.69s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.59s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 1 test
|
||||
test tests::exploration ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling rectangle v0.1.0 (file:///projects/rectangle)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.79s
|
||||
Running target/debug/deps/rectangle-67b9f7dc7aa59cac
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.66s
|
||||
Running target/debug/deps/rectangle-6fe0c0eff9a70690
|
||||
|
||||
running 2 tests
|
||||
test tests::larger_can_hold_smaller ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling rectangle v0.1.0 (file:///projects/rectangle)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.69s
|
||||
Running target/debug/deps/rectangle-67b9f7dc7aa59cac
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.66s
|
||||
Running target/debug/deps/rectangle-6fe0c0eff9a70690
|
||||
|
||||
running 2 tests
|
||||
test tests::larger_can_hold_smaller ... FAILED
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.68s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.61s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 1 test
|
||||
test tests::it_adds_two ... FAILED
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling greeter v0.1.0 (file:///projects/greeter)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.87s
|
||||
Running target/debug/deps/greeter-8ad9008cd2967729
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.91s
|
||||
Running target/debug/deps/greeter-01c2d86f487c60e6
|
||||
|
||||
running 1 test
|
||||
test tests::greeting_contains_name ... FAILED
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling greeter v0.1.0 (file:///projects/greeter)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.90s
|
||||
Running target/debug/deps/greeter-8ad9008cd2967729
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.93s
|
||||
Running target/debug/deps/greeter-01c2d86f487c60e6
|
||||
|
||||
running 1 test
|
||||
test tests::greeting_contains_name ... FAILED
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
$ cargo test
|
||||
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.65s
|
||||
Running target/debug/deps/guessing_game-8b48ad858a9927ad
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.62s
|
||||
Running target/debug/deps/guessing_game-1bf5eca04a7d401d
|
||||
|
||||
running 1 test
|
||||
test tests::greater_than_100 ... FAILED
|
||||
|
||||
failures:
|
||||
|
||||
---- tests::greater_than_100 stdout ----
|
||||
note: test did not panic as expected
|
||||
|
||||
failures:
|
||||
tests::greater_than_100
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.93s
|
||||
Running target/debug/deps/guessing_game-8b48ad858a9927ad
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.66s
|
||||
Running target/debug/deps/guessing_game-1bf5eca04a7d401d
|
||||
|
||||
running 1 test
|
||||
test tests::greater_than_100 ... FAILED
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.24s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.60s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 2 tests
|
||||
test expensive_test ... ignored
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
$ cargo test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.89s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.89s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
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-45f025ef642ec24e
|
||||
Running target/debug/deps/common-a282abfe78e5b141
|
||||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
|
||||
|
||||
Running target/debug/deps/integration_test-c6387e91a17a7e28
|
||||
Running target/debug/deps/integration_test-60fcbc66f73b2933
|
||||
|
||||
running 1 test
|
||||
test it_adds_two ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test -- --show-output
|
||||
Compiling silly-function v0.1.0 (file:///projects/silly-function)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.61s
|
||||
Running target/debug/deps/silly_function-eac5f06e00fcc415
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.60s
|
||||
Running target/debug/deps/silly_function-b02a4796f0aeb021
|
||||
|
||||
running 2 tests
|
||||
test tests::this_test_will_fail ... FAILED
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test one_hundred
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.0s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.69s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 1 test
|
||||
test tests::one_hundred ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test add
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.0s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.61s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 2 tests
|
||||
test tests::add_three_and_two ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test -- --ignored
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.0s
|
||||
Running target/debug/deps/adder-26ec23d2a5426051
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.61s
|
||||
Running target/debug/deps/adder-076f0528706a8604
|
||||
|
||||
running 1 test
|
||||
test expensive_test ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test --test integration_test
|
||||
Compiling adder v0.1.0 (file:///projects/adder)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.0s
|
||||
Running target/debug/deps/integration_test-c6387e91a17a7e28
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.64s
|
||||
Running target/debug/deps/integration_test-60fcbc66f73b2933
|
||||
|
||||
running 1 test
|
||||
test it_adds_two ... ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling minigrep v0.1.0 (file:///projects/minigrep)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.43s
|
||||
Running target/debug/deps/minigrep-d717a44405defbfd
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.97s
|
||||
Running target/debug/deps/minigrep-7003bffd2dda3b01
|
||||
|
||||
running 1 test
|
||||
test tests::one_result ... FAILED
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
$ cargo test
|
||||
Compiling minigrep v0.1.0 (file:///projects/minigrep)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 1.77s
|
||||
Running target/debug/deps/minigrep-d717a44405defbfd
|
||||
Finished test [unoptimized + debuginfo] target(s) in 1.22s
|
||||
Running target/debug/deps/minigrep-7003bffd2dda3b01
|
||||
|
||||
running 1 test
|
||||
test tests::one_result ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
|
||||
|
||||
Running target/debug/deps/minigrep-42e3d08a294c0b9d
|
||||
Running target/debug/deps/minigrep-bf1f738c1c9dea06
|
||||
|
||||
running 0 tests
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling minigrep v0.1.0 (file:///projects/minigrep)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 1.33s
|
||||
Running target/debug/deps/minigrep-d717a44405defbfd
|
||||
Finished test [unoptimized + debuginfo] target(s) in 1.33s
|
||||
Running target/debug/deps/minigrep-7003bffd2dda3b01
|
||||
|
||||
running 2 tests
|
||||
test tests::case_insensitive ... ok
|
||||
|
@ -9,7 +9,7 @@ test tests::case_sensitive ... ok
|
|||
|
||||
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
|
||||
|
||||
Running target/debug/deps/minigrep-42e3d08a294c0b9d
|
||||
Running target/debug/deps/minigrep-bf1f738c1c9dea06
|
||||
|
||||
running 0 tests
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling cacher v0.1.0 (file:///projects/cacher)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.61s
|
||||
Running target/debug/deps/cacher-f9d77a54bb7e0fc3
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.72s
|
||||
Running target/debug/deps/cacher-35748700da794293
|
||||
|
||||
running 1 test
|
||||
test tests::call_with_different_values ... FAILED
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$ cargo test
|
||||
Compiling limit-tracker v0.1.0 (file:///projects/limit-tracker)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.82s
|
||||
Running target/debug/deps/limit_tracker-498d20ad47c82afe
|
||||
Finished test [unoptimized + debuginfo] target(s) in 0.91s
|
||||
Running target/debug/deps/limit_tracker-6c079de0866a6d36
|
||||
|
||||
running 1 test
|
||||
test tests::it_sends_an_over_75_percent_warning_message ... FAILED
|
||||
|
|
|
@ -5,6 +5,13 @@ error[E0005]: refutable pattern in local binding: `None` not covered
|
|||
|
|
||||
3 | let Some(x) = some_option_value;
|
||||
| ^^^^^^^ pattern `None` not covered
|
||||
|
|
||||
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
|
||||
help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
3 | if let Some(x) = some_option_value { /* */ }
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$ cargo run
|
||||
Compiling traits-example v0.1.0 (file:///projects/traits-example)
|
||||
error[E0283]: type annotations required: cannot resolve `_: Animal`
|
||||
error[E0283]: type annotations needed: cannot resolve `_: Animal`
|
||||
--> src/main.rs:20:43
|
||||
|
|
||||
2 | fn baby_name() -> String;
|
||||
|
|
|
@ -13,7 +13,7 @@ error[E0308]: mismatched types
|
|||
| ^^^^^^
|
||||
| |
|
||||
| expected enum `std::option::Option`, found struct `std::thread::JoinHandle`
|
||||
| help: try using a variant of the expected type: `Some(thread)`
|
||||
| help: try using a variant of the expected enum: `Some(thread)`
|
||||
|
|
||||
= note: expected type `std::option::Option<std::thread::JoinHandle<()>>`
|
||||
found type `std::thread::JoinHandle<_>`
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.39.0
|
||||
1.40.0
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
*by Steve Klabnik and Carol Nichols, with contributions from the Rust Community*
|
||||
|
||||
This version of the text assumes you’re using Rust 1.39.0 or later with
|
||||
This version of the text assumes you’re using Rust 1.40.0 or later with
|
||||
`edition="2018"` in *Cargo.toml* of all projects to use Rust 2018 Edition
|
||||
idioms. See the [“Installation” section of Chapter 1][install]<!-- ignore -->
|
||||
to install or update Rust, and see the new [Appendix E][editions]<!-- ignore
|
||||
|
|
Loading…
Reference in New Issue