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
Prev Previous commit
Next Next commit
Update to 1.48
  • Loading branch information
carols10cents committed Dec 5, 2020
commit 4cd410bab6ff48163a9b85fa99b781aeedfc2067
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.47 -c rust-docs
rustup default 1.47
rustup toolchain install 1.48 -c rust-docs
rustup default 1.48
- name: Install mdbook
run: |
mkdir bin
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 @@ -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
Expand Up @@ -27,6 +27,6 @@ warning: unnecessary parentheses around assigned value
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`.
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
Expand Up @@ -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 @@ -15,6 +15,6 @@ help: consider using the `'static` lifetime
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 @@ -14,6 +14,6 @@ error[E0277]: `Rectangle` doesn't implement `std::fmt::Display`
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 @@ -28,6 +28,6 @@ help: consider introducing a named lifetime parameter
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,19 +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
Expand Up @@ -7,11 +7,11 @@ error[E0004]: non-exhaustive patterns: `None` not covered
| ^ 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 `std::option::Option<i32>`
= 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
Expand Up @@ -27,6 +27,6 @@ note: the module `hosting` is defined here
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.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ note: the function `add_to_waitlist` is defined here
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.
2 changes: 1 addition & 1 deletion listings/ch08-common-collections/listing-08-07/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ error[E0502]: cannot borrow `v` 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 `collections`.
error: could not compile `collections`

To learn more, run the command again with --verbose.
8 changes: 4 additions & 4 deletions listings/ch08-common-collections/listing-08-19/output.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
$ cargo run
Compiling collections v0.1.0 (file:///projects/collections)
error[E0277]: the type `std::string::String` cannot be indexed by `{integer}`
error[E0277]: the type `String` cannot be indexed by `{integer}`
--> src/main.rs:3:13
|
3 | let h = s1[0];
| ^^^^^ `std::string::String` cannot be indexed by `{integer}`
| ^^^^^ `String` cannot be indexed by `{integer}`
|
= help: the trait `std::ops::Index<{integer}>` is not implemented for `std::string::String`
= help: the trait `Index<{integer}>` is not implemented for `String`

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ error[E0308]: mismatched types
| expected due to this
|
= note: expected type `u32`
found enum `std::result::Result<std::fs::File, std::io::Error>`
found enum `std::result::Result<File, std::io::Error>`

error: aborting due to previous error

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

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 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 `std::ops::Try`)
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
|
3 | / fn main() {
Expand All @@ -9,12 +9,12 @@ error[E0277]: the `?` operator can only be used in a function that returns `Resu
5 | | }
| |_- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::from_error`
= help: the trait `Try` is not implemented for `()`
= note: required by `from_error`

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ help: consider restricting type parameter `T`
error: aborting due to previous error

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

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 `chapter10`.
error: could not compile `chapter10`

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[E0597]: `x` does not live long enough
error: aborting due to previous error

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

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 @@ help: consider introducing a named lifetime parameter
error: aborting due to previous error

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

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[E0597]: `string2` does not live long enough
error: aborting due to previous error

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

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ error: aborting due to 2 previous errors

Some errors have detailed explanations: E0507, E0508.
For more information about an error, try `rustc --explain E0507`.
error: could not compile `chapter10`.
error: could not compile `chapter10`

To learn more, run the command again with --verbose.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ error[E0515]: cannot return value referencing local variable `result`
error: aborting due to previous error

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

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 @@ help: consider introducing a named lifetime parameter
error: aborting due to previous error

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

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