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

Turn on non_exhaustive_omitted_patterns in CI #343

Open
Manishearth opened this issue Sep 21, 2023 · 0 comments
Open

Turn on non_exhaustive_omitted_patterns in CI #343

Manishearth opened this issue Sep 21, 2023 · 0 comments
Labels
techdebt Internal issue with minimal external impact

Comments

@Manishearth
Copy link
Contributor

We use non_exhaustive a bunch and #342 made us use it everywhere.

The more we use, the more likely it is that an AST/HIR change may not trigger the needed refactorings on the tool side.

Rustc has a lint, non_exhaustive_omitted_patterns, that is currently unstable (rust-lang/rust#89554). We can still run it in CI by gating it behind --cfg internal_nonexhastive_lint or something. This lint requires all enum variants/fields/etc to be mentioned in a match statement (not if let) even if they're stuck at the bottom with the wildcard.

We can't do this yet since we have a bunch of match statements that already violate this but we should slowly go through and fix the violations by turning them into if lets or adding the variant names to the wildcard arm.

@Manishearth Manishearth added the techdebt Internal issue with minimal external impact label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
techdebt Internal issue with minimal external impact
Projects
None yet
Development

No branches or pull requests

1 participant