rust/tests/ui/conditional-compilation/cfg-non-opt-expr.rs
2025-04-03 21:41:58 +00:00

11 lines
408 B
Rust

#![feature(stmt_expr_attributes)]
#![feature(custom_test_frameworks)]
fn main() {
let _ = #[cfg(false)] ();
//~^ ERROR removing an expression is not supported in this position
let _ = 1 + 2 + #[cfg(false)] 3;
//~^ ERROR removing an expression is not supported in this position
let _ = [1, 2, 3][#[cfg(false)] 1];
//~^ ERROR removing an expression is not supported in this position
}