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

24 lines
701 B
Rust

//@ check-pass
//
//@ no-auto-check-cfg
//@ revisions: explicit implicit
//@ [explicit]compile-flags: --check-cfg=cfg(foo,values(none()))
//@ [implicit]compile-flags: --check-cfg=cfg(foo)
//@ [simple] compile-flags: --check-cfg=cfg(foo,values(none(),"too"))
//@ [concat_1]compile-flags: --check-cfg=cfg(foo) --check-cfg=cfg(foo,values("too"))
//@ [concat_2]compile-flags: --check-cfg=cfg(foo,values("too")) --check-cfg=cfg(foo)
#[cfg(foo = "too")]
//[explicit]~^ WARNING unexpected `cfg` condition value
//[implicit]~^^ WARNING unexpected `cfg` condition value
fn foo_too() {}
#[cfg(foo = "bar")]
//~^ WARNING unexpected `cfg` condition value
fn foo_bar() {}
#[cfg(foo)]
fn foo() {}
fn main() {}