Skip to content

Commit dac5234

Browse files
committed
Rust 1.85/2024 Edition: manual regeneration changes
1 parent 080147a commit dac5234

15 files changed

+91
-85
lines changed

Cargo.lock

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["packages/tools"]
2+
members = [ "listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new", "listings/ch11-writing-automated-tests/listing-11-01","packages/tools"]
33
default-members = ["packages/tools"]
44
resolver = "2"
55
exclude = [

ci/dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ durations
151151
ebook
152152
ebooks
153153
Edsger
154+
efdcd
154155
egular
155156
ElementRef
156157
else's

listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ edition = "2024"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
rand = "0.8.5"
9+
rand = "0.8.4"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$ cargo run
22
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
3-
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.20s
4-
Running `target/debug/guessing_game`
3+
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s
4+
Running `file:///projects/guessing_game/target/debug/guessing_game`
55
Hello, world!

listings/ch11-writing-automated-tests/listing-11-01/output.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$ cargo test
22
Compiling adder v0.1.0 (file:///projects/adder)
33
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.57s
4-
Running unittests src/lib.rs (target/debug/deps/adder-f533075b22f9175f)
4+
Running unittests src/lib.rs (file:///projects/adder/target/debug/deps/adder-40313d497ef8f64e)
55

66
running 1 test
77
test tests::it_works ... ok

src/ch02-00-guessing-game-tutorial.md

+24-25
Original file line numberDiff line numberDiff line change
@@ -380,29 +380,25 @@ cargo build -->
380380

381381
```console
382382
$ cargo build
383-
Updating crates.io index
384-
Locking 16 packages to latest compatible versions
385-
Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.3+wasi-0.2.2)
386-
Adding zerocopy v0.7.35 (latest: v0.8.9)
387-
Adding zerocopy-derive v0.7.35 (latest: v0.8.9)
388-
Downloaded syn v2.0.87
389-
Downloaded 1 crate (278.1 KB) in 0.16s
390-
Compiling proc-macro2 v1.0.89
391-
Compiling unicode-ident v1.0.13
392-
Compiling libc v0.2.161
393-
Compiling cfg-if v1.0.0
394-
Compiling byteorder v1.5.0
395-
Compiling getrandom v0.2.15
396-
Compiling rand_core v0.6.4
397-
Compiling quote v1.0.37
398-
Compiling syn v2.0.87
399-
Compiling zerocopy-derive v0.7.35
400-
Compiling zerocopy v0.7.35
401-
Compiling ppv-lite86 v0.2.20
402-
Compiling rand_chacha v0.3.1
403-
Compiling rand v0.8.5
404-
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
405-
Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.69s
383+
Updating crates.io index
384+
Locking 15 packages to latest Rust 1.85.0 compatible versions
385+
Adding rand v0.8.5 (available: v0.9.0)
386+
Compiling proc-macro2 v1.0.93
387+
Compiling unicode-ident v1.0.17
388+
Compiling libc v0.2.170
389+
Compiling cfg-if v1.0.0
390+
Compiling byteorder v1.5.0
391+
Compiling getrandom v0.2.15
392+
Compiling rand_core v0.6.4
393+
Compiling quote v1.0.38
394+
Compiling syn v2.0.98
395+
Compiling zerocopy-derive v0.7.35
396+
Compiling zerocopy v0.7.35
397+
Compiling ppv-lite86 v0.2.20
398+
Compiling rand_chacha v0.3.1
399+
Compiling rand v0.8.5
400+
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
401+
Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.48s
406402
```
407403

408404
</Listing>
@@ -487,7 +483,8 @@ as a guide to creating the hypothetical output shown here -->
487483
```console
488484
$ cargo update
489485
Updating crates.io index
490-
Updating rand v0.8.5 -> v0.8.6
486+
Locking 1 package to latest Rust 1.85.0 compatible version
487+
Updating rand v0.8.5 -> v0.8.6 (available: v0.9.0)
491488
```
492489

493490
Cargo ignores the 0.9.0 release. At this point, you would also notice a change
@@ -804,7 +801,9 @@ You guessed: 59
804801
You win!
805802
Please input your guess.
806803
quit
807-
thread 'main' panicked at 'Please type a number!: ParseIntError { kind: InvalidDigit }', src/main.rs:28:47
804+
805+
thread 'main' panicked at src/main.rs:28:47:
806+
Please type a number!: ParseIntError { kind: InvalidDigit }
808807
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
809808
```
810809

src/ch09-01-unrecoverable-errors-with-panic.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,21 @@ thread 'main' panicked at src/main.rs:4:6:
127127
index out of bounds: the len is 3 but the index is 99
128128
stack backtrace:
129129
0: rust_begin_unwind
130-
at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:662:5
130+
at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:692:5
131131
1: core::panicking::panic_fmt
132-
at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:74:14
132+
at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:75:14
133133
2: core::panicking::panic_bounds_check
134-
at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:276:5
134+
at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:273:5
135135
3: <usize as core::slice::index::SliceIndex<[T]>>::index
136-
at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/slice/index.rs:302:10
136+
at file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/core/src/slice/index.rs:274:10
137137
4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
138-
at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/slice/index.rs:16:9
138+
at file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/core/src/slice/index.rs:16:9
139139
5: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
140-
at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/alloc/src/vec/mod.rs:2920:9
140+
at file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:3361:9
141141
6: panic::main
142142
at ./src/main.rs:4:6
143143
7: core::ops::function::FnOnce::call_once
144-
at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:250:5
144+
at file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
145145
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
146146
```
147147

src/ch14-02-publishing-to-crates-io.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ Even if you’ve chosen a unique name, when you run `cargo publish` to publish
306306
the crate at this point, you’ll get a warning and then an error:
307307

308308
<!-- manual-regeneration
309-
cd listings/ch14-more-about-cargo/listing-14-01/
309+
Create a new package with an unregistered name, making no further modifications
310+
to the generated package, so it is missing the description and license fields.
310311
cargo publish
311312
copy just the relevant lines below
312313
-->
@@ -320,7 +321,7 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
320321
error: failed to publish to registry at https://crates.io
321322

322323
Caused by:
323-
the remote server responded with an error (status 400 Bad Request): missing or empty metadata fields: description, license. Please see https://doc.rust-lang.org/cargo/reference/manifest.html for more information on configuring these field
324+
the remote server responded with an error (status 400 Bad Request): missing or empty metadata fields: description, license. Please see https://doc.rust-lang.org/cargo/reference/manifest.html for more information on configuring these fields
324325
```
325326

326327
This errors because you’re missing some crucial information: a description and

src/ch14-03-cargo-workspaces.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ _add_ directory:
4141

4242
<!-- manual-regeneration
4343
cd listings/ch14-more-about-cargo/output-only-01-adder-crate/add
44+
remove `members = ["adder"]` from Cargo.toml
4445
rm -rf adder
4546
cargo new adder
4647
copy output below
@@ -100,6 +101,7 @@ Then generate a new library crate named `add_one`:
100101

101102
<!-- manual-regeneration
102103
cd listings/ch14-more-about-cargo/output-only-02-add-one/add
104+
remove `"add_one"` from `members` list in Cargo.toml
103105
rm -rf add_one
104106
cargo new add_one --lib
105107
copy output below
@@ -313,14 +315,14 @@ $ cargo test
313315
Compiling add_one v0.1.0 (file:///projects/add/add_one)
314316
Compiling adder v0.1.0 (file:///projects/add/adder)
315317
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.20s
316-
Running unittests src/lib.rs (target/debug/deps/add_one-f0253159197f7841)
318+
Running unittests src/lib.rs (target/debug/deps/add_one-93c49ee75dc46543)
317319

318320
running 1 test
319321
test tests::it_works ... ok
320322

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

323-
Running unittests src/main.rs (target/debug/deps/adder-49979ff40686fa8e)
325+
Running unittests src/main.rs (target/debug/deps/adder-3a47283c568d2b6a)
324326

325327
running 0 tests
326328

@@ -351,7 +353,7 @@ copy output below; the output updating script doesn't handle subdirectories in p
351353
```console
352354
$ cargo test -p add_one
353355
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.00s
354-
Running unittests src/lib.rs (target/debug/deps/add_one-b3235fea9a156f74)
356+
Running unittests src/lib.rs (target/debug/deps/add_one-93c49ee75dc46543)
355357

356358
running 1 test
357359
test tests::it_works ... ok

src/ch14-04-installing-binaries.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ cargo install something you don't have, copy relevant output below
3131
```console
3232
$ cargo install ripgrep
3333
Updating crates.io index
34-
Downloaded ripgrep v13.0.0
35-
Downloaded 1 crate (243.3 KB) in 0.88s
36-
Installing ripgrep v13.0.0
34+
Downloaded ripgrep v14.1.1
35+
Downloaded 1 crate (213.6 KB) in 0.40s
36+
Installing ripgrep v14.1.1
3737
--snip--
38-
Compiling ripgrep v13.0.0
39-
Finished `release` profile [optimized + debuginfo] target(s) in 10.64s
38+
Compiling grep v0.3.2
39+
Finished `release` profile [optimized + debuginfo] target(s) in 6.73s
4040
Installing ~/.cargo/bin/rg
41-
Installed package `ripgrep v13.0.0` (executable `rg`)
41+
Installed package `ripgrep v14.1.1` (executable `rg`)
4242
```
4343

4444
The second-to-last line of the output shows the location and the name of the

src/ch17-03-more-futures.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ error[E0308]: mismatched types
5656
| ----- the found `async` block
5757
...
5858
45 | let futures = vec![tx1_fut, rx_fut, tx_fut];
59-
| ^^^^^^ expected `async` block, found a
60-
different `async` block
59+
| ^^^^^^ expected `async` block, found a different `async` block
6160
|
6261
= note: expected `async` block `{async block@src/main.rs:10:23: 10:33}`
6362
found `async` block `{async block@src/main.rs:24:22: 24:27}`
@@ -151,9 +150,9 @@ error[E0308]: mismatched types
151150
= note: no two async blocks, even if identical, have the same type
152151
= help: consider pinning your async block and casting it to a trait object
153152
note: associated function defined here
154-
--> file:///home/.rustup/toolchains/1.82/lib/rustlib/src/rust/library/alloc/src/boxed.rs:255:12
153+
--> file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/alloc/src/boxed.rs:252:12
155154
|
156-
255 | pub fn new(x: T) -> Self {
155+
252 | pub fn new(x: T) -> Self {
157156
| ^^^
158157
159158
error[E0308]: mismatched types
@@ -175,24 +174,24 @@ error[E0308]: mismatched types
175174
= note: no two async blocks, even if identical, have the same type
176175
= help: consider pinning your async block and casting it to a trait object
177176
note: associated function defined here
178-
--> file:///home/.rustup/toolchains/1.82/lib/rustlib/src/rust/library/alloc/src/boxed.rs:255:12
177+
--> file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/alloc/src/boxed.rs:252:12
179178
|
180-
255 | pub fn new(x: T) -> Self {
179+
252 | pub fn new(x: T) -> Self {
181180
| ^^^
182181
183182
error[E0277]: `{async block@src/main.rs:10:23: 10:33}` cannot be unpinned
184183
--> src/main.rs:48:24
185184
|
186185
48 | trpl::join_all(futures).await;
187-
| -------------- ^^^^^^^ the trait `Unpin` is not implemented for `{async block@src/main.rs:10:23: 10:33}`, which is required by `Box<{async block@src/main.rs:10:23: 10:33}>: Future`
186+
| -------------- ^^^^^^^ the trait `Unpin` is not implemented for `{async block@src/main.rs:10:23: 10:33}`
188187
| |
189188
| required by a bound introduced by this call
190189
|
191190
= note: consider using the `pin!` macro
192191
consider using `Box::pin` if you need to access the pinned value outside of the current scope
193192
= note: required for `Box<{async block@src/main.rs:10:23: 10:33}>` to implement `Future`
194193
note: required by a bound in `join_all`
195-
--> file:///home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/future/join_all.rs:105:14
194+
--> file:///home/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/futures-util-0.3.30/src/future/join_all.rs:105:14
196195
|
197196
102 | pub fn join_all<I>(iter: I) -> JoinAll<I::Item>
198197
| -------- required by a bound in this function
@@ -204,13 +203,13 @@ error[E0277]: `{async block@src/main.rs:10:23: 10:33}` cannot be unpinned
204203
--> src/main.rs:48:9
205204
|
206205
48 | trpl::join_all(futures).await;
207-
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `{async block@src/main.rs:10:23: 10:33}`, which is required by `Box<{async block@src/main.rs:10:23: 10:33}>: Future`
206+
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `{async block@src/main.rs:10:23: 10:33}`
208207
|
209208
= note: consider using the `pin!` macro
210209
consider using `Box::pin` if you need to access the pinned value outside of the current scope
211210
= note: required for `Box<{async block@src/main.rs:10:23: 10:33}>` to implement `Future`
212211
note: required by a bound in `futures_util::future::join_all::JoinAll`
213-
--> file:///home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/future/join_all.rs:29:8
212+
--> file:///home/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/futures-util-0.3.30/src/future/join_all.rs:29:8
214213
|
215214
27 | pub struct JoinAll<F>
216215
| ------- required by a bound in this struct
@@ -222,13 +221,13 @@ error[E0277]: `{async block@src/main.rs:10:23: 10:33}` cannot be unpinned
222221
--> src/main.rs:48:33
223222
|
224223
48 | trpl::join_all(futures).await;
225-
| ^^^^^ the trait `Unpin` is not implemented for `{async block@src/main.rs:10:23: 10:33}`, which is required by `Box<{async block@src/main.rs:10:23: 10:33}>: Future`
224+
| ^^^^^ the trait `Unpin` is not implemented for `{async block@src/main.rs:10:23: 10:33}`
226225
|
227226
= note: consider using the `pin!` macro
228227
consider using `Box::pin` if you need to access the pinned value outside of the current scope
229228
= note: required for `Box<{async block@src/main.rs:10:23: 10:33}>` to implement `Future`
230229
note: required by a bound in `futures_util::future::join_all::JoinAll`
231-
--> file:///home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/future/join_all.rs:29:8
230+
--> file:///home/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/futures-util-0.3.30/src/future/join_all.rs:29:8
232231
|
233232
27 | pub struct JoinAll<F>
234233
| ------- required by a bound in this struct

0 commit comments

Comments
 (0)