1
Fork 0

Test that stmt_expr_attrs properly gates if-attrs

This commit is contained in:
Aaron Hill 2020-02-19 10:45:21 -05:00
parent e912d9d7ec
commit e9ec47bb70
No known key found for this signature in database
GPG key ID: B4087E510E98B164
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,6 @@
fn main() {
let _ = #[deny(warnings)] if true { //~ ERROR attributes on expressions
} else if false {
} else {
};
}

View file

@ -0,0 +1,12 @@
error[E0658]: attributes on expressions are experimental
--> $DIR/stmt-expr-gated.rs:2:13
|
LL | let _ = #[deny(warnings)] if true {
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.