@@ -773,15 +773,20 @@ fn offset_of_addr() { |
|
|
773 |
773 |
#[test] |
774 |
774 |
fn const_maybe_uninit_zeroed() { |
775 |
775 |
// Sanity check for `MaybeUninit::zeroed` in a realistic const situation (plugin array term) |
|
776 |
+ |
|
777 |
+// It is crucial that this type has no padding! |
776 |
778 |
#[repr(C)] |
777 |
779 |
struct Foo { |
778 |
|
-a: Option<&'static str>, |
|
780 |
+a: Option<&'static u8>, |
779 |
781 |
b: Bar, |
780 |
782 |
c: f32, |
|
783 |
+_pad: u32, |
781 |
784 |
d: *const u8, |
782 |
785 |
} |
|
786 |
+ |
783 |
787 |
#[repr(C)] |
784 |
788 |
struct Bar(usize); |
|
789 |
+ |
785 |
790 |
struct FooPtr(*const Foo); |
786 |
791 |
unsafe impl Sync for FooPtr {} |
787 |
792 |
|