]>
Commit | Line | Data |
---|---|---|
9e0c209e | 1 | #![allow(dead_code)] |
3157f602 | 2 | |
9e0c209e | 3 | #[repr(C)] |
dfeec247 XL |
4 | enum A { |
5 | A, | |
6 | } | |
5bcae85e | 7 | |
9e0c209e | 8 | #[repr(u64)] |
dfeec247 XL |
9 | enum B { |
10 | B, | |
11 | } | |
5bcae85e | 12 | |
dfeec247 XL |
13 | #[repr(C, u64)] //~ ERROR conflicting representation hints |
14 | //~^ WARN this was previously accepted | |
15 | enum C { | |
16 | C, | |
17 | } | |
a7813a04 | 18 | |
dfeec247 XL |
19 | #[repr(u32, u64)] //~ ERROR conflicting representation hints |
20 | //~^ WARN this was previously accepted | |
21 | enum D { | |
22 | D, | |
23 | } | |
9e0c209e SL |
24 | |
25 | #[repr(C, packed)] | |
26 | struct E(i32); | |
27 | ||
3b2f2976 XL |
28 | #[repr(packed, align(8))] |
29 | struct F(i32); //~ ERROR type has conflicting packed and align representation hints | |
30 | ||
31 | #[repr(packed)] | |
32 | #[repr(align(8))] | |
33 | struct G(i32); //~ ERROR type has conflicting packed and align representation hints | |
34 | ||
35 | #[repr(align(8))] | |
36 | #[repr(packed)] | |
37 | struct H(i32); //~ ERROR type has conflicting packed and align representation hints | |
38 | ||
83c7162d XL |
39 | #[repr(packed, packed(2))] |
40 | struct I(i32); //~ ERROR type has conflicting packed representation hints | |
41 | ||
42 | #[repr(packed(2))] | |
43 | #[repr(packed)] | |
44 | struct J(i32); //~ ERROR type has conflicting packed representation hints | |
45 | ||
46 | #[repr(packed, packed(1))] | |
47 | struct K(i32); | |
48 | ||
3b2f2976 | 49 | #[repr(packed, align(8))] |
dfeec247 XL |
50 | union X { |
51 | //~^ ERROR type has conflicting packed and align representation hints | |
52 | i: i32, | |
3b2f2976 XL |
53 | } |
54 | ||
55 | #[repr(packed)] | |
56 | #[repr(align(8))] | |
dfeec247 XL |
57 | union Y { |
58 | //~^ ERROR type has conflicting packed and align representation hints | |
59 | i: i32, | |
3b2f2976 XL |
60 | } |
61 | ||
62 | #[repr(align(8))] | |
63 | #[repr(packed)] | |
dfeec247 XL |
64 | union Z { |
65 | //~^ ERROR type has conflicting packed and align representation hints | |
66 | i: i32, | |
3b2f2976 | 67 | } |
cc61c64b | 68 | |
136023e0 XL |
69 | #[repr(packed, align(0x100))] |
70 | pub struct S(u16); //~ ERROR type has conflicting packed and align representation hints | |
71 | ||
72 | #[repr(packed, align(0x100))] | |
73 | pub union U { //~ ERROR type has conflicting packed and align representation hints | |
74 | u: u16 | |
75 | } | |
76 | ||
77 | static B: U = U { u: 0 }; | |
78 | static A: S = S(0); | |
79 | ||
cc61c64b | 80 | fn main() {} |