Skip to content

Commit 5ea0e70

Browse files
committed
Make fpreg_t an union
1 parent 81e2b6c commit 5ea0e70

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

libc-test/build.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4398,8 +4398,6 @@ fn test_linux(target: &str) {
43984398
cfg.skip_roundtrip(move |s| match s {
43994399
// FIXME:
44004400
"mcontext_t" if s390x => true,
4401-
// FIXME: This is actually a union.
4402-
"fpreg_t" if s390x => true,
44034401

44044402
// The test doesn't work on some env:
44054403
"ipv6_mreq"

src/unix/linux_like/linux/gnu/b64/s390x.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -212,33 +212,25 @@ s! {
212212
}
213213

214214
s_no_extra_traits! {
215-
// FIXME(union): This is actually a union.
216-
pub struct fpreg_t {
215+
pub union fpreg_t {
217216
pub d: c_double,
218-
// f: c_float,
217+
pub f: c_float,
219218
}
220219
}
221220

222221
cfg_if! {
223222
if #[cfg(feature = "extra_traits")] {
224223
impl PartialEq for fpreg_t {
225224
fn eq(&self, other: &fpreg_t) -> bool {
226-
self.d == other.d
225+
unimplemented!("traits")
227226
}
228227
}
229228

230229
impl Eq for fpreg_t {}
231230

232-
impl fmt::Debug for fpreg_t {
233-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
234-
f.debug_struct("fpreg_t").field("d", &self.d).finish()
235-
}
236-
}
237-
238231
impl hash::Hash for fpreg_t {
239232
fn hash<H: hash::Hasher>(&self, state: &mut H) {
240-
let d: u64 = unsafe { mem::transmute(self.d) };
241-
d.hash(state);
233+
unimplemented!("traits")
242234
}
243235
}
244236
}

0 commit comments

Comments
 (0)