Test trying to cfg-remove an if expression
This commit is contained in:
parent
e9ec47bb70
commit
9a299e4e21
2 changed files with 13 additions and 0 deletions
5
src/test/ui/parser/if-attrs/bad-cfg.rs
Normal file
5
src/test/ui/parser/if-attrs/bad-cfg.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#![feature(stmt_expr_attributes)]
|
||||
|
||||
fn main() {
|
||||
let _ = #[cfg(FALSE)] if true {}; //~ ERROR removing an expression
|
||||
}
|
||||
8
src/test/ui/parser/if-attrs/bad-cfg.stderr
Normal file
8
src/test/ui/parser/if-attrs/bad-cfg.stderr
Normal file
|
|
@ -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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue