-
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
Tracking issue for atomic_mut_ptr #66893
Comments
I'm not sure this is phrased as best as it could in the documentation, in the sense that callers are definitely allowed to do non-atomic accesses to the underlying value, but they must do so only if they can guarantee that absolutely no other thread will observe a non-atomic access. Does that make sense? |
This should probably also be added to AtomicPtr, for consistency between the Atomic* types. |
… r=m-ou-se Add `AtomicPtr::as_mut_ptr` See rust-lang#66893 (comment) r? thomcc
@KodrAus are there any concerns about stabilizing this feature? If not, could we go ahead with the stabilization PR? |
Actually I have one addition - this could be |
I'm wondering if it should just be |
Yeah, that's a good point. I don't think there are many cases where a separate Would this naming change require a FCP? Edit: created #107736 to discuss |
Mark 'atomic_mut_ptr' methods const There's nothing that would block these methods from being const (just an UnsafeCell get), and it would be helpful for FFI interfaces in static contexts Related tracking issue: rust-lang#66893
Mark 'atomic_mut_ptr' methods const There's nothing that would block these methods from being const (just an UnsafeCell get), and it would be helpful for FFI interfaces in static contexts Related tracking issue: rust-lang#66893
Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref rust-lang#66893) Originally discussed in rust-lang#66893 (comment) ~~This uses rust-lang#107706 as a base to avoid a merge conflict once that gets rolled up (so disregard const changes in the diff until it does)~~ all merged & rebased `@rustbot` label +T-libs-api r? m-ou-se
Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref rust-lang#66893) Originally discussed in rust-lang#66893 (comment) ~~This uses rust-lang#107706 as a base to avoid a merge conflict once that gets rolled up (so disregard const changes in the diff until it does)~~ all merged & rebased `@rustbot` label +T-libs-api r? m-ou-se
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#107736 ( Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref rust-lang#66893) ) - rust-lang#108176 (Don't delay `ReError` bug during lexical region resolve) - rust-lang#108315 (Lint dead code in closures and generators) - rust-lang#108342 (apply query response: actually define opaque types) - rust-lang#108344 (Fix test filename for rust-lang#105700) - rust-lang#108353 (resolve: Remove `ImportResolver`) Failed merges: - rust-lang#107911 (Add check for invalid #[macro_export] arguments) r? `@ghost` `@rustbot` modify labels: rollup
I don't think there's too much debate about anything here, so I opened #108419 to stabilize it |
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
Stabilize `atomic_as_ptr` Fixes rust-lang#66893 This stabilizes the `as_ptr` methods for atomics. The stabilization feature gate used here is `atomic_as_ptr` which supersedes `atomic_mut_ptr` to match the change in rust-lang#107736. This needs FCP. New stable API: ```rust impl AtomicBool { pub const fn as_ptr(&self) -> *mut bool; } impl AtomicI32 { pub const fn as_ptr(&self) -> *mut i32; } // Includes all other atomic types impl<T> AtomicPtr<T> { pub const fn as_ptr(&self) -> *mut *mut T; } ``` r? libs-api `@rustbot` label +needs-fcp
Add `AtomicPtr::as_mut_ptr` See rust-lang/rust#66893 (comment) r? thomcc
Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref #66893) Originally discussed in rust-lang/rust#66893 (comment) ~~This uses #107706 as a base to avoid a merge conflict once that gets rolled up (so disregard const changes in the diff until it does)~~ all merged & rebased `@rustbot` label +T-libs-api r? m-ou-se
This is a tracking issue for
atomic_mut_ptr
.Public API
Steps / History
AtomicPtr::as_mut_ptr
#106762as_ptr
: Rename atomic 'as_mut_ptr' to 'as_ptr' to match Cell (ref #66893) #107736The text was updated successfully, but these errors were encountered: