Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve span of missing Display impl error #76

Merged
merged 1 commit into from
Apr 11, 2020
Merged

Improve span of missing Display impl error #76

merged 1 commit into from
Apr 11, 2020

Conversation

dtolnay
Copy link
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
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