Skip to content

Commit

Permalink
Test that stmt_expr_attrs properly gates if-attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Mar 4, 2020
1 parent e912d9d commit e9ec47b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/ui/parser/if-attrs/stmt-expr-gated.rs
@@ -0,0 +1,6 @@
fn main() {
let _ = #[deny(warnings)] if true { //~ ERROR attributes on expressions
} else if false {
} else {
};
}
12 changes: 12 additions & 0 deletions src/test/ui/parser/if-attrs/stmt-expr-gated.stderr
@@ -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`.

0 comments on commit e9ec47b

Please sign in to comment.