2018-09-06 14:41:12 +02:00
|
|
|
// run-pass
|
|
|
|
|
2018-08-20 19:51:48 +01:00
|
|
|
use std::mem;
|
|
|
|
|
|
|
|
#[repr(transparent)]
|
2022-07-25 22:36:03 +02:00
|
|
|
struct Foo(#[allow(unused_tuple_struct_fields)] u32);
|
2018-08-20 19:51:48 +01:00
|
|
|
|
|
|
|
const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) };
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(TRANSMUTED_U32, 3);
|
|
|
|
}
|