Skip to content

Commit

Permalink
Update to Rust 1.69
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Feb 19, 2024
1 parent 667e928 commit b63081b
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install 1.68 -c rust-docs
rustup default 1.68
rustup toolchain install 1.69 -c rust-docs
rustup default 1.69
- name: Install mdbook
run: |
mkdir bin
Expand Down
8 changes: 4 additions & 4 deletions listings/ch02-guessing-game-tutorial/listing-02-04/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ error[E0308]: mismatched types
--> src/main.rs:22:21
|
22 | match guess.cmp(&secret_number) {
| --- ^^^^^^^^^^^^^^ expected struct `String`, found integer
| --- ^^^^^^^^^^^^^^ expected `&String`, found `&{integer}`
| |
| arguments to this method are incorrect
|
= note: expected reference `&String`
found reference `&{integer}`
note: associated function defined here
--> /Users/carolnichols/.rustup/toolchains/1.68-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:781:8
note: method defined here
--> /Users/carolnichols/.rustup/toolchains/1.69-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:783:8
|
781 | fn cmp(&self, other: &Self) -> Ordering;
783 | fn cmp(&self, other: &Self) -> Ordering;
| ^^^

For more information about this error, try `rustc --explain E0308`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ error[E0004]: non-exhaustive patterns: `None` not covered
| ^ pattern `None` not covered
|
note: `Option<i32>` defined here
--> /Users/carolnichols/.rustup/toolchains/1.68-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:566:5
--> /Users/carolnichols/.rustup/toolchains/1.69-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:567:5
|
562 | pub enum Option<T> {
563 | pub enum Option<T> {
| ------------------
...
566 | None,
567 | None,
| ^^^^ not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ $ cargo run
error[E0597]: `x` does not live long enough
--> src/main.rs:6:13
|
5 | let x = 5;
| - binding `x` declared here
6 | r = &x;
| ^^ borrowed value does not live long enough
7 | }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ $ cargo run
error[E0597]: `string2` does not live long enough
--> src/main.rs:6:44
|
5 | let string2 = String::from("xyz");
| ------- binding `string2` declared here
6 | result = longest(string1.as_str(), string2.as_str());
| ^^^^^^^^^^^^^^^^ borrowed value does not live long enough
7 | }
Expand Down
2 changes: 1 addition & 1 deletion listings/ch13-functional-features/listing-13-03/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ error[E0308]: mismatched types
5 | let n = example_closure(5);
| --------------- ^- help: try using a conversion method: `.to_string()`
| | |
| | expected struct `String`, found integer
| | expected `String`, found integer
| arguments to this function are incorrect
|
note: closure parameter defined here
Expand Down
4 changes: 2 additions & 2 deletions listings/ch16-fearless-concurrency/listing-16-14/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ note: required because it's used within this closure
11 | let handle = thread::spawn(move || {
| ^^^^^^^
note: required by a bound in `spawn`
--> /Users/carolnichols/.rustup/toolchains/1.68-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:712:8
--> /Users/carolnichols/.rustup/toolchains/1.69-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:714:8
|
712 | F: Send + 'static,
714 | F: Send + 'static,
| ^^^^ required by this bound in `spawn`

For more information about this error, try `rustc --explain E0277`.
Expand Down
4 changes: 2 additions & 2 deletions listings/ch20-web-server/listing-20-22/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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::<T>::join` takes ownership of the receiver `self`, which moves `worker.thread`
--> /Users/carolnichols/.rustup/toolchains/1.68-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:1589:17
--> /Users/carolnichols/.rustup/toolchains/1.69-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:1591:17
|
1589 | pub fn join(self) -> Result<T> {
1591 | pub fn join(self) -> Result<T> {
| ^^^^

For more information about this error, try `rustc --explain E0507`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0599]: no method named `execute` found for struct `ThreadPool` in the cur
--> src/main.rs:17:14
|
17 | pool.execute(|| {
| ^^^^^^^ method not found in `ThreadPool`
| -----^^^^^^^ method not found in `ThreadPool`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `hello` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ error[E0599]: no method named `join` found for enum `Option` in the current scop
| ^^^^ method not found in `Option<JoinHandle<()>>`
|
note: the method `join` exists on the type `JoinHandle<()>`
--> /Users/carolnichols/.rustup/toolchains/1.68-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:1589:5
--> /Users/carolnichols/.rustup/toolchains/1.69-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:1591:5
|
1589 | pub fn join(self) -> Result<T> {
1591 | pub fn join(self) -> Result<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider using `Option::expect` to unwrap the `JoinHandle<()>` value, panicking if the value is an `Option::None`
|
Expand All @@ -20,7 +20,7 @@ error[E0308]: mismatched types
--> src/lib.rs:72:22
|
72 | Worker { id, thread }
| ^^^^^^ expected enum `Option`, found struct `JoinHandle`
| ^^^^^^ expected `Option<JoinHandle<()>>`, found `JoinHandle<_>`
|
= note: expected enum `Option<JoinHandle<()>>`
found struct `JoinHandle<_>`
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.68
1.69
2 changes: 1 addition & 1 deletion src/title-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.68.2 (released 2023-03-28)
This version of the text assumes you’re using Rust 1.69.0 (released 2023-04-20)
or later. See the [“Installation” section of Chapter 1][install]<!-- ignore -->
to install or update Rust.

Expand Down

0 comments on commit b63081b

Please sign in to comment.