Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rust version and output #2518

Merged
merged 13 commits into from
Dec 9, 2020
Merged
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.41.0 -c rust-docs
rustup default 1.41.0
rustup toolchain install 1.48 -c rust-docs
rustup default 1.48
- name: Install mdbook
run: |
mkdir bin
Expand Down
2 changes: 2 additions & 0 deletions ci/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ nonadministrators
nondeterministic
nonequality
nongeneric
noplayground
NotFound
nsprust
null's
Expand Down Expand Up @@ -470,6 +471,7 @@ supertraits
TcpListener
TcpStream
templating
test_harness
test's
TextField
That'd
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 @@ -8,14 +8,14 @@ error[E0308]: mismatched types
--> src/main.rs:22:21
|
22 | match guess.cmp(&secret_number) {
| ^^^^^^^^^^^^^^ expected struct `std::string::String`, found integer
| ^^^^^^^^^^^^^^ expected struct `String`, found integer
|
= note: expected reference `&std::string::String`
= note: expected reference `&String`
found reference `&{integer}`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `guessing_game`.
error: could not compile `guessing_game`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ warning: unused `std::result::Result` that must be used
= note: `#[warn(unused_must_use)]` on by default
= note: this `Result` may be an `Err` variant, which should be handled

warning: 1 warning emitted

Finished dev [unoptimized + debuginfo] target(s) in 0.59s
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ error[E0384]: cannot assign twice to immutable variable `x`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0384`.
error: could not compile `variables`.
error: could not compile `variables`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ error[E0308]: mismatched types
error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `variables`.
error: could not compile `variables`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ error: this operation will panic at runtime
--> src/main.rs:5:19
|
5 | let element = a[index];
| ^^^^^^^^ index out of bounds: the len is 5 but the index is 10
| ^^^^^^^^ index out of bounds: the length is 5 but the index is 10
|
= note: `#[deny(unconditional_panic)]` on by default

error: aborting due to previous error

error: could not compile `arrays`.
error: could not compile `arrays`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
$ cargo run
Compiling functions v0.1.0 (file:///projects/functions)
error[E0658]: `let` expressions in this position are experimental
--> src/main.rs:2:14
|
2 | let x = (let y = 6);
| ^^^^^^^^^
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information

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
|
2 | let x = (let y = 6);
| ^^^^^^^^^^^ help: remove these parentheses
|
= note: variable declaration using `let` is a statement
= note: `#[warn(unused_parens)]` on by default

error: aborting due to 2 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0658`.
error: could not compile `functions`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ error[E0308]: mismatched types
error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `functions`.
error: could not compile `functions`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ error[E0308]: mismatched types
error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `branches`.
error: could not compile `branches`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ cargo run
Compiling branches v0.1.0 (file:///projects/branches)
error[E0308]: if and else have incompatible types
error[E0308]: `if` and `else` have incompatible types
--> src/main.rs:4:44
|
4 | let number = if condition { 5 } else { "six" };
Expand All @@ -11,6 +11,6 @@ error[E0308]: if and else have incompatible types
error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `branches`.
error: could not compile `branches`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ error[E0282]: type annotations needed
error: aborting due to previous error

For more information about this error, try `rustc --explain E0282`.
error: could not compile `no_type_annotations`.
error: could not compile `no_type_annotations`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ error[E0596]: cannot borrow `*some_string` as mutable, as it is behind a `&` ref
--> src/main.rs:8:5
|
7 | fn change(some_string: &String) {
| ------- help: consider changing this to be a mutable reference: `&mut std::string::String`
| ------- help: consider changing this to be a mutable reference: `&mut String`
8 | some_string.push_str(", world");
| ^^^^^^^^^^^ `some_string` is a `&` reference, so the data it refers to cannot be borrowed as mutable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0596`.
error: could not compile `ownership`.
error: could not compile `ownership`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0382]: borrow of moved value: `s1`
--> src/main.rs:5:28
|
2 | let s1 = String::from("hello");
| -- move occurs because `s1` has type `std::string::String`, which does not implement the `Copy` trait
| -- move occurs because `s1` has type `String`, which does not implement the `Copy` trait
3 | let s2 = s1;
| -- value moved here
4 |
Expand All @@ -14,6 +14,6 @@ error[E0382]: borrow of moved value: `s1`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0382`.
error: could not compile `ownership`.
error: could not compile `ownership`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ error[E0499]: cannot borrow `s` as mutable more than once at a time
error: aborting due to previous error

For more information about this error, try `rustc --explain E0499`.
error: could not compile `ownership`.
error: could not compile `ownership`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immuta
error: aborting due to previous error

For more information about this error, try `rustc --explain E0502`.
error: could not compile `ownership`.
error: could not compile `ownership`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ error[E0106]: missing lifetime specifier
--> src/main.rs:5:16
|
5 | fn dangle() -> &String {
| ^ help: consider giving it a 'static lifetime: `&'static`
| ^ expected named lifetime parameter
|
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
help: consider using the `'static` lifetime
|
5 | fn dangle() -> &'static String {
| ^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0106`.
error: could not compile `ownership`.
error: could not compile `ownership`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immuta
error: aborting due to previous error

For more information about this error, try `rustc --explain E0502`.
error: could not compile `ownership`.
error: could not compile `ownership`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ 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)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `structs`.
error: could not compile `structs`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,30 @@ error[E0106]: missing lifetime specifier
--> src/main.rs:2:15
|
2 | username: &str,
| ^ expected lifetime parameter
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
1 | struct User<'a> {
2 | username: &'a str,
|

error[E0106]: missing lifetime specifier
--> src/main.rs:3:12
|
3 | email: &str,
| ^ expected lifetime parameter
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
1 | struct User<'a> {
2 | username: &str,
3 | email: &'a str,
|

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0106`.
error: could not compile `structs`.
error: could not compile `structs`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
$ cargo run
Compiling structs v0.1.0 (file:///projects/structs)
error[E0277]: `Rectangle` doesn't implement `std::fmt::Debug`
error[E0277]: `Rectangle` doesn't implement `Debug`
--> src/main.rs:12:31
|
12 | println!("rect1 is {:?}", rect1);
| ^^^^^ `Rectangle` cannot be formatted using `{:?}`
|
= help: the trait `std::fmt::Debug` is not implemented for `Rectangle`
= note: add `#[derive(Debug)]` or manually implement `std::fmt::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)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `structs`.
error: could not compile `structs`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
$ cargo run
Compiling enums v0.1.0 (file:///projects/enums)
error[E0277]: cannot add `std::option::Option<i8>` to `i8`
error[E0277]: cannot add `Option<i8>` to `i8`
--> src/main.rs:5:17
|
5 | let sum = x + y;
| ^ no implementation for `i8 + std::option::Option<i8>`
| ^ no implementation for `i8 + Option<i8>`
|
= help: the trait `std::ops::Add<std::option::Option<i8>>` is not implemented for `i8`
= help: the trait `Add<Option<i8>>` is not implemented for `i8`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `enums`.
error: could not compile `enums`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
$ cargo run
Compiling enums v0.1.0 (file:///projects/enums)
error[E0004]: non-exhaustive patterns: `None` not covered
--> src/main.rs:3:15
|
3 | match x {
| ^ pattern `None` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
--> src/main.rs:3:15
|
3 | match x {
| ^ pattern `None` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `Option<i32>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0004`.
error: could not compile `enums`.
error: could not compile `enums`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ANCHOR: here
mod front_of_house {
mod hosting {
fn add_to_waitlist() {}
Expand All @@ -14,6 +13,3 @@ mod front_of_house {
fn take_payment() {}
}
}
// ANCHOR_END: here

fn main() {}
18 changes: 15 additions & 3 deletions listings/ch07-managing-growing-projects/listing-07-03/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,29 @@ error[E0603]: module `hosting` is private
--> src/lib.rs:9:28
|
9 | crate::front_of_house::hosting::add_to_waitlist();
| ^^^^^^^
| ^^^^^^^ private module
|
note: the module `hosting` is defined here
--> src/lib.rs:2:5
|
2 | mod hosting {
| ^^^^^^^^^^^

error[E0603]: module `hosting` is private
--> src/lib.rs:12:21
|
12 | front_of_house::hosting::add_to_waitlist();
| ^^^^^^^
| ^^^^^^^ private module
|
note: the module `hosting` is defined here
--> src/lib.rs:2:5
|
2 | mod hosting {
| ^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0603`.
error: could not compile `restaurant`.
error: could not compile `restaurant`

To learn more, run the command again with --verbose.
Loading