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