1
Fork 0

Add way to express no-values with check-cfg

This commit is contained in:
Urgau 2024-01-13 12:18:51 +01:00
parent 284cb714d2
commit 41b69aae91
10 changed files with 89 additions and 32 deletions

View 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() {}