1 #![feature(core_intrinsics)]
6 let x: Option<Box<[u8]>> = unsafe {
7 let z = std::intrinsics::add_with_overflow(0usize, 0usize);
8 std::mem::transmute::<(usize, bool), Option<Box<[u8]>>>(z)
11 // Now read this bytewise. There should be (`ptr_size + 1`) def bytes followed by
12 // (`ptr_size - 1`) undef bytes (the padding after the bool) in there.
13 let z: *const u8 = y as *const _ as *const _;
14 let first_undef = mem::size_of::<usize>() as isize + 1;
15 for i in 0..first_undef {
16 let byte = unsafe { *z.offset(i) };
19 let v = unsafe { *z.offset(first_undef) };
20 //~^ ERROR: uninitialized
22 println!("it is zero");