]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-43988.rs
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
[rust.git] / src / test / ui / issues / issue-43988.rs
1 #![feature(stmt_expr_attributes)]
2
3 fn main() {
4
5     #[inline]
6     let _a = 4;
7     //~^^ ERROR attribute should be applied to function or closure
8
9
10     #[inline(XYZ)]
11     let _b = 4;
12     //~^^ ERROR attribute should be applied to function or closure
13
14     #[repr(nothing)]
15     let _x = 0;
16     //~^^ ERROR attribute should be applied to a struct, enum, or union
17
18     #[repr(something_not_real)]
19     loop {
20         ()
21     };
22     //~^^^^ ERROR attribute should be applied to a struct, enum, or union
23
24     #[repr]
25     let _y = "123";
26     //~^^ ERROR malformed `repr` attribute
27
28     fn foo() {}
29
30     #[inline(ABC)]
31     foo();
32     //~^^ ERROR attribute should be applied to function or closure
33
34     let _z = #[repr] 1;
35     //~^ ERROR malformed `repr` attribute
36 }