Skip to content

Commit 96f4497

Browse files
authored
Rollup merge of #108507 - hermitcore:new, r=m-ou-se
use `as_ptr` to determine the address of atomics The PR #107736 renamed atomic `as_mut_ptr` to `as_ptr`. Consequently, the futex implementation of the tier-3 platform `RutyHermit` has to use this new interface. In addition, this PR removes also an unused import.
2 parents e670379 + ae27762 commit 96f4497

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

library/std/src/sys/hermit/futex.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) -
1616

1717
let r = unsafe {
1818
abi::futex_wait(
19-
futex.as_mut_ptr(),
19+
futex.as_ptr(),
2020
expected,
2121
timespec.as_ref().map_or(null(), |t| t as *const abi::timespec),
2222
abi::FUTEX_RELATIVE_TIMEOUT,
@@ -28,12 +28,12 @@ pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) -
2828

2929
#[inline]
3030
pub fn futex_wake(futex: &AtomicU32) -> bool {
31-
unsafe { abi::futex_wake(futex.as_mut_ptr(), 1) > 0 }
31+
unsafe { abi::futex_wake(futex.as_ptr(), 1) > 0 }
3232
}
3333

3434
#[inline]
3535
pub fn futex_wake_all(futex: &AtomicU32) {
3636
unsafe {
37-
abi::futex_wake(futex.as_mut_ptr(), i32::MAX);
37+
abi::futex_wake(futex.as_ptr(), i32::MAX);
3838
}
3939
}

library/std/src/sys/hermit/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
1616
#![allow(missing_docs, nonstandard_style, unsafe_op_in_unsafe_fn)]
1717

18-
use crate::intrinsics;
1918
use crate::os::raw::c_char;
2019

2120
pub mod alloc;

0 commit comments

Comments
 (0)