Add way to express no-values with check-cfg
This commit is contained in:
parent
284cb714d2
commit
41b69aae91
10 changed files with 89 additions and 32 deletions
14
tests/ui/check-cfg/empty-values.rs
Normal file
14
tests/ui/check-cfg/empty-values.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// Check that we detect unexpected value when none are allowed
|
||||
//
|
||||
// check-pass
|
||||
// compile-flags: --check-cfg=cfg(foo,values()) -Zunstable-options
|
||||
|
||||
#[cfg(foo = "foo")]
|
||||
//~^ WARNING unexpected `cfg` condition value
|
||||
fn do_foo() {}
|
||||
|
||||
#[cfg(foo)]
|
||||
//~^ WARNING unexpected `cfg` condition value
|
||||
fn do_foo() {}
|
||||
|
||||
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue