We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e912d9d commit e9ec47bCopy full SHA for e9ec47b
src/test/ui/parser/if-attrs/stmt-expr-gated.rs
@@ -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
+}
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 {
+ | ^^^^^^^^^^^^^^^^^
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