Don't suggest doc(hidden) or unstable variants in wildcard lint by m-ou-se · Pul...
source link: https://github.com/rust-lang/rust-clippy/pull/7407
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Clippy's wildcard lint would suggest doc(hidden) and unstable variants for non_exhaustive enums, even though those aren't part of the public interface (yet) and should only be matched on using a _
, just like potential future additions to the enum. There was already some logic to exclude a single doc(hidden) variant. This extends that to all hidden variants, and also hides #[unstable]
variants.
See rust-lang/rust#85746 (comment)
This PR includes #7406 as the first commit.
Here's the diff that this PR adds on top of that PR: m-ou-se/[email protected]:doc-hidden-variants
Please write a short comment explaining your change (or "none" for internal only changes)
changelog: No longer suggest unstable and doc(hidden) variants in wildcard lint. wildcard_enum_match_arm, match_wildcard_for_single_variants
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK