rust/tests/ui/check-cfg/allow-macro-cfg.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

16 lines
268 B
Rust

// This test check that local #[allow(unexpected_cfgs)] works
//
//@ check-pass
//@ no-auto-check-cfg
//@ compile-flags: --check-cfg=cfg()
#[allow(unexpected_cfgs)]
fn foo() {
if cfg!(FALSE) {}
}
fn main() {
#[allow(unexpected_cfgs)]
if cfg!(FALSE) {}
}