3 // We use packed structs to get around alignment restrictions
10 // But we need to gurantee some alignment
19 let mut w = Wrapper { align: 0, data: Data { pad: 0, ptr: &G } };
21 // Get a pointer to the beginning of the Data struct (one u8 byte, then the pointer bytes).
22 // Thanks to the wrapper, we know this is aligned-enough to perform a load at ptr size.
23 // We load at pointer type, so having a relocation is ok -- but here, the relocation
24 // starts 1 byte to the right, so using it would actually be wrong!
25 let d_alias = &mut w.data as *mut _ as *mut *const u8;
28 let _val = *x; //~ERROR: is a dangling pointer (it has no provenance)