Skip to content

Commit 44a063a

Browse files
committed
Auto merge of #1531 - gnzlbg:fixs, r=gnzlbg
Fix max_align_t
2 parents 90269e8 + 56d4647 commit 44a063a

File tree

21 files changed

+155
-65
lines changed

21 files changed

+155
-65
lines changed

src/unix/bsd/apple/b32/align.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f64; 2]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f64; 2]
6+
}
7+
}

src/unix/bsd/apple/b64/align.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f64; 2]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f64; 2]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f64; 4]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f64; 4]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(8))]
3-
pub struct max_align_t([f64; 2]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(8))]
4+
pub struct max_align_t {
5+
priv_: [f64; 2]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f32; 8]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f32; 8]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f64; 4]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f64; 4]
6+
}
7+
}

src/unix/linux_like/emscripten/align.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
macro_rules! expand_align {
22
() => {
3-
#[derive(Copy, Clone, Debug, PartialEq)]
4-
#[repr(C, align(8))]
5-
pub struct max_align_t([f64; 2]);
6-
73
s! {
4+
#[allow(missing_debug_implementations)]
85
#[repr(align(4))]
96
pub struct pthread_mutex_t {
107
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
@@ -39,6 +36,13 @@ macro_rules! expand_align {
3936
pub struct pthread_cond_t {
4037
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
4138
}
39+
40+
#[allow(missing_debug_implementations)]
41+
#[repr(align(8))]
42+
pub struct max_align_t {
43+
priv_: [f64; 2]
44+
}
45+
4246
}
4347

4448
cfg_if! {
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(8))]
3-
pub struct max_align_t([i64; 2]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(8))]
4+
pub struct max_align_t {
5+
priv_: [i64; 2]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(8))]
3-
pub struct max_align_t([f32; 4]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(8))]
4+
pub struct max_align_t {
5+
priv_: [f32; 4]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f64; 6]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f64; 6]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f32; 8]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f32; 8]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f64; 4]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f64; 4]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([i64; 4]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [i64; 4]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([i64; 4]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [i64; 4]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f64; 4]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f64; 4]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(8))]
3-
pub struct max_align_t(i64, i64);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(8))]
4+
pub struct max_align_t {
5+
priv_: (i64, i64)
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(8))]
3-
pub struct max_align_t([f32; 4]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(8))]
4+
pub struct max_align_t {
5+
priv_: [f32; 4]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(8))]
3-
pub struct max_align_t([f64; 3]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(8))]
4+
pub struct max_align_t {
5+
priv_: [f64; 3]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f32; 8]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f32; 8]
6+
}
7+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
#[derive(Copy, Clone, Debug, PartialEq)]
2-
#[repr(C, align(16))]
3-
pub struct max_align_t([f64; 4]);
1+
s_no_extra_traits! {
2+
#[allow(missing_debug_implementations)]
3+
#[repr(align(16))]
4+
pub struct max_align_t {
5+
priv_: [f64; 4]
6+
}
7+
}

src/windows/gnu/align.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
cfg_if! {
22
if #[cfg(target_pointer_width = "64")] {
3-
#[derive(Copy, Clone, Debug, PartialEq)]
4-
#[repr(C, align(16))] pub struct max_align_t([f64; 4]);
3+
s_no_extra_traits! {
4+
#[allow(missing_debug_implementations)]
5+
#[repr(align(16))]
6+
pub struct max_align_t {
7+
priv_: [f64; 4]
8+
}
9+
}
510
} else if #[cfg(target_pointer_width = "32")] {
6-
#[derive(Copy, Clone, Debug, PartialEq)]
7-
#[repr(C, align(16))] pub struct max_align_t([i64; 6]);
11+
s_no_extra_traits! {
12+
#[allow(missing_debug_implementations)]
13+
#[repr(align(16))]
14+
pub struct max_align_t {
15+
priv_: [i64; 6]
16+
}
17+
}
818
}
919
}

0 commit comments

Comments
 (0)