-
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
Detect unknown features inside #[cfg(feature = "…")]
blocks
#11649
Comments
Tagging @GuillaumeGomez, as they suggested I do so |
I'll check what can be done about it. https://rust-lang.github.io/rfcs/3013-conditional-compilation-checking.html seems to be covering this case as well. The big blocker here is in case a project is not using Cargo. But I guess the lint can be skipped in this case. |
I'd say this is ok. I don't think you can easily run clippy without cargo anyway, or is even supported. Couple things of note:
|
There is a work in progress for this to be done in rust directly: rust-lang/rust#82450 |
FYI the cargo/rustc feature has been proposed for merge. Cargo has approved its side of it and its waiting on rustc. |
Closing in favour of rust-lang/rust#82450 |
What it does
Look for
#[cfg(feature = "NAME")]
,cfg!(feature = "NAME")
,#[cfg_attr(feature = "NAME", …)]
etc and check thatNAME
is a real feature found inCargo.toml
Advantage
#[cfg(feature = "sedre")]
)Example
Suggested output:
Related
May sounds similar, but are different:
cfg(feature_s_ = ...)
typo #10224The text was updated successfully, but these errors were encountered: