Skip to content

Commit b70f217

Browse files
committed
Use raw pointers in std::sys::cloudabi when passing MaybeUninit values
1 parent 0ac6afa commit b70f217

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/libstd/sys/cloudabi/abi/cloudabi.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ pub unsafe fn clock_res_get(clock_id_: clockid, resolution_: &mut timestamp) ->
18841884
/// **time**:
18851885
/// The time value of the clock.
18861886
#[inline]
1887-
pub unsafe fn clock_time_get(clock_id_: clockid, precision_: timestamp, time_: &mut timestamp) -> errno {
1887+
pub unsafe fn clock_time_get(clock_id_: clockid, precision_: timestamp, time_: *mut timestamp) -> errno {
18881888
cloudabi_sys_clock_time_get(clock_id_, precision_, time_)
18891889
}
18901890

@@ -2643,7 +2643,7 @@ pub unsafe fn mem_unmap(mapping_: &mut [u8]) -> errno {
26432643
/// **nevents**:
26442644
/// The number of events stored.
26452645
#[inline]
2646-
pub unsafe fn poll(in_: *const subscription, out_: *mut event, nsubscriptions_: usize, nevents_: &mut usize) -> errno {
2646+
pub unsafe fn poll(in_: *const subscription, out_: *mut event, nsubscriptions_: usize, nevents_: *mut usize) -> errno {
26472647
cloudabi_sys_poll(in_, out_, nsubscriptions_, nevents_)
26482648
}
26492649

src/libstd/sys/cloudabi/condvar.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl Condvar {
8585
&subscription,
8686
event.as_mut_ptr(),
8787
1,
88-
nevents.get_mut()
88+
nevents.as_mut_ptr()
8989
);
9090
assert_eq!(
9191
ret,
@@ -142,7 +142,7 @@ impl Condvar {
142142
subscriptions.as_ptr(),
143143
mem::MaybeUninit::first_ptr_mut(&mut events),
144144
2,
145-
nevents.get_mut()
145+
nevents.as_mut_ptr()
146146
);
147147
assert_eq!(
148148
ret,

src/libstd/sys/cloudabi/time.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl Instant {
1919
pub fn now() -> Instant {
2020
unsafe {
2121
let mut t: mem::MaybeUninit<abi::timestamp> = mem::MaybeUninit::uninit();
22-
let ret = abi::clock_time_get(abi::clockid::MONOTONIC, 0, t.get_mut());
22+
let ret = abi::clock_time_get(abi::clockid::MONOTONIC, 0, t.as_mut_ptr());
2323
assert_eq!(ret, abi::errno::SUCCESS);
2424
Instant { t: t.assume_init() }
2525
}
@@ -60,7 +60,7 @@ impl SystemTime {
6060
pub fn now() -> SystemTime {
6161
unsafe {
6262
let mut t: mem::MaybeUninit<abi::timestamp> = mem::MaybeUninit::uninit();
63-
let ret = abi::clock_time_get(abi::clockid::REALTIME, 0, t.get_mut());
63+
let ret = abi::clock_time_get(abi::clockid::REALTIME, 0, t.as_mut_ptr());
6464
assert_eq!(ret, abi::errno::SUCCESS);
6565
SystemTime { t: t.assume_init() }
6666
}

0 commit comments

Comments
 (0)