2022-02-06 16:43:51 +08:00
|
|
|
$ cargo run
|
|
|
|
Compiling traits-example v0.1.0 (file:///projects/traits-example)
|
|
|
|
error[E0277]: `Point` doesn't implement `std::fmt::Display`
|
2024-06-06 21:23:21 +08:00
|
|
|
--> src/main.rs:20:23
|
2022-02-06 16:43:51 +08:00
|
|
|
|
|
|
|
|
20 | impl OutlinePrint for Point {}
|
2024-06-06 21:23:21 +08:00
|
|
|
| ^^^^^ `Point` cannot be formatted with the default formatter
|
2022-02-06 16:43:51 +08:00
|
|
|
|
|
|
|
|
= 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
|
|
|
|
note: required by a bound in `OutlinePrint`
|
|
|
|
--> src/main.rs:3:21
|
|
|
|
|
|
|
|
|
3 | trait OutlinePrint: fmt::Display {
|
|
|
|
| ^^^^^^^^^^^^ required by this bound in `OutlinePrint`
|
|
|
|
|
2024-06-06 21:23:21 +08:00
|
|
|
error[E0277]: `Point` doesn't implement `std::fmt::Display`
|
|
|
|
--> src/main.rs:24:7
|
|
|
|
|
|
|
|
|
24 | p.outline_print();
|
|
|
|
| ^^^^^^^^^^^^^ `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
|
|
|
|
note: required by a bound in `OutlinePrint::outline_print`
|
|
|
|
--> src/main.rs:3:21
|
|
|
|
|
|
|
|
|
3 | trait OutlinePrint: fmt::Display {
|
|
|
|
| ^^^^^^^^^^^^ required by this bound in `OutlinePrint::outline_print`
|
|
|
|
4 | fn outline_print(&self) {
|
|
|
|
| ------------- required by a bound in this associated function
|
|
|
|
|
2022-02-06 16:43:51 +08:00
|
|
|
For more information about this error, try `rustc --explain E0277`.
|
2024-06-06 21:23:21 +08:00
|
|
|
error: could not compile `traits-example` (bin "traits-example") due to 2 previous errors
|