Skip to content

Commit

Permalink
Upgrade to Rust 1.65
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Nov 4, 2022
1 parent 19c7507 commit 3f64052
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 29 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.64 -c rust-docs
rustup default 1.64
rustup toolchain install 1.65 -c rust-docs
rustup default 1.65
- name: Install mdbook
run: |
mkdir bin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ $ cargo run
Compiling collections v0.1.0 (file:///projects/collections)
Finished dev [unoptimized + debuginfo] target(s) in 0.43s
Running `target/debug/collections`
thread 'main' panicked at 'byte index 1 is not a char boundary; it is inside 'З' (bytes 0..2) of `Здравствуйте`', library/core/src/str/mod.rs:127:5
thread 'main' panicked at 'byte index 1 is not a char boundary; it is inside 'З' (bytes 0..2) of `Здравствуйте`', src/main.rs:4:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
9 changes: 4 additions & 5 deletions listings/ch09-error-handling/listing-09-10/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ $ cargo run
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:48
|
3 | / fn main() {
4 | | let greeting_file = File::open("hello.txt")?;
| | ^ cannot use the `?` operator in a function that returns `()`
5 | | }
| |_- this function should return `Result` or `Option` to accept `?`
3 | fn main() {
| --------- this function should return `Result` or `Option` to accept `?`
4 | let greeting_file = File::open("hello.txt")?;
| ^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ failures:

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ failures:

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ failures:

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ failures:

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ failures:

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ failures:

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ failures:

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ failures:

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ failures:

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
2 changes: 1 addition & 1 deletion listings/ch12-an-io-project/listing-12-16/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ failures:

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
6 changes: 3 additions & 3 deletions listings/ch13-functional-features/listing-13-03/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ error[E0308]: mismatched types
| | expected struct `String`, found integer
| arguments to this function are incorrect
|
note: closure defined here
--> src/main.rs:2:27
note: closure parameter defined here
--> src/main.rs:2:28
|
2 | let example_closure = |x| x;
| ^^^
| ^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `closure-example` due to previous error
2 changes: 1 addition & 1 deletion listings/ch15-smart-pointers/listing-15-23/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ failures:

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass '--lib'
error: test failed, to rerun pass `--lib`
17 changes: 12 additions & 5 deletions listings/ch16-fearless-concurrency/listing-16-14/output.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
$ cargo run
Compiling shared-state v0.1.0 (file:///projects/shared-state)
error[E0277]: `Rc<Mutex<i32>>` cannot be sent between threads safely
--> src/main.rs:11:22
--> src/main.rs:11:36
|
11 | let handle = thread::spawn(move || {
| ^^^^^^^^^^^^^ ------- within this `[closure@src/main.rs:11:36: 11:43]`
| |
| `Rc<Mutex<i32>>` cannot be sent between threads safely
11 | let handle = thread::spawn(move || {
| ------------- ^------
| | |
| ______________________|_____________within this `[closure@src/main.rs:11:36: 11:43]`
| | |
| | required by a bound introduced by this call
12 | | let mut num = counter.lock().unwrap();
13 | |
14 | | *num += 1;
15 | | });
| |_________^ `Rc<Mutex<i32>>` cannot be sent between threads safely
|
= help: within `[closure@src/main.rs:11:36: 11:43]`, the trait `Send` is not implemented for `Rc<Mutex<i32>>`
note: required because it's used within this closure
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.64
1.65
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.64 (released 2022-09-22)
This version of the text assumes you’re using Rust 1.65 (released 2022-11-03)
or later. See the [“Installation” section of Chapter 1][install]<!-- ignore -->
to install or update Rust.

Expand Down

0 comments on commit 3f64052

Please sign in to comment.