Skip to content

Commit

Permalink
Update to Rust 1.55
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Sep 17, 2021
1 parent e7d05ce commit 126aa9f
Show file tree
Hide file tree
Showing 72 changed files with 101 additions and 358 deletions.
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.54 -c rust-docs
rustup default 1.54
rustup toolchain install 1.55 -c rust-docs
rustup default 1.55
- name: Install mdbook
run: |
mkdir bin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,5 @@ error[E0308]: mismatched types
= 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`

To learn more, run the command again with --verbose.
error: could not compile `guessing_game` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ warning: unused `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

warning: `guessing_game` (bin "guessing_game") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 0.59s
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,5 @@ error[E0384]: cannot assign twice to immutable variable `x`
4 | x = 6;
| ^^^^^ cannot assign twice to immutable variable

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `variables` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ error[E0308]: mismatched types
3 | spaces = spaces.len();
| ^^^^^^^^^^^^ expected `&str`, found `usize`

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `variables` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ warning: unnecessary parentheses around assigned value
|
= 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.
warning: `functions` (bin "functions") generated 1 warning
error: could not compile `functions` due to 2 previous errors; 1 warning emitted
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,5 @@ error[E0308]: mismatched types
8 | x + 1;
| - help: consider removing this semicolon

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `functions` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ error[E0308]: mismatched types
4 | if number {
| ^^^^^^ expected `bool`, found integer

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `branches` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ error[E0308]: `if` and `else` have incompatible types
| |
| expected because of this

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `branches` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ error[E0282]: type annotations needed
2 | let guess = "42".parse().expect("Not a number!");
| ^^^^^ consider giving `guess` a type

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `no_type_annotations` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ error[E0596]: cannot borrow `*some_string` as mutable, as it is behind a `&` ref
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`

To learn more, run the command again with --verbose.
error: could not compile `ownership` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ error[E0382]: borrow of moved value: `s1`
5 | println!("{}, world!", s1);
| ^^ value borrowed here after move

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `ownership` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ error[E0499]: cannot borrow `s` as mutable more than once at a time
7 | println!("{}, {}", r1, r2);
| -- first borrow later used here

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `ownership` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,5 @@ error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immuta
8 | println!("{}, {}, and {}", r1, r2, r3);
| -- immutable borrow later used here

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `ownership` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,5 @@ 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`

To learn more, run the command again with --verbose.
error: could not compile `ownership` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,5 @@ error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immuta
20 | println!("the first word is: {}", word);
| ---- immutable borrow later used here

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `ownership` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,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 the macro `$crate::format_args_nl` (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 `rectangles`

To learn more, run the command again with --verbose.
error: could not compile `rectangles` due to previous error
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
$ cargo run
Compiling structs v0.1.0 (file:///projects/structs)
error[E0106]: missing lifetime specifier
--> src/main.rs:2:15
--> src/main.rs:3:15
|
2 | username: &str,
3 | username: &str,
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
1 | struct User<'a> {
2 | username: &'a str,
2 | active: bool,
3 | username: &'a str,
|

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

To learn more, run the command again with --verbose.
error: could not compile `structs` due to 2 previous errors
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ error[E0277]: `Rectangle` doesn't implement `Debug`
| ^^^^^ `Rectangle` cannot be formatted using `{:?}`
|
= 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: add `#[derive(Debug)]` to `Rectangle` or manually `impl Debug for Rectangle`
= 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

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

To learn more, run the command again with --verbose.
error: could not compile `rectangles` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ error[E0277]: cannot add `Option<i8>` to `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`

To learn more, run the command again with --verbose.
error: could not compile `enums` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ error[E0004]: non-exhaustive patterns: `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`

To learn more, run the command again with --verbose.
error: could not compile `enums` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,5 @@ note: the module `hosting` is defined here
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`

To learn more, run the command again with --verbose.
error: could not compile `restaurant` due to 2 previous errors
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,5 @@ note: the function `add_to_waitlist` is defined here
3 | fn add_to_waitlist() {}
| ^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

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

To learn more, run the command again with --verbose.
error: could not compile `restaurant` due to 2 previous errors
6 changes: 1 addition & 5 deletions listings/ch08-common-collections/listing-08-07/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,5 @@ error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immuta
8 | println!("The first element is: {}", first);
| ----- immutable borrow later used here

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `collections` due to previous error
6 changes: 1 addition & 5 deletions listings/ch08-common-collections/listing-08-19/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ error[E0277]: the type `String` cannot be indexed by `{integer}`
|
= 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`

To learn more, run the command again with --verbose.
error: could not compile `collections` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ error[E0308]: mismatched types
= note: expected type `u32`
found enum `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`

To learn more, run the command again with --verbose.
error: could not compile `error-handling` due to previous error
Original file line number Diff line number Diff line change
@@ -1,20 +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 `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 `()`
5 | | }
| |_- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()`
= note: required by `from_residual`

error: aborting due to previous error
--> src/main.rs:4:36
|
3 | / fn main() {
4 | | let f = File::open("hello.txt")?;
| | ^ cannot use the `?` operator in a function that returns `()`
5 | | }
| |_- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()`
note: required by `from_residual`

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

To learn more, run the command again with --verbose.
error: could not compile `error-handling` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,5 @@ help: consider restricting type parameter `T`
1 | fn largest<T: std::cmp::PartialOrd>(list: &[T]) -> T {
| ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `chapter10` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ error[E0308]: mismatched types
7 | let wont_work = Point { x: 5, y: 4.0 };
| ^^^ expected integer, found floating-point number

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `chapter10` due to previous error
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ error[E0597]: `x` does not live long enough
10 | println!("r: {}", r);
| - borrow later used here

error: aborting due to previous error

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

To learn more, run the command again with --verbose.
error: could not compile `chapter10` due to previous error
Loading

0 comments on commit 126aa9f

Please sign in to comment.