summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/transmute-const.rs
blob: c5c3dfc4cc7bda06fed3c71c41b2289b60d3833f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// run-pass

use std::mem;

#[repr(transparent)]
struct Foo(#[allow(unused_tuple_struct_fields)] u32);

const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) };

fn main() {
    assert_eq!(TRANSMUTED_U32, 3);
}