Skip to content

Commit ae3d41d

Browse files
authored
Merge pull request #263 from dtolnay/missingdisplay
Restore UI test involving missing Display impl
2 parents e9ea67c + abb651d commit ae3d41d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/ui/missing-display.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use thiserror::Error;
2+
3+
#[derive(Error, Debug)]
4+
pub enum MyError {
5+
First,
6+
Second,
7+
}
8+
9+
fn main() {}

tests/ui/missing-display.stderr

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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`

0 commit comments

Comments
 (0)