diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6731ffa588..412ec03875 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,8 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install 1.93 -c rust-docs - rustup default 1.93 + rustup toolchain install 1.94 -c rust-docs + rustup default 1.94 - name: Install mdbook run: | mkdir bin @@ -50,8 +50,8 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install 1.93 -c rust-docs - rustup default 1.93 + rustup toolchain install 1.94 -c rust-docs + rustup default 1.94 - name: Run `tools` package tests run: | cargo test diff --git a/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt b/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt index 29cd6bfd8b..96d08b4c8d 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt +++ b/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt @@ -18,9 +18,9 @@ error[E0308]: mismatched types = note: expected reference `&String` found reference `&{integer}` note: method defined here - --> file:///home/.rustup/toolchains/1.93/lib/rustlib/src/rust/library/core/src/cmp.rs:987:8 + --> file:///home/.rustup/toolchains/1.94/lib/rustlib/src/rust/library/core/src/cmp.rs:991:8 | -987 | fn cmp(&self, other: &Self) -> Ordering; +991 | fn cmp(&self, other: &Self) -> Ordering; | ^^^ For more information about this error, try `rustc --explain E0308`. diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt b/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt index d8d78c0ae8..748a9e1782 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt +++ b/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt @@ -8,15 +8,24 @@ error[E0277]: cannot add `Option` to `i8` | = help: the trait `Add>` is not implemented for `i8` help: the following other types implement trait `Add` - --> file:///home/.rustup/toolchains/1.93/lib/rustlib/src/rust/library/core/src/ops/arith.rs:114:1 + --> file:///home/.rustup/toolchains/1.94/lib/rustlib/src/rust/library/core/src/ops/arith.rs:99:9 | + 99 | impl const Add for $t { + | ^^^^^^^^^^^^^^^^^^^^^ `i8` implements `Add` +... 114 | add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | `&i8` implements `Add` - | `&i8` implements `Add` - | `i8` implements `Add<&i8>` - | `i8` implements `Add` + | ---------------------------------------------------------------------------------- in this macro invocation + | + ::: /Users/carolnichols/.rustup/toolchains/1.94-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/internal_macros.rs:22:9 + | + 22 | impl const $imp<$u> for &$t { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&i8` implements `Add` +... + 33 | impl const $imp<&$u> for $t { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `i8` implements `Add<&i8>` +... + 44 | impl const $imp<&$u> for &$t { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&i8` implements `Add` = note: this error originates in the macro `add_impl` (in Nightly builds, run with -Z macro-backtrace for more info) For more information about this error, try `rustc --explain E0277`. diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt b/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt index 48f7a8eaf4..e9f1074fe8 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt +++ b/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt @@ -7,7 +7,7 @@ error[E0004]: non-exhaustive patterns: `None` not covered | ^ pattern `None` not covered | note: `Option` defined here - --> file:///home/.rustup/toolchains/1.93/lib/rustlib/src/rust/library/core/src/option.rs:600:1 + --> file:///home/.rustup/toolchains/1.94/lib/rustlib/src/rust/library/core/src/option.rs:600:1 | 600 | pub enum Option { | ^^^^^^^^^^^^^^^^^^ diff --git a/listings/ch08-common-collections/listing-08-19/output.txt b/listings/ch08-common-collections/listing-08-19/output.txt index c06f53c74c..156c61dd9b 100644 --- a/listings/ch08-common-collections/listing-08-19/output.txt +++ b/listings/ch08-common-collections/listing-08-19/output.txt @@ -10,12 +10,12 @@ error[E0277]: the type `str` cannot be indexed by `{integer}` = note: you can use `.chars().nth()` or `.bytes().nth()` for more information, see chapter 8 in The Book: help: the following other types implement trait `SliceIndex` - --> file:///home/.rustup/toolchains/1.93/lib/rustlib/src/rust/library/core/src/slice/index.rs:214:1 + --> file:///home/.rustup/toolchains/1.94/lib/rustlib/src/rust/library/core/src/slice/index.rs:214:1 | 214 | unsafe impl const SliceIndex<[T]> for usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `usize` implements `SliceIndex<[T]>` | - ::: /Users/carolnichols/.rustup/toolchains/1.93-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/bstr/traits.rs:203:1 + ::: /Users/carolnichols/.rustup/toolchains/1.94-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/bstr/traits.rs:203:1 | 203 | unsafe impl SliceIndex for usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `usize` implements `SliceIndex` diff --git a/listings/ch13-functional-features/listing-13-08/output.txt b/listings/ch13-functional-features/listing-13-08/output.txt index a56c72b249..397dac302c 100644 --- a/listings/ch13-functional-features/listing-13-08/output.txt +++ b/listings/ch13-functional-features/listing-13-08/output.txt @@ -14,7 +14,7 @@ error[E0507]: cannot move out of `value`, a captured variable in an `FnMut` clos | ^^^^^ `value` is moved here | help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once - --> file:///home/.rustup/toolchains/1.93/lib/rustlib/src/rust/library/alloc/src/slice.rs:249:12 + --> file:///home/.rustup/toolchains/1.94/lib/rustlib/src/rust/library/alloc/src/slice.rs:249:12 | 249 | F: FnMut(&T) -> K, | ^^^^^^^^^^^^^^ 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 c593f1d04d..fe84728fb6 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 @@ -1,18 +1,18 @@ $ cargo run Compiling deref-example v0.1.0 (file:///projects/deref-example) error[E0277]: can't compare `{integer}` with `&{integer}` - --> src/main.rs:6:5 - | -6 | assert_eq!(5, y); - | ^^^^^^^^^^^^^^^^ no implementation for `{integer} == &{integer}` - | - = help: the trait `PartialEq<&{integer}>` is not implemented for `{integer}` - = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) + --> src/main.rs:6:5 + | + 6 | assert_eq!(5, y); + | ^^^^^^^^^^^^^^^^ no implementation for `{integer} == &{integer}` + | + = help: the trait `PartialEq<&{integer}>` is not implemented for `{integer}` + = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider dereferencing here - --> file:///home/.rustup/toolchains/1.93/lib/rustlib/src/rust/library/core/src/macros/mod.rs:46:35 - | -46| if !(*left_val == **right_val) { - | + + --> file:///home/.rustup/toolchains/1.94/lib/rustlib/src/rust/library/core/src/macros/mod.rs:46:35 + | +46 | if !(*left_val == **right_val) { + | + For more information about this error, try `rustc --explain E0277`. error: could not compile `deref-example` (bin "deref-example") due to 1 previous error diff --git a/listings/ch16-fearless-concurrency/listing-16-13/output.txt b/listings/ch16-fearless-concurrency/listing-16-13/output.txt index 598e0ad7c4..1b5cd18b58 100644 --- a/listings/ch16-fearless-concurrency/listing-16-13/output.txt +++ b/listings/ch16-fearless-concurrency/listing-16-13/output.txt @@ -13,14 +13,6 @@ error[E0382]: borrow of moved value: `counter` ... 21 | println!("Result: {}", *counter.lock().unwrap()); | ^^^^^^^ value borrowed here after move - | -help: consider moving the expression out of the loop so it is only moved once - | - 8 ~ let mut value = counter.lock(); - 9 ~ for _ in 0..10 { -10 | let handle = thread::spawn(move || { -11 ~ let mut num = value.unwrap(); - | For more information about this error, try `rustc --explain E0382`. error: could not compile `shared-state` (bin "shared-state") due to 1 previous error diff --git a/listings/ch16-fearless-concurrency/listing-16-14/output.txt b/listings/ch16-fearless-concurrency/listing-16-14/output.txt index aff303b5f8..2e292ea8d2 100644 --- a/listings/ch16-fearless-concurrency/listing-16-14/output.txt +++ b/listings/ch16-fearless-concurrency/listing-16-14/output.txt @@ -22,7 +22,7 @@ note: required because it's used within this closure 11 | let handle = thread::spawn(move || { | ^^^^^^^ note: required by a bound in `spawn` - --> file:///home/.rustup/toolchains/1.93/lib/rustlib/src/rust/library/std/src/thread/functions.rs:128:8 + --> file:///home/.rustup/toolchains/1.94/lib/rustlib/src/rust/library/std/src/thread/functions.rs:128:8 | 125 | pub fn spawn(f: F) -> JoinHandle | ----- required by a bound in this function diff --git a/listings/ch18-oop/listing-18-10/output.txt b/listings/ch18-oop/listing-18-10/output.txt index 50b423dfbe..8b4155de9f 100644 --- a/listings/ch18-oop/listing-18-10/output.txt +++ b/listings/ch18-oop/listing-18-10/output.txt @@ -7,7 +7,7 @@ error[E0277]: the trait bound `String: Draw` is not satisfied | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Draw` is not implemented for `String` | help: the trait `Draw` is implemented for `Button` - --> /Users/carolnichols/rust/book/tmp/listings/ch18-oop/listing-18-10/src/lib.rs:23:1 + --> src/lib.rs:23:1 | 23 | impl Draw for Button { | ^^^^^^^^^^^^^^^^^^^^ diff --git a/listings/ch21-web-server/listing-21-17/output.txt b/listings/ch21-web-server/listing-21-17/output.txt index 2768265514..cd06ca1b60 100644 --- a/listings/ch21-web-server/listing-21-17/output.txt +++ b/listings/ch21-web-server/listing-21-17/output.txt @@ -16,12 +16,6 @@ note: consider changing this parameter type in method `new` to borrow instead if | 47 | fn new(id: usize, receiver: mpsc::Receiver) -> Worker { | --- in this method ^^^^^^^^^^^^^^^^^^^ this parameter takes ownership of the value -help: consider moving the expression out of the loop so it is only moved once - | -25 ~ let mut value = Worker::new(id, receiver); -26 ~ for id in 0..size { -27 ~ workers.push(value); - | For more information about this error, try `rustc --explain E0382`. error: could not compile `hello` (lib) due to 1 previous error diff --git a/listings/ch21-web-server/listing-21-22/output.txt b/listings/ch21-web-server/listing-21-22/output.txt index 93323e0e11..13ae983348 100644 --- a/listings/ch21-web-server/listing-21-22/output.txt +++ b/listings/ch21-web-server/listing-21-22/output.txt @@ -9,9 +9,9 @@ error[E0507]: cannot move out of `worker.thread` which is behind a mutable refer | move occurs because `worker.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait | note: `JoinHandle::::join` takes ownership of the receiver `self`, which moves `worker.thread` - --> file:///home/.rustup/toolchains/1.93/lib/rustlib/src/rust/library/std/src/thread/join_handle.rs:148:17 + --> file:///home/.rustup/toolchains/1.94/lib/rustlib/src/rust/library/std/src/thread/join_handle.rs:147:17 | -148 | pub fn join(self) -> Result { +147 | pub fn join(self) -> Result { | ^^^^ For more information about this error, try `rustc --explain E0507`. diff --git a/rust-toolchain b/rust-toolchain index 7b7fd5a4dc..c25d22eebe 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.93 +1.94 diff --git a/src/title-page.md b/src/title-page.md index d42565fa37..949250c281 100644 --- a/src/title-page.md +++ b/src/title-page.md @@ -3,7 +3,7 @@ _by Steve Klabnik, Carol Nichols, and Chris Krycho, with contributions from the Rust Community_ -This version of the text assumes you’re using Rust 1.93.1 (released 2026-02-12) +This version of the text assumes you’re using Rust 1.94.1 (released 2026-03-26) or later with `edition = "2024"` in the *Cargo.toml* file of all projects to configure them to use Rust 2024 Edition idioms. See the [“Installation” section of Chapter 1][install] for instructions on installing or