-
Notifications
You must be signed in to change notification settings - Fork 13k
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
#[cfg(unknown_option = "...") should produce a warning #39370
Comments
Hmm, that line in the reference is a total lie.
|
Ah, sounds like I'm doomed and there's no way to warn on invalid option names. I will close this issue if there's nothing we can do to improve this. |
There is something we can do. We can update the documentation so it no longer states "Currently, only compiler-defined configuration options can have the latter form." |
The reference should be fixed or we should add a warning, one or the other. |
reference: clarify #[cfg] section Closes rust-lang#39370, but maybe we (or clippy) should add a warning too.
reference: clarify #[cfg] section Closes rust-lang#39370, but maybe we (or clippy) should add a warning too.
The rust reference https://doc.rust-lang.org/reference.html#conditional-compilation states:
Given that there's a fixed list of options, could rustc warn on invalid options? The following code compiles with no warnings:
This caught me out today when I wrote
target = "macos"
rather thantarget_os = "macos"
.The text was updated successfully, but these errors were encountered: