rust/tests/ui/check-cfg/cfg-crate-features.rs
Jonathan Brouwer bfa45ac78b
Add regression test
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-15 23:28:15 +02:00

14 lines
524 B
Rust

// https://github.com/rust-lang/rust/issues/143977
// Check that features are available when an attribute is applied to a crate
#![cfg(version("1.0"))]
//~^ ERROR `cfg(version)` is experimental and subject to change
// Using invalid value `does_not_exist`,
// so we don't accidentally configure out the crate for any certain OS
#![cfg(not(target(os = "does_not_exist")))]
//~^ ERROR compact `cfg(target(..))` is experimental and subject to change
//~| WARN unexpected `cfg` condition value: `does_not_exist`
fn main() {}