From 315c70d542ca0217906dc49a50460d934d47e43d Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 1 Sep 2026 17:56:14 -0400 Subject: [PATCH] Update to Rust 1.98 --- .github/workflows/main.yml | 8 ++++---- .../listing-02-04/output.txt | 4 ++-- .../no-listing-19-statements-vs-expressions/output.txt | 2 +- .../output-only-01-debug/output.txt | 1 - .../no-listing-07-cant-use-option-directly/output.txt | 10 +++++----- .../no-listing-10-non-exhaustive-match/output.txt | 4 ++-- .../ch08-common-collections/listing-08-19/output.txt | 4 ++-- .../ch13-functional-features/listing-13-08/output.txt | 2 +- .../ch16-fearless-concurrency/listing-16-14/output.txt | 2 +- listings/ch21-web-server/listing-21-22/output.txt | 2 +- rust-toolchain | 2 +- src/title-page.md | 2 +- 12 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a06e9c4d9..1e5e87de55 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.97 -c rust-docs - rustup default 1.97 + rustup toolchain install 1.98 -c rust-docs + rustup default 1.98 - name: Install mdbook run: | mkdir bin @@ -50,8 +50,8 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install 1.97 -c rust-docs - rustup default 1.97 + rustup toolchain install 1.98 -c rust-docs + rustup default 1.98 - 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 a7676f0238..28769115f5 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt +++ b/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt @@ -1,8 +1,8 @@ $ cargo build Compiling libc v0.2.186 Compiling rand_core v0.10.1 - Compiling getrandom v0.4.3 Compiling cfg-if v1.0.0 + Compiling getrandom v0.4.3 Compiling chacha20 v0.10.1 Compiling rand v0.10.1 Compiling guessing_game v0.1.0 (file:///projects/guessing_game) @@ -17,7 +17,7 @@ error[E0308]: mismatched types = note: expected reference `&String` found reference `&{integer}` note: method defined here - --> /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/cmp.rs:1000:7 + --> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/cmp.rs:1000:7 For more information about this error, try `rustc --explain E0308`. error: could not compile `guessing_game` (bin "guessing_game") due to 1 previous error diff --git a/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt b/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt index d1172097db..0757398ee6 100644 --- a/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt +++ b/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt @@ -18,7 +18,7 @@ warning: unnecessary parentheses around assigned value help: remove these parentheses | 2 - let x = (let y = 6); -2 + let x = let y = 6 ; +2 + let x = let y = 6; | warning: `functions` (bin "functions") generated 1 warning 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 b0c1c14b36..0e9ea8da50 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,6 @@ error[E0277]: `Rectangle` doesn't implement `Debug` | required by this formatting parameter | = help: the trait `Debug` is not implemented for `Rectangle` - = note: add `#[derive(Debug)]` to `Rectangle` or manually `impl Debug for Rectangle` help: consider annotating `Rectangle` with `#[derive(Debug)]` | 1 + #[derive(Debug)] 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 3eda17fd97..8c7d064e43 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,19 +8,19 @@ error[E0277]: cannot add `Option` to `i8` | = help: the trait `Add>` is not implemented for `i8` help: the following other types implement trait `Add` - --> /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/ops/arith.rs:98:8 + --> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/ops/arith.rs:98:8 | = note: `i8` implements `Add` - ::: /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/ops/arith.rs:113:0 + ::: /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/ops/arith.rs:113:0 | = note: in this macro invocation - --> /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/internal_macros.rs:22:8 + --> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/internal_macros.rs:22:8 | = note: `&i8` implements `Add` - ::: /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/internal_macros.rs:33:8 + ::: /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/internal_macros.rs:33:8 | = note: `i8` implements `Add<&i8>` - ::: /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/internal_macros.rs:44:8 + ::: /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/internal_macros.rs:44:8 | = note: `&i8` implements `Add` = note: this error originates in the macro `add_impl` (in Nightly builds, run with -Z macro-backtrace for more info) 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 4f0924117f..3c4f3d45f4 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,8 +7,8 @@ error[E0004]: non-exhaustive patterns: `None` not covered | ^ pattern `None` not covered | note: `Option` defined here - --> /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/option.rs:597:0 - ::: /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/option.rs:601:4 + --> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/option.rs:598:0 + ::: /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/option.rs:602:4 | = note: not covered = note: the matched value is of type `Option` diff --git a/listings/ch08-common-collections/listing-08-19/output.txt b/listings/ch08-common-collections/listing-08-19/output.txt index a5161e5fd7..160a140dde 100644 --- a/listings/ch08-common-collections/listing-08-19/output.txt +++ b/listings/ch08-common-collections/listing-08-19/output.txt @@ -10,10 +10,10 @@ 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: `usize` implements trait `SliceIndex` - --> /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/slice/index.rs:214:0 + --> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/slice/index.rs:179:0 | = note: `SliceIndex<[T]>` - --> /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/core/src/bstr/traits.rs:197:0 + --> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/bstr/traits.rs:197:0 | = note: `SliceIndex` = note: required for `String` to implement `Index<{integer}>` diff --git a/listings/ch13-functional-features/listing-13-08/output.txt b/listings/ch13-functional-features/listing-13-08/output.txt index 30d2a2516e..a7cd989152 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 - --> /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/alloc/src/slice.rs:249:11 + --> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/alloc/src/slice.rs:249:11 help: consider cloning the value if the performance cost is acceptable | 18 | sort_operations.push(value.clone()); diff --git a/listings/ch16-fearless-concurrency/listing-16-14/output.txt b/listings/ch16-fearless-concurrency/listing-16-14/output.txt index 66a17bdd09..dac2ea493b 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` - --> /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/std/src/thread/functions.rs:125:0 + --> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/std/src/thread/functions.rs:125:0 For more information about this error, try `rustc --explain E0277`. error: could not compile `shared-state` (bin "shared-state") 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 08114aab2d..748774f264 100644 --- a/listings/ch21-web-server/listing-21-22/output.txt +++ b/listings/ch21-web-server/listing-21-22/output.txt @@ -9,7 +9,7 @@ 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` - --> /rustc/2d8144b7880597b6e6d3dfd63a9a9efae3f533d3/library/std/src/thread/join_handle.rs:149:16 + --> /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/std/src/thread/join_handle.rs:149:16 For more information about this error, try `rustc --explain E0507`. error: could not compile `hello` (lib) due to 1 previous error diff --git a/rust-toolchain b/rust-toolchain index 038d8c2ab2..a6f5a5934a 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.97 +1.98 diff --git a/src/title-page.md b/src/title-page.md index b979275392..005b5fa5e0 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.97.0 (released 2026-07-09) +This version of the text assumes you’re using Rust 1.98.0 (released 2026-08-20) 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