Skip to content

Improve span of missing Display impl error#76

Merged
dtolnay merged 1 commit intomasterfrom
span
Apr 11, 2020
Merged

Improve span of missing Display impl error#76
dtolnay merged 1 commit intomasterfrom
span

Conversation

@dtolnay
Copy link
Copy Markdown
Owner

@dtolnay dtolnay commented Apr 11, 2020

Before:

error[E0277]: `MyError` doesn't implement `std::fmt::Display`
 --> $DIR/missing-display.rs:3:10
  |
3 | #[derive(Error, Debug)]
  |          ^^^^^ `MyError` cannot be formatted with the default formatter
  |
  = help: the trait `std::fmt::Display` is not implemented for `MyError`

After:

error[E0277]: `MyError` doesn't implement `std::fmt::Display`
 --> $DIR/missing-display.rs:4:1
  |
4 | pub enum MyError {
  | ^^^^^^^^^^^^^^^^ `MyError` cannot be formatted with the default formatter
  |
  = help: the trait `std::fmt::Display` is not implemented for `MyError`

Closes #75.

@dtolnay dtolnay merged commit 382445c into master Apr 11, 2020
@dtolnay dtolnay deleted the span branch April 11, 2020 18:36
takumi-earth pushed a commit to earthlings-dev/thiserror that referenced this pull request Jan 27, 2026
Improve span of missing Display impl error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhelpful error message if the error attribute and fmt::Display impl are missing

1 participant