]> git.lizzy.rs Git - rust.git/blob - tests/ui/conditional-compilation/cfg-non-opt-expr.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / conditional-compilation / cfg-non-opt-expr.rs
1 #![feature(stmt_expr_attributes)]
2 #![feature(custom_test_frameworks)]
3
4 fn main() {
5     let _ = #[cfg(unset)] ();
6     //~^ ERROR removing an expression is not supported in this position
7     let _ = 1 + 2 + #[cfg(unset)] 3;
8     //~^ ERROR removing an expression is not supported in this position
9     let _ = [1, 2, 3][#[cfg(unset)] 1];
10     //~^ ERROR removing an expression is not supported in this position
11 }