Skip to content

Commit

Permalink
Add ui test for Error without Display impl
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 11, 2020
1 parent 6fd4059 commit 5075ceb
Show file tree
Hide file tree
Showing 2 changed files with 18 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 Error {
First,
Second,
}

fn main() {}
9 changes: 9 additions & 0 deletions tests/ui/missing-display.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0277]: `Error` doesn't implement `std::fmt::Display`
--> $DIR/missing-display.rs:3:10
|
3 | #[derive(Error, Debug)]
| ^^^^^ `Error` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `Error`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

0 comments on commit 5075ceb

Please sign in to comment.