2016-07-03 03:24:27 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
#[repr(C)]
|
2019-12-31 20:25:16 +00:00
|
|
|
enum A {
|
|
|
|
A,
|
|
|
|
}
|
2016-07-03 03:24:27 +00:00
|
|
|
|
|
|
|
#[repr(u64)]
|
2019-12-31 20:25:16 +00:00
|
|
|
enum B {
|
|
|
|
B,
|
|
|
|
}
|
2016-07-03 03:24:27 +00:00
|
|
|
|
2019-12-31 20:25:16 +00:00
|
|
|
#[repr(C, u64)] //~ ERROR conflicting representation hints
|
2020-01-27 23:27:57 +00:00
|
|
|
//~^ WARN this was previously accepted
|
2019-12-31 20:25:16 +00:00
|
|
|
enum C {
|
|
|
|
C,
|
|
|
|
}
|
2016-07-03 03:24:27 +00:00
|
|
|
|
2019-12-31 20:25:16 +00:00
|
|
|
#[repr(u32, u64)] //~ ERROR conflicting representation hints
|
2020-01-27 23:27:57 +00:00
|
|
|
//~^ WARN this was previously accepted
|
2019-12-31 20:25:16 +00:00
|
|
|
enum D {
|
|
|
|
D,
|
|
|
|
}
|
2016-07-03 03:24:27 +00:00
|
|
|
|
|
|
|
#[repr(C, packed)]
|
|
|
|
struct E(i32);
|
|
|
|
|
2017-07-23 07:27:13 +00:00
|
|
|
#[repr(packed, align(8))]
|
2017-07-23 21:54:48 +00:00
|
|
|
struct F(i32); //~ ERROR type has conflicting packed and align representation hints
|
2017-07-23 07:27:13 +00:00
|
|
|
|
|
|
|
#[repr(packed)]
|
|
|
|
#[repr(align(8))]
|
2017-07-23 21:54:48 +00:00
|
|
|
struct G(i32); //~ ERROR type has conflicting packed and align representation hints
|
2017-07-23 07:27:13 +00:00
|
|
|
|
|
|
|
#[repr(align(8))]
|
|
|
|
#[repr(packed)]
|
2017-07-23 21:54:48 +00:00
|
|
|
struct H(i32); //~ ERROR type has conflicting packed and align representation hints
|
|
|
|
|
2018-02-04 11:10:28 +00: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 21:54:48 +00:00
|
|
|
#[repr(packed, align(8))]
|
2019-12-31 20:25:16 +00:00
|
|
|
union X {
|
|
|
|
//~^ ERROR type has conflicting packed and align representation hints
|
|
|
|
i: i32,
|
2017-07-23 21:54:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[repr(packed)]
|
|
|
|
#[repr(align(8))]
|
2019-12-31 20:25:16 +00:00
|
|
|
union Y {
|
|
|
|
//~^ ERROR type has conflicting packed and align representation hints
|
|
|
|
i: i32,
|
2017-07-23 21:54:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[repr(align(8))]
|
|
|
|
#[repr(packed)]
|
2019-12-31 20:25:16 +00:00
|
|
|
union Z {
|
|
|
|
//~^ ERROR type has conflicting packed and align representation hints
|
|
|
|
i: i32,
|
2017-07-23 21:54:48 +00:00
|
|
|
}
|
2017-01-14 22:49:29 +00:00
|
|
|
|
2021-03-20 00:00:00 +00: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 22:49:29 +00:00
|
|
|
fn main() {}
|