]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/transmute-size-mismatch-before-typeck.rs
Rollup merge of #97366 - WaffleLapkin:stabilize_array_slice_from_ref, r=dtolnay
[rust.git] / src / test / ui / consts / transmute-size-mismatch-before-typeck.rs
1 // normalize-stderr-64bit "64 bits" -> "word size"
2 // normalize-stderr-32bit "32 bits" -> "word size"
3 // normalize-stderr-64bit "128 bits" -> "2 * word size"
4 // normalize-stderr-32bit "64 bits" -> "2 * word size"
5
6 fn main() {
7     match &b""[..] {
8         ZST => {}
9     }
10 }
11
12 const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
13 //~^ ERROR cannot transmute between types of different sizes