Skip to content

wildcard_in_or_patterns doesn't ignore #[nonexhaustive] #13350

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

Closed
andrewbanchich opened this issue Sep 5, 2024 · 1 comment · Fixed by #13456
Closed

wildcard_in_or_patterns doesn't ignore #[nonexhaustive] #13350

andrewbanchich opened this issue Sep 5, 2024 · 1 comment · Fixed by #13456
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@andrewbanchich
Copy link
Contributor

andrewbanchich commented Sep 5, 2024

Summary

Some types are annotated with #[nonexhaustive], forcing a wildcard pattern. This lint conflicts with that, which then forces us to use an #[allow(clippy::wildcard_in_or_patterns)].

It would be great if this lint took nonexhaustive into account so that it doesn't trigger for wildcard patterns as long as all other patterns were exhaustively matched upon.

Reproducer

No response

Version

release: 1.80.1

Additional Labels

No response

@andrewbanchich andrewbanchich added the C-bug Category: Clippy is not doing the correct thing label Sep 5, 2024
@y21 y21 added the I-false-positive Issue: The lint was triggered on code it shouldn't have label Sep 6, 2024
@vHugoObject
Copy link
Contributor

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
3 participants