Skip to content

Commit e9ec47b

Browse files
committed
Test that stmt_expr_attrs properly gates if-attrs
1 parent e912d9d commit e9ec47b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
let _ = #[deny(warnings)] if true { //~ ERROR attributes on expressions
3+
} else if false {
4+
} else {
5+
};
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0658]: attributes on expressions are experimental
2+
--> $DIR/stmt-expr-gated.rs:2:13
3+
|
4+
LL | let _ = #[deny(warnings)] if true {
5+
| ^^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
8+
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)