]> git.lizzy.rs Git - rust.git/blob - src/test/ui/conflicting-repr-hints.rs
Rollup merge of #68415 - matthiaskrgr:tidy_clippy, r=oli-obk
[rust.git] / src / test / ui / conflicting-repr-hints.rs
1 #![allow(dead_code)]
2
3 #[repr(C)]
4 enum A {
5     A,
6 }
7
8 #[repr(u64)]
9 enum B {
10     B,
11 }
12
13 #[repr(C, u64)] //~ ERROR conflicting representation hints
14 enum C {
15     C,
16 }
17
18 #[repr(u32, u64)] //~ ERROR conflicting representation hints
19 enum D {
20     D,
21 }
22
23 #[repr(C, packed)]
24 struct E(i32);
25
26 #[repr(packed, align(8))]
27 struct F(i32); //~ ERROR type has conflicting packed and align representation hints
28
29 #[repr(packed)]
30 #[repr(align(8))]
31 struct G(i32); //~ ERROR type has conflicting packed and align representation hints
32
33 #[repr(align(8))]
34 #[repr(packed)]
35 struct H(i32); //~ ERROR type has conflicting packed and align representation hints
36
37 #[repr(packed, packed(2))]
38 struct I(i32); //~ ERROR type has conflicting packed representation hints
39
40 #[repr(packed(2))]
41 #[repr(packed)]
42 struct J(i32); //~ ERROR type has conflicting packed representation hints
43
44 #[repr(packed, packed(1))]
45 struct K(i32);
46
47 #[repr(packed, align(8))]
48 union X {
49     //~^ ERROR type has conflicting packed and align representation hints
50     i: i32,
51 }
52
53 #[repr(packed)]
54 #[repr(align(8))]
55 union Y {
56     //~^ ERROR type has conflicting packed and align representation hints
57     i: i32,
58 }
59
60 #[repr(align(8))]
61 #[repr(packed)]
62 union Z {
63     //~^ ERROR type has conflicting packed and align representation hints
64     i: i32,
65 }
66
67 fn main() {}