mirror of
https://github.com/rust-lang/book.git
synced 2026-05-17 17:52:12 -04:00
Merge pull request #2809 from rust-lang/1.54
This commit is contained in:
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -12,8 +12,8 @@ jobs:
|
||||
- name: Install Rust
|
||||
run: |
|
||||
rustup set profile minimal
|
||||
rustup toolchain install 1.53 -c rust-docs
|
||||
rustup default 1.53
|
||||
rustup toolchain install 1.54 -c rust-docs
|
||||
rustup default 1.54
|
||||
- name: Install mdbook
|
||||
run: |
|
||||
mkdir bin
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
$ cargo run
|
||||
Compiling loops v0.1.0 (file:///projects/loops)
|
||||
Finished dev [unoptimized + debuginfo] target(s) in 0.58s
|
||||
Running `target/debug/loops`
|
||||
|
||||
@@ -9,7 +9,7 @@ error[E0277]: `Rectangle` doesn't implement `std::fmt::Display`
|
||||
= help: the trait `std::fmt::Display` is not implemented for `Rectangle`
|
||||
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
||||
= note: required by `std::fmt::Display::fmt`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ error[E0277]: `Rectangle` doesn't implement `Debug`
|
||||
= help: the trait `Debug` is not implemented for `Rectangle`
|
||||
= note: add `#[derive(Debug)]` or manually implement `Debug`
|
||||
= note: required by `std::fmt::Debug::fmt`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
$ cargo run
|
||||
Compiling error-handling v0.1.0 (file:///projects/error-handling)
|
||||
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `Try`)
|
||||
--> src/main.rs:4:13
|
||||
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:36
|
||||
|
|
||||
3 | / fn main() {
|
||||
4 | | let f = File::open("hello.txt")?;
|
||||
| | ^^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
|
||||
| | ^ cannot use the `?` operator in a function that returns `()`
|
||||
5 | | }
|
||||
| |_- this function should return `Result` or `Option` to accept `?`
|
||||
|
|
||||
= help: the trait `Try` is not implemented for `()`
|
||||
= note: required by `from_error`
|
||||
= help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()`
|
||||
= note: required by `from_residual`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ $ cargo test
|
||||
Running unittests (target/debug/deps/guessing_game-57d70c3acb738f4d)
|
||||
|
||||
running 1 test
|
||||
test tests::greater_than_100 ... ok
|
||||
test tests::greater_than_100 - should panic ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ $ cargo test
|
||||
Running unittests (target/debug/deps/guessing_game-57d70c3acb738f4d)
|
||||
|
||||
running 1 test
|
||||
test tests::greater_than_100 ... FAILED
|
||||
test tests::greater_than_100 - should panic ... FAILED
|
||||
|
||||
failures:
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ $ cargo test
|
||||
Running unittests (target/debug/deps/guessing_game-57d70c3acb738f4d)
|
||||
|
||||
running 1 test
|
||||
test tests::greater_than_100 ... FAILED
|
||||
test tests::greater_than_100 - should panic ... FAILED
|
||||
|
||||
failures:
|
||||
|
||||
|
||||
@@ -3,8 +3,9 @@ $ cargo test
|
||||
error[E0596]: cannot borrow `self.sent_messages` as mutable, as it is behind a `&` reference
|
||||
--> src/lib.rs:58:13
|
||||
|
|
||||
57 | fn send(&self, message: &str) {
|
||||
| ----- help: consider changing this to be a mutable reference: `&mut self`
|
||||
2 | fn send(&self, msg: &str);
|
||||
| ----- help: consider changing that to be a mutable reference: `&mut self`
|
||||
...
|
||||
58 | self.sent_messages.push(String::from(message));
|
||||
| ^^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ error[E0277]: can't compare `{integer}` with `&{integer}`
|
||||
| ^^^^^^^^^^^^^^^^^ no implementation for `{integer} == &{integer}`
|
||||
|
|
||||
= help: the trait `PartialEq<&{integer}>` is not implemented for `{integer}`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$ cargo check
|
||||
Checking hello v0.1.0 (file:///projects/hello)
|
||||
error[E0599]: no method named `join` found for enum `Option<JoinHandle<()>>` in the current scope
|
||||
error[E0599]: no method named `join` found for enum `Option` in the current scope
|
||||
--> src/lib.rs:52:27
|
||||
|
|
||||
52 | worker.thread.join().unwrap();
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.53
|
||||
1.54
|
||||
|
||||
@@ -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.53 or later with
|
||||
This version of the text assumes you’re using Rust 1.54 or later with
|
||||
`edition="2018"` in *Cargo.toml* of all projects to use Rust 2018 Edition
|
||||
idioms. See the [“Installation” section of Chapter 1][install]<!-- ignore -->
|
||||
to install or update Rust, and see the new [Appendix E][editions]<!-- ignore
|
||||
|
||||
Reference in New Issue
Block a user