Files
rust/tests/ui/conditional-compilation/test-cfg.rs

11 lines
299 B
Rust
Raw Normal View History

//@ compile-flags: --cfg foo --check-cfg=cfg(foo,bar)
2013-03-19 13:00:10 -07:00
#[cfg(all(foo, bar))] // foo AND bar
//~^ NOTE the item is gated here
fn foo() {} //~ NOTE found an item that was configured out
2013-03-19 13:00:10 -07:00
fn main() {
foo(); //~ ERROR cannot find function `foo` in this scope
//~^ NOTE not found in this scope
2013-03-19 13:00:10 -07:00
}