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

Lint *Error types that don't implement std::error::Error #1291

Open
jonas-schievink opened this issue Oct 23, 2016 · 2 comments · May be fixed by #14291
Open

Lint *Error types that don't implement std::error::Error #1291

jonas-schievink opened this issue Oct 23, 2016 · 2 comments · May be fixed by #14291
Labels
A-lint Area: New lints E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-middle Type: Probably requires verifiying types

Comments

@jonas-schievink
Copy link
Contributor

I think it would be useful to warn when a type named SomeError does not implement the std::error::Error trait. This is a common annoyance I see in many crates, which leads to the defined error type not being very useful since you can't use it like other error types (you also possibly can't print it if it doesn't impl Display, which is a supertrait of Error).

@mcarton mcarton added E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-middle Type: Probably requires verifiying types A-lint Area: New lints labels Oct 23, 2016
@clarfonthey
Copy link

Additionally, we could lint this for types which are used for associated Error and Err types on traits. For example, someone might have an error type called BadValue and use type Err = BadValue on a FromStr impl, and we'd still want to catch that too.

@alice-i-cecile
Copy link

Lending my voice here: I would love to enable this globally for Bevy, after seeing this crop up in bevyengine/bevy#17820

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-middle Type: Probably requires verifiying types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants