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-20 23:16:59 +00:00
#![feature(stmt_expr_attributes)]
2018-07-21 01:04:02 +00:00
#![feature(custom_test_frameworks)]
2016-01-20 23:16:59 +00:00
fn main() {
let _ = #[cfg(unset)] ();
//~^ ERROR removing an expression is not supported in this position
let _ = 1 + 2 + #[cfg(unset)] 3;
//~^ ERROR removing an expression is not supported in this position
let _ = [1, 2, 3][#[cfg(unset)] 1];
//~^ ERROR removing an expression is not supported in this position
}