-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use as_ptr
to determine the address of atomics
#108507
Conversation
r? @m-ou-se (rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
library/std/src/sys/hermit/futex.rs
Outdated
@@ -16,7 +16,7 @@ pub fn futex_wait(futex: &AtomicU32, expected: u32, timeout: Option<Duration>) - | |||
|
|||
let r = unsafe { | |||
abi::futex_wait( | |||
futex.as_mut_ptr(), | |||
futex.as_ptr() as *mut _, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The returned pointer is still mutable, so this does not need casting.
futex.as_ptr() as *mut _, | |
futex.as_ptr(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I fixed it.
@bors r+ rollup |
@m-ou-se Thanks! |
use `as_ptr` to determine the address of atomics The PR rust-lang#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.
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#108419 (Stabilize `atomic_as_ptr`) - rust-lang#108507 (use `as_ptr` to determine the address of atomics) - rust-lang#108607 (Don't use fd-lock on Solaris in bootstrap) - rust-lang#108830 (Treat projections with infer as placeholder during fast reject in new solver) - rust-lang#109055 (create `config::tests::detect_src_and_out` test for bootstrap) - rust-lang#109058 (Document BinOp::is_checkable) - rust-lang#109081 (simd-wide-sum test: adapt for LLVM 17 codegen change) - rust-lang#109083 (Update books) - rust-lang#109088 (Gracefully handle `#[target_feature]` on statics) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The PR #107736 renamed atomic
as_mut_ptr
toas_ptr
. Consequently, the futex implementation of the tier-3 platformRutyHermit
has to use this new interface. In addition, this PR removes also an unused import.