mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
896 B
20 lines
896 B
$ 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)]` to `Rectangle` or manually `impl Debug for Rectangle`
|
|
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
help: consider annotating `Rectangle` with `#[derive(Debug)]`
|
|
|
|
|
1 + #[derive(Debug)]
|
|
2 | struct Rectangle {
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|
|
error: could not compile `rectangles` (bin "rectangles") due to 1 previous error
|