3

Don't suggest doc(hidden) or unstable variants in wildcard lint by m-ou-se · Pul...

 3 years ago
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.
neoserver,ios ssh client

Copy link

Member

m-ou-se commented 14 days ago

edited by flip1995

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK