Skip to content

Commit

Permalink
Merge pull request #263 from dtolnay/missingdisplay
Browse files Browse the repository at this point in the history
Restore UI test involving missing Display impl
  • Loading branch information
dtolnay authored Dec 15, 2023
2 parents e9ea67c + abb651d commit ae3d41d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/ui/missing-display.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use thiserror::Error;

#[derive(Error, Debug)]
pub enum MyError {
First,
Second,
}

fn main() {}
13 changes: 13 additions & 0 deletions tests/ui/missing-display.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error[E0277]: `MyError` doesn't implement `std::fmt::Display`
--> tests/ui/missing-display.rs:4:10
|
4 | pub enum MyError {
| ^^^^^^^ `MyError` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `MyError`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `std::error::Error`
--> $RUST/core/src/error.rs
|
| pub trait Error: Debug + Display {
| ^^^^^^^ required by this bound in `Error`

0 comments on commit ae3d41d

Please sign in to comment.