From b70f21726238d73e671179ca6fe54ec228c75870 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 23 Jul 2019 13:51:28 -0400 Subject: [PATCH] Use raw pointers in std::sys::cloudabi when passing MaybeUninit values --- src/libstd/sys/cloudabi/abi/cloudabi.rs | 4 ++-- src/libstd/sys/cloudabi/condvar.rs | 4 ++-- src/libstd/sys/cloudabi/time.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libstd/sys/cloudabi/abi/cloudabi.rs b/src/libstd/sys/cloudabi/abi/cloudabi.rs index 2307e2167c5..9addba8b611 100644 --- a/src/libstd/sys/cloudabi/abi/cloudabi.rs +++ b/src/libstd/sys/cloudabi/abi/cloudabi.rs @@ -1884,7 +1884,7 @@ pub unsafe fn clock_res_get(clock_id_: clockid, resolution_: &mut timestamp) -> /// **time**: /// The time value of the clock. #[inline] -pub unsafe fn clock_time_get(clock_id_: clockid, precision_: timestamp, time_: &mut timestamp) -> errno { +pub unsafe fn clock_time_get(clock_id_: clockid, precision_: timestamp, time_: *mut timestamp) -> errno { cloudabi_sys_clock_time_get(clock_id_, precision_, time_) } @@ -2643,7 +2643,7 @@ pub unsafe fn mem_unmap(mapping_: &mut [u8]) -> errno { /// **nevents**: /// The number of events stored. #[inline] -pub unsafe fn poll(in_: *const subscription, out_: *mut event, nsubscriptions_: usize, nevents_: &mut usize) -> errno { +pub unsafe fn poll(in_: *const subscription, out_: *mut event, nsubscriptions_: usize, nevents_: *mut usize) -> errno { cloudabi_sys_poll(in_, out_, nsubscriptions_, nevents_) } diff --git a/src/libstd/sys/cloudabi/condvar.rs b/src/libstd/sys/cloudabi/condvar.rs index bce76a082e6..ec1fca7805a 100644 --- a/src/libstd/sys/cloudabi/condvar.rs +++ b/src/libstd/sys/cloudabi/condvar.rs @@ -85,7 +85,7 @@ impl Condvar { &subscription, event.as_mut_ptr(), 1, - nevents.get_mut() + nevents.as_mut_ptr() ); assert_eq!( ret, @@ -142,7 +142,7 @@ impl Condvar { subscriptions.as_ptr(), mem::MaybeUninit::first_ptr_mut(&mut events), 2, - nevents.get_mut() + nevents.as_mut_ptr() ); assert_eq!( ret, diff --git a/src/libstd/sys/cloudabi/time.rs b/src/libstd/sys/cloudabi/time.rs index d90f7dec496..5e502dcb2ba 100644 --- a/src/libstd/sys/cloudabi/time.rs +++ b/src/libstd/sys/cloudabi/time.rs @@ -19,7 +19,7 @@ impl Instant { pub fn now() -> Instant { unsafe { let mut t: mem::MaybeUninit = mem::MaybeUninit::uninit(); - let ret = abi::clock_time_get(abi::clockid::MONOTONIC, 0, t.get_mut()); + let ret = abi::clock_time_get(abi::clockid::MONOTONIC, 0, t.as_mut_ptr()); assert_eq!(ret, abi::errno::SUCCESS); Instant { t: t.assume_init() } } @@ -60,7 +60,7 @@ impl SystemTime { pub fn now() -> SystemTime { unsafe { let mut t: mem::MaybeUninit = mem::MaybeUninit::uninit(); - let ret = abi::clock_time_get(abi::clockid::REALTIME, 0, t.get_mut()); + let ret = abi::clock_time_get(abi::clockid::REALTIME, 0, t.as_mut_ptr()); assert_eq!(ret, abi::errno::SUCCESS); SystemTime { t: t.assume_init() } }