mirror of https://github.com/rust-lang/book
Update to Rust 1.67.1
This commit is contained in:
parent
f92027c68a
commit
d94e03a18a
|
@ -12,8 +12,8 @@ jobs:
|
|||
- name: Install Rust
|
||||
run: |
|
||||
rustup set profile minimal
|
||||
rustup toolchain install 1.66 -c rust-docs
|
||||
rustup default 1.66
|
||||
rustup toolchain install 1.67 -c rust-docs
|
||||
rustup default 1.67
|
||||
- name: Install mdbook
|
||||
run: |
|
||||
mkdir bin
|
||||
|
|
|
@ -18,6 +18,7 @@ error[E0308]: mismatched types
|
|||
= note: expected reference `&String`
|
||||
found reference `&{integer}`
|
||||
note: associated function defined here
|
||||
--> /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/cmp.rs:783:8
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
error: could not compile `guessing_game` due to previous error
|
||||
|
|
|
@ -4,7 +4,7 @@ warning: unused `Result` that must be used
|
|||
--> src/main.rs:10:5
|
||||
|
|
||||
10 | io::stdin().read_line(&mut guess);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this `Result` may be an `Err` variant, which should be handled
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
@ -12,6 +12,10 @@ error[E0382]: borrow of moved value: `s1`
|
|||
| ^^ value borrowed here after move
|
||||
|
|
||||
= 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 cloning the value if the performance cost is acceptable
|
||||
|
|
||||
3 | let s2 = s1.clone();
|
||||
| ++++++++
|
||||
|
||||
For more information about this error, try `rustc --explain E0382`.
|
||||
error: could not compile `ownership` due to previous error
|
||||
|
|
|
@ -8,15 +8,10 @@ error[E0277]: cannot add `Option<i8>` to `i8`
|
|||
|
|
||||
= help: the trait `Add<Option<i8>>` is not implemented for `i8`
|
||||
= help: the following other types implement trait `Add<Rhs>`:
|
||||
<&'a f32 as Add<f32>>
|
||||
<&'a f64 as Add<f64>>
|
||||
<&'a i128 as Add<i128>>
|
||||
<&'a i16 as Add<i16>>
|
||||
<&'a i32 as Add<i32>>
|
||||
<&'a i64 as Add<i64>>
|
||||
<&'a i8 as Add<i8>>
|
||||
<&'a isize as Add<isize>>
|
||||
and 48 others
|
||||
<&i8 as Add<&i8>>
|
||||
<i8 as Add<&i8>>
|
||||
<i8 as Add>
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
error: could not compile `enums` due to previous error
|
||||
|
|
|
@ -7,6 +7,10 @@ error[E0004]: non-exhaustive patterns: `None` not covered
|
|||
| ^ pattern `None` not covered
|
||||
|
|
||||
note: `Option<i32>` defined here
|
||||
--> /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/option.rs:518:1
|
||||
|
|
||||
= note:
|
||||
/rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/option.rs:522:5: 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
|
||||
|
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
$ cargo build
|
||||
Compiling restaurant v0.1.0 (file:///projects/restaurant)
|
||||
error[E0433]: failed to resolve: use of undeclared crate or module `hosting`
|
||||
--> src/lib.rs:11:9
|
||||
|
|
||||
11 | hosting::add_to_waitlist();
|
||||
| ^^^^^^^ use of undeclared crate or module `hosting`
|
||||
|
||||
warning: unused import: `crate::front_of_house::hosting`
|
||||
--> src/lib.rs:7:5
|
||||
|
|
||||
|
@ -14,6 +8,12 @@ warning: unused import: `crate::front_of_house::hosting`
|
|||
|
|
||||
= note: `#[warn(unused_imports)]` on by default
|
||||
|
||||
error[E0433]: failed to resolve: use of undeclared crate or module `hosting`
|
||||
--> src/lib.rs:11:9
|
||||
|
|
||||
11 | hosting::add_to_waitlist();
|
||||
| ^^^^^^^ 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
|
||||
|
|
|
@ -14,7 +14,6 @@ error[E0277]: the type `String` cannot be indexed by `{integer}`
|
|||
<String as Index<RangeTo<usize>>>
|
||||
<String as Index<RangeToInclusive<usize>>>
|
||||
<String as Index<std::ops::Range<usize>>>
|
||||
<str as Index<I>>
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
error: could not compile `collections` due to previous error
|
||||
|
|
|
@ -10,7 +10,7 @@ test tests::exploration ... ok
|
|||
failures:
|
||||
|
||||
---- tests::another stdout ----
|
||||
thread 'main' panicked at 'Make this test fail', src/lib.rs:10:9
|
||||
thread 'tests::another' panicked at 'Make this test fail', src/lib.rs:10:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ failures:
|
|||
|
||||
---- tests::this_test_will_fail stdout ----
|
||||
I got the value 8
|
||||
thread 'main' panicked at 'assertion failed: `(left == right)`
|
||||
thread 'tests::this_test_will_fail' panicked at 'assertion failed: `(left == right)`
|
||||
left: `5`,
|
||||
right: `10`', src/lib.rs:19:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
|
|
@ -10,7 +10,7 @@ test tests::smaller_cannot_hold_larger ... ok
|
|||
failures:
|
||||
|
||||
---- tests::larger_can_hold_smaller stdout ----
|
||||
thread 'main' panicked at 'assertion failed: larger.can_hold(&smaller)', src/lib.rs:28:9
|
||||
thread 'tests::larger_can_hold_smaller' panicked at 'assertion failed: larger.can_hold(&smaller)', src/lib.rs:28:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ test tests::it_adds_two ... FAILED
|
|||
failures:
|
||||
|
||||
---- tests::it_adds_two stdout ----
|
||||
thread 'main' panicked at 'assertion failed: `(left == right)`
|
||||
thread 'tests::it_adds_two' panicked at 'assertion failed: `(left == right)`
|
||||
left: `4`,
|
||||
right: `5`', src/lib.rs:11:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
|
|
@ -9,7 +9,7 @@ test tests::greeting_contains_name ... FAILED
|
|||
failures:
|
||||
|
||||
---- tests::greeting_contains_name stdout ----
|
||||
thread 'main' panicked at 'assertion failed: result.contains(\"Carol\")', src/lib.rs:12:9
|
||||
thread 'tests::greeting_contains_name' panicked at 'assertion failed: result.contains(\"Carol\")', src/lib.rs:12:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ test tests::greeting_contains_name ... FAILED
|
|||
failures:
|
||||
|
||||
---- tests::greeting_contains_name stdout ----
|
||||
thread 'main' panicked at 'Greeting did not contain name, value was `Hello!`', src/lib.rs:12:9
|
||||
thread 'tests::greeting_contains_name' panicked at 'Greeting did not contain name, value was `Hello!`', src/lib.rs:12:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ test tests::greater_than_100 - should panic ... FAILED
|
|||
failures:
|
||||
|
||||
---- tests::greater_than_100 stdout ----
|
||||
thread 'main' panicked at 'Guess value must be greater than or equal to 1, got 200.', src/lib.rs:13:13
|
||||
thread 'tests::greater_than_100' panicked at 'Guess value must be greater than or equal to 1, got 200.', src/lib.rs:13:13
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
note: panic did not contain expected string
|
||||
panic message: `"Guess value must be greater than or equal to 1, got 200."`,
|
||||
|
|
|
@ -20,7 +20,7 @@ failures:
|
|||
|
||||
---- tests::this_test_will_fail stdout ----
|
||||
I got the value 8
|
||||
thread 'main' panicked at 'assertion failed: `(left == right)`
|
||||
thread 'tests::this_test_will_fail' panicked at 'assertion failed: `(left == right)`
|
||||
left: `5`,
|
||||
right: `10`', src/lib.rs:19:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
|
|
@ -4,7 +4,7 @@ warning: unused `Result` that must be used
|
|||
--> src/main.rs:19:5
|
||||
|
|
||||
19 | run(config);
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: this `Result` may be an `Err` variant, which should be handled
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
@ -9,7 +9,7 @@ test tests::one_result ... FAILED
|
|||
failures:
|
||||
|
||||
---- tests::one_result stdout ----
|
||||
thread 'main' panicked at 'assertion failed: `(left == right)`
|
||||
thread 'tests::one_result' panicked at 'assertion failed: `(left == right)`
|
||||
left: `["safe, fast, productive."]`,
|
||||
right: `[]`', src/lib.rs:44:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
|
|
@ -4,7 +4,7 @@ warning: unused `Map` that must be used
|
|||
--> src/main.rs:4:5
|
||||
|
|
||||
4 | v1.iter().map(|x| x + 1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: iterators are lazy and do nothing unless consumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
@ -9,7 +9,7 @@ test tests::it_sends_an_over_75_percent_warning_message ... FAILED
|
|||
failures:
|
||||
|
||||
---- tests::it_sends_an_over_75_percent_warning_message stdout ----
|
||||
thread 'main' panicked at 'already borrowed: BorrowMutError', src/lib.rs:60:53
|
||||
thread 'tests::it_sends_an_over_75_percent_warning_message' panicked at 'already borrowed: BorrowMutError', src/lib.rs:60:53
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,9 @@ note: required because it's used within this closure
|
|||
11 | let handle = thread::spawn(move || {
|
||||
| ^^^^^^^
|
||||
note: required by a bound in `spawn`
|
||||
--> /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/thread/mod.rs:704:8
|
||||
|
|
||||
= note: 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
|
||||
|
|
|
@ -9,6 +9,10 @@ error[E0005]: refutable pattern in local binding: `None` not covered
|
|||
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
|
||||
note: `Option<i32>` defined here
|
||||
--> /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/option.rs:518:1
|
||||
|
|
||||
= note:
|
||||
/rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/option.rs:522:5: not covered
|
||||
= note: the matched value is of type `Option<i32>`
|
||||
help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
|
|
|
@ -9,6 +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: this function takes ownership of the receiver `self`, which moves `worker.thread`
|
||||
--> /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/thread/mod.rs:1581:17
|
||||
|
||||
For more information about this error, try `rustc --explain E0507`.
|
||||
error: could not compile `hello` due to previous error
|
||||
|
|
|
@ -7,6 +7,7 @@ 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<()>`
|
||||
--> /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/thread/mod.rs:1581:5
|
||||
help: consider using `Option::expect` to unwrap the `JoinHandle<()>` value, panicking if the value is an `Option::None`
|
||||
|
|
||||
52 | worker.thread.expect("REASON").join().unwrap();
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.66
|
||||
1.67
|
||||
|
|
|
@ -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.66.1 (released 2023-01-10)
|
||||
This version of the text assumes you’re using Rust 1.67.1 (released 2023-02-09)
|
||||
or later. See the [“Installation” section of Chapter 1][install]<!-- ignore -->
|
||||
to install or update Rust.
|
||||
|
||||
|
|
Loading…
Reference in New Issue