1 // issue-49296: Unsafe shenigans in constants can result in missing errors
4 #![feature(const_fn_union)]
6 const unsafe fn transmute<T: Copy, U: Copy>(t: T) -> U {
8 union Transmute<T: Copy, U: Copy> {
13 Transmute { from: t }.to
16 const fn wat(x: u64) -> &'static u64 {
17 unsafe { transmute(&x) }
19 const X: u64 = *wat(42);
20 //~^ ERROR any use of this value will cause an error
21 //~| WARN this was previously accepted by the compiler but is being phased out