]> git.lizzy.rs Git - rust.git/blob - src/test/ui/conflicting-repr-hints.rs
Rollup merge of #57052 - Centril:fix-eip-stable-version, r=varkor
[rust.git] / src / test / ui / conflicting-repr-hints.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![allow(dead_code)]
12
13 #[repr(C)]
14 enum A { A }
15
16 #[repr(u64)]
17 enum B { B }
18
19 #[repr(C, u64)] //~ WARNING conflicting representation hints
20 enum C { C }
21
22 #[repr(u32, u64)] //~ WARNING conflicting representation hints
23 enum D { D }
24
25 #[repr(C, packed)]
26 struct E(i32);
27
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
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
49 #[repr(packed, align(8))]
50 union X { //~ ERROR type has conflicting packed and align representation hints
51     i: i32
52 }
53
54 #[repr(packed)]
55 #[repr(align(8))]
56 union Y { //~ ERROR type has conflicting packed and align representation hints
57     i: i32
58 }
59
60 #[repr(align(8))]
61 #[repr(packed)]
62 union Z { //~ ERROR type has conflicting packed and align representation hints
63     i: i32
64 }
65
66 fn main() {}