From 9cb1d20394f047855a57228dc4cbbabd0a9b395a Mon Sep 17 00:00:00 2001 From: Vasily Galkin Date: Sun, 14 Jul 2019 16:29:52 +0300 Subject: [PATCH] Printing non-Display structs is a *compile* error `Rectangle` doesn't implement `std::fmt::Display` is a compile error, not a run-time error. --- src/ch05-02-example-structs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch05-02-example-structs.md b/src/ch05-02-example-structs.md index 4aeb816fe6..46f88f1b8a 100644 --- a/src/ch05-02-example-structs.md +++ b/src/ch05-02-example-structs.md @@ -165,7 +165,7 @@ fn main() { Listing 5-11: Attempting to print a `Rectangle` instance -When we run this code, we get an error with this core message: +When we compile this code, we get an error with this core message: ```text error[E0277]: `Rectangle` doesn't implement `std::fmt::Display` @@ -195,7 +195,7 @@ Let’s try it! The `println!` macro call will now look like `println!("rect1 is enables us to print our struct in a way that is useful for developers so we can see its value while we’re debugging our code. -Run the code with this change. Drat! We still get an error: +Compile the code with this change. Drat! We still get an error: ```text error[E0277]: `Rectangle` doesn't implement `std::fmt::Debug`