-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
False positive match_wildcard_for_single_variants on enum with hidden variant #6984
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
dtolnay
added
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
labels
Mar 27, 2021
dtolnay
added a commit
to serde-rs/serde
that referenced
this issue
Mar 27, 2021
rust-lang/rust-clippy#6984 error: wildcard matches only a single variant and will also match any future added variants --> serde_derive/src/internals/attr.rs:1918:9 | 1918 | _ => {} | ^ help: try this: `syn::Type::__TestExhaustive(_)` | note: the lint level is defined here --> serde_derive/src/lib.rs:18:22 | 18 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::match_wildcard_for_single_variants)]` implied by `#[deny(clippy::pedantic)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants error: wildcard matches only a single variant and will also match any future added variants --> serde_derive/src/internals/receiver.rs:153:13 | 153 | _ => {} | ^ help: try this: `Type::__TestExhaustive(_)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants error: wildcard matches only a single variant and will also match any future added variants --> serde_derive/src/bound.rs:190:17 | 190 | _ => {} | ^ help: try this: `syn::Type::__TestExhaustive(_)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
dtolnay
added a commit
to dtolnay/syn
that referenced
this issue
Mar 27, 2021
rust-lang/rust-clippy#6984 error: wildcard matches only a single variant and will also match any future added variants --> src/expr.rs:2337:17 | 2337 | _ => unreachable!(), | ^ help: try this: `Pat::__TestExhaustive(_)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
ghost
mentioned this issue
Mar 27, 2021
bors
added a commit
that referenced
this issue
Apr 2, 2021
Fix hidden variant suggestion on single variant Fixes #6984 changelog: Fix hidden variant suggestion on `match_wildcard_for_single_variants`
bors
added a commit
that referenced
this issue
Apr 2, 2021
Fix hidden variant suggestion on single variant Fixes #6984 changelog: Fix hidden variant suggestion on `match_wildcard_for_single_variants`
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
Beginning with the most recent nightly (clippy 0.1.53 5e65467 2021-03-26, rustc 1.53.0-nightly 5e65467 2021-03-26) the following code incorrectly triggers
match_wildcard_for_single_variants
. I believe clippy should not be recommending that the user write doc(hidden) variants into their code.Mentioning @Jarcho @llogiq who touched this lint recently in #6863.
The text was updated successfully, but these errors were encountered: