Skip to content

Commit 9e4a692

Browse files
author
Robin Kruppe
committed
Replace empty array hack with repr(align)
As a side effect, this fixes the warning about repr(C, simd) that has been reported during x86_64 windows builds since #47111 (see also: #47103)
1 parent 6828cf9 commit 9e4a692

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@
296296
#![feature(rand)]
297297
#![feature(raw)]
298298
#![feature(repr_align)]
299-
#![feature(repr_simd)]
300299
#![feature(rustc_attrs)]
301300
#![feature(shared)]
302301
#![feature(sip_hash_13)]

src/libstd/sys/windows/c.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ use os::raw::c_ulonglong;
2020
use libc::{wchar_t, size_t, c_void};
2121
use ptr;
2222

23-
#[repr(simd)]
24-
#[repr(C)]
25-
#[cfg(target_arch = "x86_64")]
26-
struct u64x2(u64, u64);
27-
2823
pub use self::FILE_INFO_BY_HANDLE_CLASS::*;
2924
pub use self::EXCEPTION_DISPOSITION::*;
3025

@@ -700,9 +695,8 @@ pub struct FLOATING_SAVE_AREA {
700695
}
701696

702697
#[cfg(target_arch = "x86_64")]
703-
#[repr(C)]
698+
#[repr(C, align(16))]
704699
pub struct CONTEXT {
705-
_align_hack: [u64x2; 0], // FIXME align on 16-byte
706700
pub P1Home: DWORDLONG,
707701
pub P2Home: DWORDLONG,
708702
pub P3Home: DWORDLONG,
@@ -760,17 +754,15 @@ pub struct CONTEXT {
760754
}
761755

762756
#[cfg(target_arch = "x86_64")]
763-
#[repr(C)]
757+
#[repr(C, align(16))]
764758
pub struct M128A {
765-
_align_hack: [u64x2; 0], // FIXME align on 16-byte
766759
pub Low: c_ulonglong,
767760
pub High: c_longlong
768761
}
769762

770763
#[cfg(target_arch = "x86_64")]
771-
#[repr(C)]
764+
#[repr(C, align(16))]
772765
pub struct FLOATING_SAVE_AREA {
773-
_align_hack: [u64x2; 0], // FIXME align on 16-byte
774766
_Dummy: [u8; 512] // FIXME: Fill this out
775767
}
776768

0 commit comments

Comments
 (0)