File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ use thiserror:: Error ;
2
+
3
+ #[ derive( Error , Debug ) ]
4
+ pub enum MyError {
5
+ First ,
6
+ Second ,
7
+ }
8
+
9
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0277]: `MyError` doesn't implement `std::fmt::Display`
2
+ --> tests/ui/missing-display.rs:4:10
3
+ |
4
+ 4 | pub enum MyError {
5
+ | ^^^^^^^ `MyError` cannot be formatted with the default formatter
6
+ |
7
+ = help: the trait `std::fmt::Display` is not implemented for `MyError`
8
+ = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
9
+ note: required by a bound in `std::error::Error`
10
+ --> $RUST/core/src/error.rs
11
+ |
12
+ | pub trait Error: Debug + Display {
13
+ | ^^^^^^^ required by this bound in `Error`
You can’t perform that action at this time.
0 commit comments