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 pass to warn about catchall cases #3482

Closed
catamorphism opened this Issue Sep 13, 2012 · 6 comments

Comments

Projects
None yet
5 participants
@catamorphism
Contributor

catamorphism commented Sep 13, 2012

#3481 arose because kind::check_expr had an _ case in its match, so when expr_struct got added as a case, the _ case covered it, which is not what was intended. A lint pass to warn about _ cases would be good. It could be less annoying if it only complained about a _ where the scrutinee has an enum type and the _ might match two or more different variants.

Since whether to use _s is a matter of taste, this should be off by default.

@catamorphism

This comment has been minimized.

Show comment
Hide comment
@catamorphism

catamorphism May 23, 2013

Contributor

far-future

Contributor

catamorphism commented May 23, 2013

far-future

@cmr

This comment has been minimized.

Show comment
Hide comment
@cmr

cmr Jul 24, 2013

Member

It'd be useful if the lint listed which cases weren't covered.

Member

cmr commented Jul 24, 2013

It'd be useful if the lint listed which cases weren't covered.

@flaper87

This comment has been minimized.

Show comment
Hide comment
@flaper87

flaper87 Feb 16, 2014

Contributor

Triage bump. I just created an issue about this and turned out being a dup. This still needs to be done.

Contributor

flaper87 commented Feb 16, 2014

Triage bump. I just created an issue about this and turned out being a dup. This still needs to be done.

@kballard

This comment has been minimized.

Show comment
Hide comment
@kballard

kballard Feb 16, 2014

Contributor

One alternative to warning on all catchalls is to have an attribute that marks an enum such that you aren't allowed to use a catchall with that particular enum.

Contributor

kballard commented Feb 16, 2014

One alternative to warning on all catchalls is to have an attribute that marks an enum such that you aren't allowed to use a catchall with that particular enum.

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Apr 28, 2015

Member

Triage: no change

Member

steveklabnik commented Apr 28, 2015

Triage: no change

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik Feb 11, 2016

Member

Since new lints have a big impact on users of rustc, the policy is that they should go through the RFC process like other user-facing changes. As such, I'm going to give this one a close, but if anyone comes across this ticket and wants this lint, consider adding it to clippy and/or writing up an RFC. Thanks!

Member

steveklabnik commented Feb 11, 2016

Since new lints have a big impact on users of rustc, the policy is that they should go through the RFC process like other user-facing changes. As such, I'm going to give this one a close, but if anyone comes across this ticket and wants this lint, consider adding it to clippy and/or writing up an RFC. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment