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"
.
Metadata
Metadata
Assignees
Labels
No labels