-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
#[cfg(unknown_option = "...") should produce a warning #39370
Copy link
Copy link
Closed
Description
The rust reference https://doc.rust-lang.org/reference.html#conditional-compilation states:
contains a string that can be checked against (#[cfg(bar = "baz")]). Currently, only compiler-defined configuration options can have the latter form.
Given that there's a fixed list of options, could rustc warn on invalid options? The following code compiles with no warnings:
#[cfg(i_dont_exist = "foo")]
extern crate bar;
fn main() {
}This caught me out today when I wrote target = "macos" rather than target_os = "macos".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.