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 Rustc #2718

Merged
merged 2 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.50 -c rust-docs
rustup default 1.50
rustup toolchain install 1.52 -c rust-docs
rustup default 1.52
- name: Install mdbook
run: |
mkdir bin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ cargo build
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
warning: unused `std::result::Result` that must be used
warning: unused `Result` that must be used
--> src/main.rs:10:5
|
10 | io::stdin().read_line(&mut guess);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ error[E0308]: mismatched types
--> src/main.rs:4:18
|
4 | let f: u32 = File::open("hello.txt");
| --- ^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found enum `std::result::Result`
| --- ^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found enum `Result`
| |
| expected due to this
|
= note: expected type `u32`
found enum `std::result::Result<File, std::io::Error>`
found enum `Result<File, std::io::Error>`

error: aborting due to previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.57s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 1 test
test tests::it_works ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.72s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 2 tests
test tests::another ... FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling rectangle v0.1.0 (file:///projects/rectangle)
Finished test [unoptimized + debuginfo] target(s) in 0.66s
Running target/debug/deps/rectangle-6584c4561e48942e
Running unittests (target/debug/deps/rectangle-6584c4561e48942e)

running 1 test
test tests::larger_can_hold_smaller ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.58s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 1 test
test tests::it_adds_two ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished test [unoptimized + debuginfo] target(s) in 0.58s
Running target/debug/deps/guessing_game-57d70c3acb738f4d
Running unittests (target/debug/deps/guessing_game-57d70c3acb738f4d)

running 1 test
test tests::greater_than_100 ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling silly-function v0.1.0 (file:///projects/silly-function)
Finished test [unoptimized + debuginfo] target(s) in 0.58s
Running target/debug/deps/silly_function-160869f38cff9166
Running unittests (target/debug/deps/silly_function-160869f38cff9166)

running 2 tests
test tests::this_test_will_fail ... FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.62s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 3 tests
test tests::add_three_and_two ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 1.31s
Running target/debug/deps/adder-1082c4b063a8fbe6
Running unittests (target/debug/deps/adder-1082c4b063a8fbe6)

running 1 test
test tests::internal ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Running target/debug/deps/integration_test-1082c4b063a8fbe6
Running tests/integration_test.rs (target/debug/deps/integration_test-1082c4b063a8fbe6)

running 1 test
test it_adds_two ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.59s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 1 test
test tests::exploration ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling rectangle v0.1.0 (file:///projects/rectangle)
Finished test [unoptimized + debuginfo] target(s) in 0.66s
Running target/debug/deps/rectangle-6584c4561e48942e
Running unittests (target/debug/deps/rectangle-6584c4561e48942e)

running 2 tests
test tests::larger_can_hold_smaller ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling rectangle v0.1.0 (file:///projects/rectangle)
Finished test [unoptimized + debuginfo] target(s) in 0.66s
Running target/debug/deps/rectangle-6584c4561e48942e
Running unittests (target/debug/deps/rectangle-6584c4561e48942e)

running 2 tests
test tests::larger_can_hold_smaller ... FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.61s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 1 test
test tests::it_adds_two ... FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling greeter v0.1.0 (file:///projects/greeter)
Finished test [unoptimized + debuginfo] target(s) in 0.91s
Running target/debug/deps/greeter-170b942eb5bf5e3a
Running unittests (target/debug/deps/greeter-170b942eb5bf5e3a)

running 1 test
test tests::greeting_contains_name ... FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling greeter v0.1.0 (file:///projects/greeter)
Finished test [unoptimized + debuginfo] target(s) in 0.93s
Running target/debug/deps/greeter-170b942eb5bf5e3a
Running unittests (target/debug/deps/greeter-170b942eb5bf5e3a)

running 1 test
test tests::greeting_contains_name ... FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished test [unoptimized + debuginfo] target(s) in 0.62s
Running target/debug/deps/guessing_game-57d70c3acb738f4d
Running unittests (target/debug/deps/guessing_game-57d70c3acb738f4d)

running 1 test
test tests::greater_than_100 ... FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished test [unoptimized + debuginfo] target(s) in 0.66s
Running target/debug/deps/guessing_game-57d70c3acb738f4d
Running unittests (target/debug/deps/guessing_game-57d70c3acb738f4d)

running 1 test
test tests::greater_than_100 ... FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.60s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 2 tests
test expensive_test ... ignored
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.89s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 1 test
test tests::internal ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Running target/debug/deps/common-92948b65e88960b4
Running tests/common.rs (target/debug/deps/common-92948b65e88960b4)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Running target/debug/deps/integration_test-92948b65e88960b4
Running tests/integration_test.rs (target/debug/deps/integration_test-92948b65e88960b4)

running 1 test
test it_adds_two ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test -- --show-output
Compiling silly-function v0.1.0 (file:///projects/silly-function)
Finished test [unoptimized + debuginfo] target(s) in 0.60s
Running target/debug/deps/silly_function-160869f38cff9166
Running unittests (target/debug/deps/silly_function-160869f38cff9166)

running 2 tests
test tests::this_test_will_fail ... FAILED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test one_hundred
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.69s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 1 test
test tests::one_hundred ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test add
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.61s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 2 tests
test tests::add_three_and_two ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test -- --ignored
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.61s
Running target/debug/deps/adder-92948b65e88960b4
Running unittests (target/debug/deps/adder-92948b65e88960b4)

running 1 test
test expensive_test ... ok
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test --test integration_test
Compiling adder v0.1.0 (file:///projects/adder)
Finished test [unoptimized + debuginfo] target(s) in 0.64s
Running target/debug/deps/integration_test-82e7799c1bc62298
Running tests/integration_test.rs (target/debug/deps/integration_test-82e7799c1bc62298)

running 1 test
test it_adds_two ... ok
Expand Down
2 changes: 1 addition & 1 deletion listings/ch12-an-io-project/listing-12-12/output.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ cargo run the poem.txt
Compiling minigrep v0.1.0 (file:///projects/minigrep)
warning: unused `std::result::Result` that must be used
warning: unused `Result` that must be used
--> src/main.rs:19:5
|
19 | run(config);
Expand Down
8 changes: 4 additions & 4 deletions listings/ch15-smart-pointers/listing-15-15/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ error[E0040]: explicit use of destructor method
--> src/main.rs:16:7
|
16 | c.drop();
| ^^^^
| |
| explicit destructor calls not allowed
| help: consider using `drop` function: `drop(c)`
| --^^^^--
| | |
| | explicit destructor calls not allowed
| help: consider using `drop` function: `drop(c)`

error: aborting due to previous error

Expand Down
4 changes: 3 additions & 1 deletion listings/ch18-patterns-and-matching/listing-18-10/output.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ cargo run
Compiling patterns v0.1.0 (file:///projects/patterns)
warning: irrefutable if-let pattern
warning: irrefutable `if let` pattern
--> src/main.rs:2:5
|
2 | / if let x = 5 {
Expand All @@ -9,6 +9,8 @@ warning: irrefutable if-let pattern
| |_____^
|
= note: `#[warn(irrefutable_let_patterns)]` on by default
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`

warning: 1 warning emitted

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.50
1.52
2 changes: 1 addition & 1 deletion src/title-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.50 or later with
This version of the text assumes you’re using Rust 1.52 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
Expand Down
6 changes: 3 additions & 3 deletions tools/update-rustc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ find -s listings -name output.txt -print0 | while IFS= read -r -d '' f; do

# Save the hash from the first test binary; we're going to keep it to
# minimize diff churn
test_binary_hash=$(sed -E -ne 's@.*Running target/debug/deps/[^-]*-([^\s]*)@\1@p' ${full_output_path} | head -n 1)
test_binary_hash=$(sed -E -ne 's@.*Running [^[:space:]]+ \(target/debug/deps/[^-]*-([^\s]*)\)@\1@p' ${full_output_path} | head -n 1)

# Act like this is the first time this listing has been built
cargo clean
Expand All @@ -70,9 +70,9 @@ find -s listings -name output.txt -print0 | while IFS= read -r -d '' f; do

# Restore the previous test binary hash, if there is one
if [ -n "${test_binary_hash}" ]; then
replacement='s@Running target/debug/deps/([^-]*)-([^\s]*)@Running target/debug/deps/\1-'
replacement='s@Running ([^[:space:]]+) \(target/debug/deps/([^-]*)-([^\s]*)\)@Running \1 (target/debug/deps/\2-'
replacement+="${test_binary_hash}"
replacement+='@g'
replacement+=')@g'
sed -i '' -E -e "${replacement}" ${full_output_path}
fi

Expand Down