rust/tests/ui/check-cfg/unknown-values.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

18 lines
521 B
Rust

// Check that no warning is emitted for unknown cfg value
//
//@ check-pass
//@ no-auto-check-cfg
//@ revisions: simple mixed with_values
//@ compile-flags: --check-cfg=cfg(simple,mixed,with_values)
//@ [simple]compile-flags: --check-cfg=cfg(foo,values(any()))
//@ [mixed]compile-flags: --check-cfg=cfg(foo) --check-cfg=cfg(foo,values(any()))
//@ [with_values]compile-flags:--check-cfg=cfg(foo,values(any())) --check-cfg=cfg(foo,values("aa"))
#[cfg(foo = "value")]
pub fn f() {}
#[cfg(foo)]
pub fn f() {}
fn main() {}