rust/tests/ui/conditional-compilation/cfg-non-opt-expr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
408 B
Rust
Raw Normal View History

2016-01-21 12:16:59 +13:00
#![feature(stmt_expr_attributes)]
2018-07-20 18:04:02 -07:00
#![feature(custom_test_frameworks)]
2016-01-21 12:16:59 +13:00
fn main() {
2025-03-29 17:24:03 +00:00
let _ = #[cfg(false)] ();
//~^ ERROR removing an expression is not supported in this position
2025-03-29 17:24:03 +00:00
let _ = 1 + 2 + #[cfg(false)] 3;
//~^ ERROR removing an expression is not supported in this position
2025-03-29 17:24:03 +00:00
let _ = [1, 2, 3][#[cfg(false)] 1];
//~^ ERROR removing an expression is not supported in this position
}