rust/tests/ui/check-cfg/unexpected-cfg-value.rs
Urgau 517374150c compiletest: add no-auto-check-cfg directive
this directive prevents compiletest from adding any implicit and
automatic --check-cfg arguments
2024-05-04 11:30:38 +02:00

20 lines
436 B
Rust

// Check for unexpected configuration value in the code.
//
//@ check-pass
//@ no-auto-check-cfg
//@ compile-flags: --cfg=feature="rand"
//@ compile-flags: --check-cfg=cfg(feature,values("serde","full"))
#[cfg(feature = "sedre")]
//~^ WARNING unexpected `cfg` condition value
pub fn f() {}
#[cfg(feature = "serde")]
pub fn g() {}
#[cfg(feature = "rand")]
//~^ WARNING unexpected `cfg` condition value
pub fn h() {}
pub fn main() {}