From 0733990409ad5d5c53a4a4be0ac81091f6cccc8e Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Thu, 22 May 2025 20:48:54 +0200 Subject: [PATCH] Fix code sample output in unchecked-uninit.md `dbg!()` prints to stderr, which I assume is the reason there is no visible output when running the example in the book. By using `println!()` instead, the output becomes visible. --- src/unchecked-uninit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unchecked-uninit.md b/src/unchecked-uninit.md index 56659960..7d0fbe92 100644 --- a/src/unchecked-uninit.md +++ b/src/unchecked-uninit.md @@ -43,7 +43,7 @@ let x = { unsafe { mem::transmute::<_, [Box; SIZE]>(x) } }; -dbg!(x); +println!("{x:?}"); ``` This code proceeds in three steps: