2016-07-02 22:24:27 -05:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
#[repr(C)]
|
2019-12-31 14:25:16 -06:00
|
|
|
enum A {
|
|
|
|
A,
|
|
|
|
}
|
2016-07-02 22:24:27 -05:00
|
|
|
|
|
|
|
#[repr(u64)]
|
2019-12-31 14:25:16 -06:00
|
|
|
enum B {
|
|
|
|
B,
|
|
|
|
}
|
2016-07-02 22:24:27 -05:00
|
|
|
|
2019-12-31 14:25:16 -06:00
|
|
|
#[repr(C, u64)] //~ ERROR conflicting representation hints
|
2020-01-27 17:27:57 -06:00
|
|
|
//~^ WARN this was previously accepted
|
2019-12-31 14:25:16 -06:00
|
|
|
enum C {
|
|
|
|
C,
|
|
|
|
}
|
2016-07-02 22:24:27 -05:00
|
|
|
|
2019-12-31 14:25:16 -06:00
|
|
|
#[repr(u32, u64)] //~ ERROR conflicting representation hints
|
2020-01-27 17:27:57 -06:00
|
|
|
//~^ WARN this was previously accepted
|
2019-12-31 14:25:16 -06:00
|
|
|
enum D {
|
|
|
|
D,
|
|
|
|
}
|
2016-07-02 22:24:27 -05:00
|
|
|
|
|
|
|
#[repr(C, packed)]
|
|
|
|
struct E(i32);
|
|
|
|
|
2017-07-23 02:27:13 -05:00
|
|
|
#[repr(packed, align(8))]
|
2017-07-23 16:54:48 -05:00
|
|
|
struct F(i32); //~ ERROR type has conflicting packed and align representation hints
|
2017-07-23 02:27:13 -05:00
|
|
|
|
|
|
|
#[repr(packed)]
|
|
|
|
#[repr(align(8))]
|
2017-07-23 16:54:48 -05:00
|
|
|
struct G(i32); //~ ERROR type has conflicting packed and align representation hints
|
2017-07-23 02:27:13 -05:00
|
|
|
|
|
|
|
#[repr(align(8))]
|
|
|
|
#[repr(packed)]
|
2017-07-23 16:54:48 -05:00
|
|
|
struct H(i32); //~ ERROR type has conflicting packed and align representation hints
|
|
|
|
|
2018-02-04 05:10:28 -06:00
|
|
|
#[repr(packed, packed(2))]
|
|
|
|
struct I(i32); //~ ERROR type has conflicting packed representation hints
|
|
|
|
|
|
|
|
#[repr(packed(2))]
|
|
|
|
#[repr(packed)]
|
|
|
|
struct J(i32); //~ ERROR type has conflicting packed representation hints
|
|
|
|
|
|
|
|
#[repr(packed, packed(1))]
|
|
|
|
struct K(i32);
|
|
|
|
|
2017-07-23 16:54:48 -05:00
|
|
|
#[repr(packed, align(8))]
|
2019-12-31 14:25:16 -06:00
|
|
|
union X {
|
|
|
|
//~^ ERROR type has conflicting packed and align representation hints
|
|
|
|
i: i32,
|
2017-07-23 16:54:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[repr(packed)]
|
|
|
|
#[repr(align(8))]
|
2019-12-31 14:25:16 -06:00
|
|
|
union Y {
|
|
|
|
//~^ ERROR type has conflicting packed and align representation hints
|
|
|
|
i: i32,
|
2017-07-23 16:54:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[repr(align(8))]
|
|
|
|
#[repr(packed)]
|
2019-12-31 14:25:16 -06:00
|
|
|
union Z {
|
|
|
|
//~^ ERROR type has conflicting packed and align representation hints
|
|
|
|
i: i32,
|
2017-07-23 16:54:48 -05:00
|
|
|
}
|
2017-01-14 16:49:29 -06:00
|
|
|
|
2021-03-19 19:00:00 -05:00
|
|
|
#[repr(packed, align(0x100))]
|
|
|
|
pub struct S(u16); //~ ERROR type has conflicting packed and align representation hints
|
|
|
|
|
|
|
|
#[repr(packed, align(0x100))]
|
|
|
|
pub union U { //~ ERROR type has conflicting packed and align representation hints
|
|
|
|
u: u16
|
|
|
|
}
|
|
|
|
|
|
|
|
static B: U = U { u: 0 };
|
|
|
|
static A: S = S(0);
|
|
|
|
|
2017-01-14 16:49:29 -06:00
|
|
|
fn main() {}
|