mirror of https://github.com/rust-lang/book
Update to 1.56
This commit is contained in:
parent
aae859c187
commit
5f2729cdc5
|
@ -12,8 +12,8 @@ jobs:
|
|||
- name: Install Rust
|
||||
run: |
|
||||
rustup set profile minimal
|
||||
rustup toolchain install 1.55 -c rust-docs
|
||||
rustup default 1.55
|
||||
rustup toolchain install 1.56 -c rust-docs
|
||||
rustup default 1.56
|
||||
- name: Install mdbook
|
||||
run: |
|
||||
mkdir bin
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Administrative Tasks
|
||||
|
||||
This documentation is for Carol and Steve and anyone else managing the repo to
|
||||
remember how to do occasional maintenance tasks.
|
||||
This documentation is for anyone managing the repo to remember how to do
|
||||
occasional maintenance tasks.
|
||||
|
||||
## Update the `rustc` version
|
||||
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
$ cargo run
|
||||
Compiling functions v0.1.0 (file:///projects/functions)
|
||||
error: expected expression, found statement (`let`)
|
||||
--> src/main.rs:2:14
|
||||
|
|
||||
2 | let x = (let y = 6);
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: variable declaration using `let` is a statement
|
||||
|
||||
error[E0658]: `let` expressions in this position are experimental
|
||||
--> src/main.rs:2:14
|
||||
|
|
||||
|
@ -9,14 +17,6 @@ error[E0658]: `let` expressions in this position are experimental
|
|||
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
|
||||
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
|
||||
|
||||
error: expected expression, found statement (`let`)
|
||||
--> src/main.rs:2:14
|
||||
|
|
||||
2 | let x = (let y = 6);
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: variable declaration using `let` is a statement
|
||||
|
||||
warning: unnecessary parentheses around assigned value
|
||||
--> src/main.rs:2:13
|
||||
|
|
||||
|
|
|
@ -10,7 +10,7 @@ error[E0106]: missing lifetime specifier
|
|||
help: consider using the `'static` lifetime
|
||||
|
|
||||
5 | fn dangle() -> &'static String {
|
||||
| ^^^^^^^^
|
||||
| ~~~~~~~~
|
||||
|
||||
For more information about this error, try `rustc --explain E0106`.
|
||||
error: could not compile `ownership` due to previous error
|
||||
|
|
|
@ -8,9 +8,9 @@ error[E0106]: missing lifetime specifier
|
|||
|
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
1 | struct User<'a> {
|
||||
1 ~ struct User<'a> {
|
||||
2 | active: bool,
|
||||
3 | username: &'a str,
|
||||
3 ~ username: &'a str,
|
||||
|
|
||||
|
||||
error[E0106]: missing lifetime specifier
|
||||
|
@ -21,10 +21,10 @@ error[E0106]: missing lifetime specifier
|
|||
|
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
1 | struct User<'a> {
|
||||
1 ~ struct User<'a> {
|
||||
2 | active: bool,
|
||||
3 | username: &str,
|
||||
4 | email: &'a str,
|
||||
4 ~ email: &'a str,
|
||||
|
|
||||
|
||||
For more information about this error, try `rustc --explain E0106`.
|
||||
|
|
|
@ -11,7 +11,7 @@ error[E0369]: binary operation `>` cannot be applied to type `T`
|
|||
help: consider restricting type parameter `T`
|
||||
|
|
||||
1 | fn largest<T: std::cmp::PartialOrd>(list: &[T]) -> T {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ++++++++++++++++++++++
|
||||
|
||||
For more information about this error, try `rustc --explain E0369`.
|
||||
error: could not compile `chapter10` due to previous error
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "chapter10"
|
||||
version = "0.1.0"
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aggregator"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "chapter10"
|
||||
version = "0.1.0"
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aggregator"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "chapter10"
|
||||
version = "0.1.0"
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aggregator"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -10,7 +10,7 @@ error[E0106]: missing lifetime specifier
|
|||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
9 | fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
|
||||
| ^^^^ ^^^^^^^ ^^^^^^^ ^^^
|
||||
| ++++ ++ ++ ++
|
||||
|
||||
For more information about this error, try `rustc --explain E0106`.
|
||||
error: could not compile `chapter10` due to previous error
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "chapter10"
|
||||
version = "0.1.0"
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aggregator"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "chapter10"
|
||||
version = "0.1.0"
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aggregator"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "chapter10"
|
||||
version = "0.1.0"
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aggregator"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "chapter10"
|
||||
version = "0.1.0"
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aggregator"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "chapter10"
|
||||
version = "0.1.0"
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aggregator"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -10,7 +10,7 @@ error[E0106]: missing lifetime specifier
|
|||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
28 | pub fn search<'a>(query: &'a str, contents: &'a str) -> Vec<&'a str> {
|
||||
| ^^^^ ^^^^^^^ ^^^^^^^ ^^^
|
||||
| ++++ ++ ++ ++
|
||||
|
||||
For more information about this error, try `rustc --explain E0106`.
|
||||
error: could not compile `minigrep` due to previous error
|
||||
|
|
|
@ -4,10 +4,9 @@ error[E0308]: mismatched types
|
|||
--> src/main.rs:5:29
|
||||
|
|
||||
5 | let n = example_closure(5);
|
||||
| ^
|
||||
| ^- help: try using a conversion method: `.to_string()`
|
||||
| |
|
||||
| expected struct `String`, found integer
|
||||
| help: try using a conversion method: `5.to_string()`
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
error: could not compile `closure-example` due to previous error
|
||||
|
|
|
@ -11,7 +11,7 @@ error[E0072]: recursive type `List` has infinite size
|
|||
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `List` representable
|
||||
|
|
||||
2 | Cons(i32, Box<List>),
|
||||
| ^^^^ ^
|
||||
| ++++ +
|
||||
|
||||
error[E0391]: cycle detected when computing drop-check constraints for `List`
|
||||
--> src/main.rs:1:1
|
||||
|
@ -19,7 +19,7 @@ error[E0391]: cycle detected when computing drop-check constraints for `List`
|
|||
1 | enum List {
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: ...which again requires computing drop-check constraints for `List`, completing the cycle
|
||||
= note: ...which immediately requires computing drop-check constraints for `List` again
|
||||
= note: cycle used when computing dropck types for `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: List } }`
|
||||
|
||||
Some errors have detailed explanations: E0072, E0391.
|
||||
|
|
|
@ -19,7 +19,7 @@ note: function requires argument type to outlive `'static`
|
|||
help: to force the closure to take ownership of `v` (and any other referenced variables), use the `move` keyword
|
||||
|
|
||||
6 | let handle = thread::spawn(move || {
|
||||
| ^^^^^^^
|
||||
| ++++
|
||||
|
||||
For more information about this error, try `rustc --explain E0373`.
|
||||
error: could not compile `threads` due to previous error
|
||||
|
|
|
@ -15,6 +15,7 @@ error[E0277]: `Rc<Mutex<i32>>` cannot be sent between threads safely
|
|||
|
|
||||
= help: within `[closure@src/main.rs:11:36: 15:10]`, the trait `Send` is not implemented for `Rc<Mutex<i32>>`
|
||||
= note: required because it appears within the type `[closure@src/main.rs:11:36: 15:10]`
|
||||
note: required by a bound in `spawn`
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
error: could not compile `shared-state` due to previous error
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
$ cargo run
|
||||
Compiling patterns v0.1.0 (file:///projects/patterns)
|
||||
warning: irrefutable `if let` pattern
|
||||
--> src/main.rs:2:5
|
||||
--> src/main.rs:2:8
|
||||
|
|
||||
2 | / if let x = 5 {
|
||||
3 | | println!("{}", x);
|
||||
4 | | };
|
||||
| |_____^
|
||||
2 | if let x = 5 {
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(irrefutable_let_patterns)]` on by default
|
||||
= note: this pattern will always match, so the `if let` is useless
|
||||
|
|
|
@ -3,14 +3,16 @@ $ cargo run
|
|||
error[E0277]: `Point` doesn't implement `std::fmt::Display`
|
||||
--> src/main.rs:20:6
|
||||
|
|
||||
3 | trait OutlinePrint: fmt::Display {
|
||||
| ------------ required by this bound in `OutlinePrint`
|
||||
...
|
||||
20 | impl OutlinePrint for Point {}
|
||||
| ^^^^^^^^^^^^ `Point` cannot be formatted with the default formatter
|
||||
|
|
||||
= help: the trait `std::fmt::Display` is not implemented for `Point`
|
||||
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
||||
note: required by a bound in `OutlinePrint`
|
||||
--> src/main.rs:3:21
|
||||
|
|
||||
3 | trait OutlinePrint: fmt::Display {
|
||||
| ^^^^^^^^^^^^ required by this bound in `OutlinePrint`
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
error: could not compile `traits-example` due to previous error
|
||||
|
|
|
@ -10,7 +10,7 @@ error[E0746]: return type cannot have an unboxed trait object
|
|||
help: use `impl Fn(i32) -> i32` as the return type, as all return paths are of type `[closure@src/lib.rs:2:5: 2:14]`, which implements `Fn(i32) -> i32`
|
||||
|
|
||||
1 | fn returns_closure() -> impl Fn(i32) -> i32 {
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
| ~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For more information about this error, try `rustc --explain E0746`.
|
||||
error: could not compile `functions-example` due to previous error
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.55
|
||||
1.56
|
||||
|
|
|
@ -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.55 or later with
|
||||
This version of the text assumes you’re using Rust 1.56 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
|
||||
|
|
Loading…
Reference in New Issue