Skip to content

Commit

Permalink
Test trying to cfg-remove an if expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Mar 4, 2020
1 parent e9ec47b commit 9a299e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/ui/parser/if-attrs/bad-cfg.rs
@@ -0,0 +1,5 @@
#![feature(stmt_expr_attributes)]

fn main() {
let _ = #[cfg(FALSE)] if true {}; //~ ERROR removing an expression
}
8 changes: 8 additions & 0 deletions src/test/ui/parser/if-attrs/bad-cfg.stderr
@@ -0,0 +1,8 @@
error: removing an expression is not supported in this position
--> $DIR/bad-cfg.rs:4:13
|
LL | let _ = #[cfg(FALSE)] if true {};
| ^^^^^^^^^^^^^

error: aborting due to previous error

0 comments on commit 9a299e4

Please sign in to comment.