From 7e1a4bc5337bc137326444e9c524b1a751073f84 Mon Sep 17 00:00:00 2001 From: Lele <483767+eldios@users.noreply.github.com> Date: Sat, 24 Feb 2024 20:02:32 +0100 Subject: [PATCH 1/2] ch16-05 - Add missing line in code example According to the output of the error shown in the following paragraph the `drop` statement should still be there, while it was removed from the listing src. --- listings/ch16-fearless-concurrency/listing-16-05/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/listings/ch16-fearless-concurrency/listing-16-05/src/main.rs b/listings/ch16-fearless-concurrency/listing-16-05/src/main.rs index a6547dc4c1..70f659c5f6 100644 --- a/listings/ch16-fearless-concurrency/listing-16-05/src/main.rs +++ b/listings/ch16-fearless-concurrency/listing-16-05/src/main.rs @@ -7,5 +7,7 @@ fn main() { println!("Here's a vector: {:?}", v); }); + drop(v); // oh no! + handle.join().unwrap(); } From f669b1fa645e5715414d25680b99ed2dd426a485 Mon Sep 17 00:00:00 2001 From: "Emanuele \"Lele\" Calo" Date: Sat, 24 Feb 2024 21:41:04 +0100 Subject: [PATCH 2/2] ch16-01: add ignore line for broken Rust code Now that the `drop` is back where it should be, tests fail because of the actual issue we're trying to showcase. Adding ignore to the markdown src. --- src/ch16-01-threads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch16-01-threads.md b/src/ch16-01-threads.md index cfdd0c7066..e6bb0a122e 100644 --- a/src/ch16-01-threads.md +++ b/src/ch16-01-threads.md @@ -247,7 +247,7 @@ should borrow the values. The modification to Listing 16-3 shown in Listing Filename: src/main.rs -```rust +```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch16-fearless-concurrency/listing-16-05/src/main.rs}} ```