You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The representation of the final value of a [constant][constant initializer] or [static initializer] must only contain bytes with provenance in whole-pointer groups. If a byte has provenance but is not part of an adjacent group of bytes that form an entire pointer, compilation will fail.
239
239
240
+
```rust,compile_fail
241
+
# use core::mem::MaybeUninit;
242
+
#
243
+
#[repr(C)]
244
+
struct Pair {
245
+
x: u128,
246
+
y: MaybeUninit<u64>,
247
+
// 8 bytes of padding at offset 24.
248
+
}
249
+
250
+
const C: Pair = unsafe {
251
+
let mut m = MaybeUninit::<Pair>::uninit();
252
+
// Store pointer that extends half-way into trailing padding.
0 commit comments