mirror of
https://github.com/rust-lang/book.git
synced 2026-12-01 14:56:08 -06:00
Update to Rust 1.75
This commit is contained in:
committed by
Carol (Nichols || Goulding)
parent
551369f4b1
commit
57516ea03b
@@ -12,8 +12,8 @@ jobs:
|
||||
- name: Install Rust
|
||||
run: |
|
||||
rustup set profile minimal
|
||||
rustup toolchain install 1.74 -c rust-docs
|
||||
rustup default 1.74
|
||||
rustup toolchain install 1.75 -c rust-docs
|
||||
rustup default 1.75
|
||||
- name: Install mdbook
|
||||
run: |
|
||||
mkdir bin
|
||||
|
||||
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
|
||||
= note: expected reference `&String`
|
||||
found reference `&{integer}`
|
||||
note: method defined here
|
||||
--> /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/cmp.rs:793:8
|
||||
--> /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/cmp.rs:811:8
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
error: could not compile `guessing_game` (bin "guessing_game") due to previous error
|
||||
|
||||
+4
-3
@@ -1,15 +1,16 @@
|
||||
$ cargo build
|
||||
Compiling no_type_annotations v0.1.0 (file:///projects/no_type_annotations)
|
||||
error[E0282]: type annotations needed
|
||||
error[E0284]: type annotations needed
|
||||
--> src/main.rs:2:9
|
||||
|
|
||||
2 | let guess = "42".parse().expect("Not a number!");
|
||||
| ^^^^^
|
||||
| ^^^^^ ----- type must be known at this point
|
||||
|
|
||||
= note: cannot satisfy `<_ as FromStr>::Err == _`
|
||||
help: consider giving `guess` an explicit type
|
||||
|
|
||||
2 | let guess: /* Type */ = "42".parse().expect("Not a number!");
|
||||
| ++++++++++++
|
||||
|
||||
For more information about this error, try `rustc --explain E0282`.
|
||||
For more information about this error, try `rustc --explain E0284`.
|
||||
error: could not compile `no_type_annotations` (bin "no_type_annotations") due to previous error
|
||||
|
||||
+2
-2
@@ -7,8 +7,8 @@ error[E0004]: non-exhaustive patterns: `None` not covered
|
||||
| ^ pattern `None` not covered
|
||||
|
|
||||
note: `Option<i32>` defined here
|
||||
--> /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/option.rs:563:1
|
||||
::: /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/option.rs:567:5
|
||||
--> /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:569:1
|
||||
::: /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:573:5
|
||||
|
|
||||
= note: not covered
|
||||
= note: the matched value is of type `Option<i32>`
|
||||
|
||||
@@ -10,7 +10,7 @@ failures:
|
||||
|
||||
---- tests::greeting_contains_name stdout ----
|
||||
thread 'tests::greeting_contains_name' panicked at src/lib.rs:12:9:
|
||||
assertion failed: result.contains(\"Carol\")
|
||||
assertion failed: result.contains("Carol")
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,13 @@ error[E0308]: mismatched types
|
||||
| | expected `String`, found integer
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: expected because the closure was earlier called with an argument of type `String`
|
||||
--> src/main.rs:4:29
|
||||
|
|
||||
4 | let s = example_closure(String::from("hello"));
|
||||
| --------------- ^^^^^^^^^^^^^^^^^^^^^ expected because this argument is of type `String`
|
||||
| |
|
||||
| in this closure call
|
||||
note: closure parameter defined here
|
||||
--> src/main.rs:2:28
|
||||
|
|
||||
|
||||
@@ -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/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/thread/mod.rs:680:1
|
||||
--> /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/thread/mod.rs:682:1
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
error: could not compile `shared-state` (bin "shared-state") due to previous error
|
||||
|
||||
@@ -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::<T>::join` takes ownership of the receiver `self`, which moves `worker.thread`
|
||||
--> /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/thread/mod.rs:1650:17
|
||||
--> /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/thread/mod.rs:1652:17
|
||||
|
||||
For more information about this error, try `rustc --explain E0507`.
|
||||
error: could not compile `hello` (lib) due to previous error
|
||||
|
||||
@@ -7,7 +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/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/thread/mod.rs:1650:5
|
||||
--> /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/thread/mod.rs:1652: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 +1 @@
|
||||
1.74
|
||||
1.75
|
||||
|
||||
+1
-1
@@ -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.74.1 (released 2023-12-07)
|
||||
This version of the text assumes you’re using Rust 1.75.0 (released 2023-12-28)
|
||||
or later. See the [“Installation” section of Chapter 1][install]<!-- ignore -->
|
||||
to install or update Rust.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user