1 use std::mem::{self, MaybeUninit};
4 #[derive(Copy, Clone, Debug, PartialEq)]
5 struct Demo(bool, u16);
9 // Transmute-round-trip through a type with Scalar layout is lossless.
10 // This is tricky because that 'scalar' is *partially* uninitialized.
11 let x = Demo(true, 3);
12 let y: MaybeUninit<u32> = mem::transmute(x);
13 assert_eq!(x, mem::transmute(y));