Skip to content

Commit

Permalink
Update to Rust 1.70
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Feb 19, 2024
1 parent b63081b commit 9e74f92
Show file tree
Hide file tree
Showing 67 changed files with 91 additions and 78 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.69 -c rust-docs
rustup default 1.69
rustup toolchain install 1.70 -c rust-docs
rustup default 1.70
- name: Install mdbook
run: |
mkdir bin
Expand Down
6 changes: 3 additions & 3 deletions listings/ch02-guessing-game-tutorial/listing-02-04/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ error[E0308]: mismatched types
= note: expected reference `&String`
found reference `&{integer}`
note: method defined here
--> /Users/carolnichols/.rustup/toolchains/1.69-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:783:8
--> /Users/carolnichols/.rustup/toolchains/1.70-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:784:8
|
783 | fn cmp(&self, other: &Self) -> Ordering;
784 | fn cmp(&self, other: &Self) -> Ordering;
| ^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `guessing_game` due to previous error
error: could not compile `guessing_game` (bin "guessing_game") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ warning: unused `Result` that must be used
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
10 | let _ = io::stdin().read_line(&mut guess);
| +++++++

warning: `guessing_game` (bin "guessing_game") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 0.59s
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ error[E0384]: cannot assign twice to immutable variable `x`
| ^^^^^ cannot assign twice to immutable variable

For more information about this error, try `rustc --explain E0384`.
error: could not compile `variables` due to previous error
error: could not compile `variables` (bin "variables") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ help: try removing the method call
|

For more information about this error, try `rustc --explain E0308`.
error: could not compile `variables` due to previous error
error: could not compile `variables` (bin "variables") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ help: remove these parentheses

For more information about this error, try `rustc --explain E0658`.
warning: `functions` (bin "functions") generated 1 warning
error: could not compile `functions` due to 3 previous errors; 1 warning emitted
error: could not compile `functions` (bin "functions") due to 3 previous errors; 1 warning emitted
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ error[E0308]: mismatched types
| - help: remove this semicolon to return this value

For more information about this error, try `rustc --explain E0308`.
error: could not compile `functions` due to previous error
error: could not compile `functions` (bin "functions") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ error[E0308]: mismatched types
| ^^^^^^ expected `bool`, found integer

For more information about this error, try `rustc --explain E0308`.
error: could not compile `branches` due to previous error
error: could not compile `branches` (bin "branches") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ error[E0308]: `if` and `else` have incompatible types
| expected because of this

For more information about this error, try `rustc --explain E0308`.
error: could not compile `branches` due to previous error
error: could not compile `branches` (bin "branches") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ help: consider giving `guess` an explicit type
| ++++++++++++

For more information about this error, try `rustc --explain E0282`.
error: could not compile `no_type_annotations` due to previous error
error: could not compile `no_type_annotations` (bin "no_type_annotations") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ help: consider changing this to be a mutable reference
| ~~~~~~~~~~~

For more information about this error, try `rustc --explain E0596`.
error: could not compile `ownership` due to previous error
error: could not compile `ownership` (bin "ownership") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ help: consider cloning the value if the performance cost is acceptable
| ++++++++

For more information about this error, try `rustc --explain E0382`.
error: could not compile `ownership` due to previous error
error: could not compile `ownership` (bin "ownership") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ error[E0499]: cannot borrow `s` as mutable more than once at a time
| -- first borrow later used here

For more information about this error, try `rustc --explain E0499`.
error: could not compile `ownership` due to previous error
error: could not compile `ownership` (bin "ownership") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immuta
| -- immutable borrow later used here

For more information about this error, try `rustc --explain E0502`.
error: could not compile `ownership` due to previous error
error: could not compile `ownership` (bin "ownership") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ help: consider using the `'static` lifetime
| +++++++

For more information about this error, try `rustc --explain E0106`.
error: could not compile `ownership` due to previous error
error: could not compile `ownership` (bin "ownership") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immuta
| ---- immutable borrow later used here

For more information about this error, try `rustc --explain E0502`.
error: could not compile `ownership` due to previous error
error: could not compile `ownership` (bin "ownership") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ error[E0277]: `Rectangle` doesn't implement `std::fmt::Display`
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `rectangles` due to previous error
error: could not compile `rectangles` (bin "rectangles") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ help: consider introducing a named lifetime parameter
|

For more information about this error, try `rustc --explain E0106`.
error: could not compile `structs` due to 2 previous errors
error: could not compile `structs` (bin "structs") due to 2 previous errors
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ error[E0277]: `Rectangle` doesn't implement `Debug`
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Rectangle` with `#[derive(Debug)]`
|
1 | #[derive(Debug)]
1 + #[derive(Debug)]
2 | struct Rectangle {
|

For more information about this error, try `rustc --explain E0277`.
error: could not compile `rectangles` due to previous error
error: could not compile `rectangles` (bin "rectangles") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ error[E0277]: cannot add `Option<i8>` to `i8`
<i8 as Add>

For more information about this error, try `rustc --explain E0277`.
error: could not compile `enums` due to previous error
error: could not compile `enums` (bin "enums") due to previous error
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.69-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:567:5
--> /Users/carolnichols/.rustup/toolchains/1.70-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:568:5
|
563 | pub enum Option<T> {
564 | pub enum Option<T> {
| ------------------
...
567 | None,
568 | 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 All @@ -22,4 +22,4 @@ help: ensure that all possible cases are being handled by adding a match arm wit
|

For more information about this error, try `rustc --explain E0004`.
error: could not compile `enums` due to previous error
error: could not compile `enums` (bin "enums") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ note: the module `hosting` is defined here
| ^^^^^^^^^^^

For more information about this error, try `rustc --explain E0603`.
error: could not compile `restaurant` due to 2 previous errors
error: could not compile `restaurant` (lib) due to 2 previous errors
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ note: the function `add_to_waitlist` is defined here
| ^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0603`.
error: could not compile `restaurant` due to 2 previous errors
error: could not compile `restaurant` (lib) due to 2 previous errors
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ error[E0433]: failed to resolve: use of undeclared crate or module `hosting`

For more information about this error, try `rustc --explain E0433`.
warning: `restaurant` (lib) generated 1 warning
error: could not compile `restaurant` due to previous error; 1 warning emitted
error: could not compile `restaurant` (lib) due to previous error; 1 warning emitted
4 changes: 2 additions & 2 deletions listings/ch08-common-collections/listing-08-06/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immuta
| ^^^^^^^^^ mutable borrow occurs here
7 |
8 | println!("The first element is: {first}");
| ----- immutable borrow later used here
| ------- immutable borrow later used here

For more information about this error, try `rustc --explain E0502`.
error: could not compile `collections` due to previous error
error: could not compile `collections` (bin "collections") due to previous error
2 changes: 1 addition & 1 deletion listings/ch08-common-collections/listing-08-19/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ error[E0277]: the type `String` cannot be indexed by `{integer}`
<String as Index<std::ops::Range<usize>>>

For more information about this error, try `rustc --explain E0277`.
error: could not compile `collections` due to previous error
error: could not compile `collections` (bin "collections") due to previous error
2 changes: 1 addition & 1 deletion listings/ch09-error-handling/listing-09-10/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ error[E0277]: the `?` operator can only be used in a function that returns `Resu
= help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `error-handling` due to previous error
error: could not compile `error-handling` (bin "error-handling") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ help: consider restricting type parameter `T`
| ++++++++++++++++++++++

For more information about this error, try `rustc --explain E0369`.
error: could not compile `chapter10` due to previous error
error: could not compile `chapter10` (bin "chapter10") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ error[E0308]: mismatched types
| ^^^ expected integer, found floating-point number

For more information about this error, try `rustc --explain E0308`.
error: could not compile `chapter10` due to previous error
error: could not compile `chapter10` (bin "chapter10") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ error[E0597]: `x` does not live long enough
| - borrow later used here

For more information about this error, try `rustc --explain E0597`.
error: could not compile `chapter10` due to previous error
error: could not compile `chapter10` (bin "chapter10") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ help: consider introducing a named lifetime parameter
| ++++ ++ ++ ++

For more information about this error, try `rustc --explain E0106`.
error: could not compile `chapter10` due to previous error
error: could not compile `chapter10` (bin "chapter10") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ error[E0597]: `string2` does not live long enough
| ------ borrow later used here

For more information about this error, try `rustc --explain E0597`.
error: could not compile `chapter10` due to previous error
error: could not compile `chapter10` (bin "chapter10") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ error[E0515]: cannot return reference to local variable `result`
| ^^^^^^^^^^^^^^^ returns a reference to data owned by the current function

For more information about this error, try `rustc --explain E0515`.
error: could not compile `chapter10` due to previous error
error: could not compile `chapter10` (bin "chapter10") due to previous error
4 changes: 4 additions & 0 deletions listings/ch12-an-io-project/listing-12-12/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ warning: unused `Result` that must be used
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
19 | let _ = run(config);
| +++++++

warning: `minigrep` (bin "minigrep") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 0.71s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ help: consider introducing a named lifetime parameter
| ++++ ++ ++ ++

For more information about this error, try `rustc --explain E0106`.
error: could not compile `minigrep` due to previous error
error: could not compile `minigrep` (lib) due to previous error
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 @@ -16,4 +16,4 @@ note: closure parameter defined here
| ^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `closure-example` due to previous error
error: could not compile `closure-example` (bin "closure-example") due to previous error
2 changes: 1 addition & 1 deletion listings/ch13-functional-features/listing-13-08/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ error[E0507]: cannot move out of `value`, a captured variable in an `FnMut` clos
| ^^^^^ move occurs because `value` has type `String`, which does not implement the `Copy` trait

For more information about this error, try `rustc --explain E0507`.
error: could not compile `rectangles` due to previous error
error: could not compile `rectangles` (bin "rectangles") due to previous error
4 changes: 4 additions & 0 deletions listings/ch13-functional-features/listing-13-14/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ warning: unused `Map` that must be used
|
= note: iterators are lazy and do nothing unless consumed
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
4 | let _ = v1.iter().map(|x| x + 1);
| +++++++

warning: `iterators` (bin "iterators") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 0.47s
Expand Down
2 changes: 1 addition & 1 deletion listings/ch15-smart-pointers/listing-15-03/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
| ++++ +

For more information about this error, try `rustc --explain E0072`.
error: could not compile `cons-list` due to previous error
error: could not compile `cons-list` (bin "cons-list") due to previous error
2 changes: 1 addition & 1 deletion listings/ch15-smart-pointers/listing-15-09/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ error[E0614]: type `MyBox<{integer}>` cannot be dereferenced
| ^^

For more information about this error, try `rustc --explain E0614`.
error: could not compile `deref-example` due to previous error
error: could not compile `deref-example` (bin "deref-example") due to previous error
2 changes: 1 addition & 1 deletion listings/ch15-smart-pointers/listing-15-15/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ error[E0040]: explicit use of destructor method
| help: consider using `drop` function: `drop(c)`

For more information about this error, try `rustc --explain E0040`.
error: could not compile `drop-example` due to previous error
error: could not compile `drop-example` (bin "drop-example") due to previous error
2 changes: 1 addition & 1 deletion listings/ch15-smart-pointers/listing-15-17/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ error[E0382]: use of moved value: `a`
| ^ value used here after move

For more information about this error, try `rustc --explain E0382`.
error: could not compile `cons-list` due to previous error
error: could not compile `cons-list` (bin "cons-list") due to previous error
2 changes: 1 addition & 1 deletion listings/ch15-smart-pointers/listing-15-21/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ help: consider changing that to be a mutable reference
| ~~~~~~~~~

For more information about this error, try `rustc --explain E0596`.
error: could not compile `limit-tracker` due to previous error
error: could not compile `limit-tracker` (lib test) due to previous error
warning: build failed, waiting for other jobs to finish...
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ help: consider changing this to be mutable
| +++

For more information about this error, try `rustc --explain E0596`.
error: could not compile `borrowing` due to previous error
error: could not compile `borrowing` (bin "borrowing") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ error[E0277]: can't compare `{integer}` with `&{integer}`
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `deref-example` due to previous error
error: could not compile `deref-example` (bin "deref-example") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ help: to force the closure to take ownership of `v` (and any other referenced va
| ++++

For more information about this error, try `rustc --explain E0373`.
error: could not compile `threads` due to previous error
error: could not compile `threads` (bin "threads") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ error[E0382]: borrow of moved value: `val`
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0382`.
error: could not compile `message-passing` due to previous error
error: could not compile `message-passing` (bin "message-passing") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ error[E0382]: use of moved value: `counter`
| ------- use occurs due to use in closure

For more information about this error, try `rustc --explain E0382`.
error: could not compile `shared-state` due to previous error
error: could not compile `shared-state` (bin "shared-state") due to previous error
6 changes: 3 additions & 3 deletions listings/ch16-fearless-concurrency/listing-16-14/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ 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.69-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:714:8
--> /Users/carolnichols/.rustup/toolchains/1.70-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:680:8
|
714 | F: Send + 'static,
680 | F: Send + 'static,
| ^^^^ required by this bound in `spawn`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `shared-state` due to previous error
error: could not compile `shared-state` (bin "shared-state") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ error[E0382]: use of moved value: `v`
| ^ value used here after move

For more information about this error, try `rustc --explain E0382`.
error: could not compile `threads` due to previous error
error: could not compile `threads` (bin "threads") due to previous error
2 changes: 1 addition & 1 deletion listings/ch17-oop/listing-17-10/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ error[E0277]: the trait bound `String: Draw` is not satisfied
= note: required for the cast from `String` to the object type `dyn Draw`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `gui` due to previous error
error: could not compile `gui` (bin "gui") due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ error[E0308]: mismatched types
found tuple `(_, _)`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `patterns` due to previous error
error: could not compile `patterns` (bin "patterns") due to previous error
Loading

0 comments on commit 9e74f92

Please sign in to comment.