Test that stmt_expr_attrs properly gates if-attrs
This commit is contained in:
parent
e912d9d7ec
commit
e9ec47bb70
2 changed files with 18 additions and 0 deletions
6
src/test/ui/parser/if-attrs/stmt-expr-gated.rs
Normal file
6
src/test/ui/parser/if-attrs/stmt-expr-gated.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
fn main() {
|
||||
let _ = #[deny(warnings)] if true { //~ ERROR attributes on expressions
|
||||
} else if false {
|
||||
} else {
|
||||
};
|
||||
}
|
12
src/test/ui/parser/if-attrs/stmt-expr-gated.stderr
Normal file
12
src/test/ui/parser/if-attrs/stmt-expr-gated.stderr
Normal 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`.
|
Loading…
Add table
Add a link
Reference in a new issue