1 #![feature(const_transmute)]
3 // normalize-stderr-64bit "64 bits" -> "word size"
4 // normalize-stderr-32bit "32 bits" -> "word size"
5 // normalize-stderr-64bit "128 bits" -> "2 * word size"
6 // normalize-stderr-32bit "64 bits" -> "2 * word size"
10 ZST => {} //~ ERROR could not evaluate constant pattern
11 //~| ERROR could not evaluate constant pattern
15 const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
16 //~^ ERROR any use of this value will cause an error
17 //~| ERROR cannot transmute between types of different sizes
18 //~| WARN this was previously accepted by the compiler but is being phased out
20 // Once the `any use of this value will cause an error` disappears in this test, make sure to
21 // remove the `TransmuteSizeDiff` error variant and make its emitter site an assertion again.