Skip to content

Commit 8475a4b

Browse files
committed
Check that custom attributes are disallowed on statements and expressions
1 parent 11b5388 commit 8475a4b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/test/compile-fail/custom_attribute.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(stmt_expr_attributes)]
12+
1113
#[foo] //~ ERROR The attribute `foo`
1214
fn main() {
13-
15+
#[foo] //~ ERROR The attribute `foo`
16+
let x = ();
17+
#[foo] //~ ERROR The attribute `foo`
18+
x
1419
}

0 commit comments

Comments
 (0)