mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-02 23:38:41 +08:00
20 lines
769 B
Plaintext
20 lines
769 B
Plaintext
|
$ cargo run
|
||
|
Compiling rectangles v0.1.0 (file:///projects/rectangles)
|
||
|
error[E0277]: `Rectangle` doesn't implement `Debug`
|
||
|
--> src/main.rs:12:31
|
||
|
|
|
||
|
12 | println!("rect1 is {:?}", rect1);
|
||
|
| ^^^^^ `Rectangle` cannot be formatted using `{:?}`
|
||
|
|
|
||
|
= help: the trait `Debug` is not implemented for `Rectangle`
|
||
|
= note: add `#[derive(Debug)]` or manually implement `Debug`
|
||
|
= note: required by `std::fmt::Debug::fmt`
|
||
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||
|
|
||
|
error: aborting due to previous error
|
||
|
|
||
|
For more information about this error, try `rustc --explain E0277`.
|
||
|
error: could not compile `rectangles`
|
||
|
|
||
|
To learn more, run the command again with --verbose.
|