mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-02 15:28:40 +08:00
21 lines
782 B
Plaintext
21 lines
782 B
Plaintext
$ cargo run
|
|
Compiling traits-example v0.1.0 (file:///projects/traits-example)
|
|
error[E0277]: `Point` doesn't implement `std::fmt::Display`
|
|
--> src/main.rs:20:6
|
|
|
|
|
3 | trait OutlinePrint: fmt::Display {
|
|
| ------------ required by this bound in `OutlinePrint`
|
|
...
|
|
20 | impl OutlinePrint for Point {}
|
|
| ^^^^^^^^^^^^ `Point` cannot be formatted with the default formatter
|
|
|
|
|
= help: the trait `std::fmt::Display` is not implemented for `Point`
|
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|
|
error: could not compile `traits-example`
|
|
|
|
To learn more, run the command again with --verbose.
|