diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3838345f..4d07a3c61 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,8 +12,8 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install 1.53 -c rust-docs - rustup default 1.53 + rustup toolchain install 1.54 -c rust-docs + rustup default 1.54 - name: Install mdbook run: | mkdir bin diff --git a/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/output.txt b/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/output.txt index cee7201e3..d4d322fb4 100644 --- a/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/output.txt +++ b/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/output.txt @@ -1,3 +1,4 @@ +$ cargo run Compiling loops v0.1.0 (file:///projects/loops) Finished dev [unoptimized + debuginfo] target(s) in 0.58s Running `target/debug/loops` diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt b/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt index 4a3f46236..72d73b5b3 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt @@ -9,7 +9,7 @@ error[E0277]: `Rectangle` doesn't implement `std::fmt::Display` = help: the trait `std::fmt::Display` is not implemented for `Rectangle` = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead = note: required by `std::fmt::Display::fmt` - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt b/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt index c78a00897..67f01e6d2 100644 --- a/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt +++ b/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt @@ -9,7 +9,7 @@ error[E0277]: `Rectangle` doesn't implement `Debug` = help: the trait `Debug` is not implemented for `Rectangle` = note: add `#[derive(Debug)]` or manually implement `Debug` = note: required by `std::fmt::Debug::fmt` - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/listings/ch09-error-handling/no-listing-06-question-mark-in-main/output.txt b/listings/ch09-error-handling/no-listing-06-question-mark-in-main/output.txt index 76ff85988..f4bbccc9e 100644 --- a/listings/ch09-error-handling/no-listing-06-question-mark-in-main/output.txt +++ b/listings/ch09-error-handling/no-listing-06-question-mark-in-main/output.txt @@ -1,16 +1,16 @@ $ cargo run Compiling error-handling v0.1.0 (file:///projects/error-handling) -error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `Try`) - --> src/main.rs:4:13 +error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) + --> src/main.rs:4:36 | 3 | / fn main() { 4 | | let f = File::open("hello.txt")?; - | | ^^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()` + | | ^ cannot use the `?` operator in a function that returns `()` 5 | | } | |_- this function should return `Result` or `Option` to accept `?` | - = help: the trait `Try` is not implemented for `()` - = note: required by `from_error` + = help: the trait `FromResidual>` is not implemented for `()` + = note: required by `from_residual` error: aborting due to previous error diff --git a/listings/ch11-writing-automated-tests/listing-11-08/output.txt b/listings/ch11-writing-automated-tests/listing-11-08/output.txt index 8372eeedf..6c17acfd9 100644 --- a/listings/ch11-writing-automated-tests/listing-11-08/output.txt +++ b/listings/ch11-writing-automated-tests/listing-11-08/output.txt @@ -4,7 +4,7 @@ $ cargo test Running unittests (target/debug/deps/guessing_game-57d70c3acb738f4d) running 1 test -test tests::greater_than_100 ... ok +test tests::greater_than_100 - should panic ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s diff --git a/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/output.txt b/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/output.txt index c624c24fa..9d64476ff 100644 --- a/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/output.txt +++ b/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/output.txt @@ -4,7 +4,7 @@ $ cargo test Running unittests (target/debug/deps/guessing_game-57d70c3acb738f4d) running 1 test -test tests::greater_than_100 ... FAILED +test tests::greater_than_100 - should panic ... FAILED failures: diff --git a/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt b/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt index d79268c7a..ca13febae 100644 --- a/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt +++ b/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt @@ -4,7 +4,7 @@ $ cargo test Running unittests (target/debug/deps/guessing_game-57d70c3acb738f4d) running 1 test -test tests::greater_than_100 ... FAILED +test tests::greater_than_100 - should panic ... FAILED failures: diff --git a/listings/ch15-smart-pointers/listing-15-21/output.txt b/listings/ch15-smart-pointers/listing-15-21/output.txt index 7cfa86b32..3c457938c 100644 --- a/listings/ch15-smart-pointers/listing-15-21/output.txt +++ b/listings/ch15-smart-pointers/listing-15-21/output.txt @@ -3,8 +3,9 @@ $ cargo test error[E0596]: cannot borrow `self.sent_messages` as mutable, as it is behind a `&` reference --> src/lib.rs:58:13 | -57 | fn send(&self, message: &str) { - | ----- help: consider changing this to be a mutable reference: `&mut self` +2 | fn send(&self, msg: &str); + | ----- help: consider changing that to be a mutable reference: `&mut self` +... 58 | self.sent_messages.push(String::from(message)); | ^^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable diff --git a/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt b/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt index 5eaa96992..11eca77c2 100644 --- a/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt +++ b/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt @@ -7,7 +7,7 @@ error[E0277]: can't compare `{integer}` with `&{integer}` | ^^^^^^^^^^^^^^^^^ no implementation for `{integer} == &{integer}` | = help: the trait `PartialEq<&{integer}>` is not implemented for `{integer}` - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt b/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt index 155e463a4..787d5ecdc 100644 --- a/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt +++ b/listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt @@ -1,6 +1,6 @@ $ cargo check Checking hello v0.1.0 (file:///projects/hello) -error[E0599]: no method named `join` found for enum `Option>` in the current scope +error[E0599]: no method named `join` found for enum `Option` in the current scope --> src/lib.rs:52:27 | 52 | worker.thread.join().unwrap(); diff --git a/rust-toolchain b/rust-toolchain index 74df8b169..108a9ade1 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.53 +1.54 diff --git a/src/title-page.md b/src/title-page.md index 8cb2d68ba..731da7847 100644 --- a/src/title-page.md +++ b/src/title-page.md @@ -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.53 or later with +This version of the text assumes you’re using Rust 1.54 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] to install or update Rust, and see the new [Appendix E][editions]