Files
rust/tests/ui/macros/cfg_select_parse_error.rs
T
Folkert de Vries 14d29f9ae2 Stabilize cfg_select
2026-02-22 19:59:25 +01:00

18 lines
387 B
Rust

#![crate_type = "lib"]
// Check that parse errors in arms that are not selected are still reported.
fn print() {
println!(cfg_select! {
false => { 1 ++ 2 }
//~^ ERROR Rust has no postfix increment operator
_ => { "not unix" }
});
}
cfg_select! {
false => { fn foo() { 1 +++ 2 } }
//~^ ERROR Rust has no postfix increment operator
_ => {}
}