mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-24 05:59:39 +00:00
and make internal terminology consistent Co-authored-by: Travis Cross <tc@traviscross.com>
31 lines
561 B
Rust
31 lines
561 B
Rust
#![feature(cfg_select)]
|
|
#![crate_type = "lib"]
|
|
|
|
fn print() {
|
|
println!(cfg_select! {
|
|
unix => { "unix" }
|
|
_ => { "not unix" }
|
|
});
|
|
}
|
|
|
|
fn arm_rhs_must_be_in_braces() -> i32 {
|
|
cfg_select! {
|
|
true => 1
|
|
//~^ ERROR: expected `{`, found `1`
|
|
}
|
|
}
|
|
|
|
cfg_select! {
|
|
_ => {}
|
|
true => {}
|
|
//~^ WARN unreachable predicate
|
|
}
|
|
|
|
cfg_select! {
|
|
//~^ ERROR none of the predicates in this `cfg_select` evaluated to true
|
|
false => {}
|
|
}
|
|
|
|
cfg_select! {}
|
|
//~^ ERROR none of the predicates in this `cfg_select` evaluated to true
|