Closed
Labels
A-atomicArea: Atomics, barriers, and sync primitivesArea: Atomics, barriers, and sync primitivesC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]
Description
Feature gate: #![feature(atomic_from_ptr)], #![feature(const_atomic_from_ptr)]
This is a tracking issue for Atomic*::from_ptr set of functions.
Public API
// core::atomic
impl AtomicBool { pub const unsafe fn from_ptr<'a>(ptr: *mut bool) -> &'a AtomicBool; }
impl<T> AtomicPtr<T> { pub const unsafe fn from_ptr<'a>(ptr: *mut *mut T) -> &'a AtomicPtr<T>; }
impl AtomicU8 { pub const unsafe fn from_ptr<'a>(ptr: *mut u8) -> &'a AtomicU8; }
impl AtomicU16 { pub const unsafe fn from_ptr<'a>(ptr: *mut u16) -> &'a AtomicU16; }
impl AtomicU32 { pub const unsafe fn from_ptr<'a>(ptr: *mut u32) -> &'a AtomicU32; }
impl AtomicU64 { pub const unsafe fn from_ptr<'a>(ptr: *mut u64) -> &'a AtomicU64; }
impl AtomicUsize { pub const unsafe fn from_ptr<'a>(ptr: *mut usize) -> &'a AtomicUsize; }
impl AtomicI8 { pub const unsafe fn from_ptr<'a>(ptr: *mut i8) -> &'a AtomicI8; }
impl AtomicI16 { pub const unsafe fn from_ptr<'a>(ptr: *mut i16) -> &'a AtomicI16; }
impl AtomicI32 { pub const unsafe fn from_ptr<'a>(ptr: *mut i32) -> &'a AtomicI32; }
impl AtomicI64 { pub const unsafe fn from_ptr<'a>(ptr: *mut i64) -> &'a AtomicI64; }
impl AtomicIsize { pub const unsafe fn from_ptr<'a>(ptr: *mut isize) -> &'a AtomicIsize; }Steps / History
- Implementation: Add
Atomic*::from_ptr#108540 - Final comment period (FCP)1
- Stabilization PR - Stabilize
atomic_from_ptr#115719
Unresolved Questions
- None yet.
Footnotes
Reacted by Trevor Gross, Stepan Koltsov, Elichai Turkel and Fathy Boundjadj
Metadata
Metadata
Assignees
Labels
A-atomicArea: Atomics, barriers, and sync primitivesArea: Atomics, barriers, and sync primitivesC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]
Activity
tgross35 commentedon Sep 9, 2023
I think there is a duplication in the docs, I think the bool line shouldn't be there?
Other than that, do you have any opposition to me opening a stabilization PR @WaffleLapkin? This hasn't been around super long but it seems uncontroversial, and mirrors
as_ptr.WaffleLapkin commentedon Sep 9, 2023
@tgross35 I have no opposition, however do note that the decision here is on the libs-api team =)
you may want to reach out to them in the zulip for example
tgross35 commentedon Sep 9, 2023
Rightieo, this change is small enough that I opened #115719 to get the ball rolling
Auto merge of rust-lang#115719 - tgross35:atomic-from-ptr, r=dtolnay
Dylan-DPC commentedon Mar 7, 2024
Stabilised in #115719
[-]Tracking Issue for `Atomic*::from_ptr`[/-][+]Tracking Issue for `Atomic*::from_ptr` and `const_atomic_from_ptr`[/+]tgross35 commentedon Oct 14, 2024
Reopening this since the const gate still points here
Stabilize `const_atomic_from_ptr`
Stabilize `const_atomic_from_ptr`
Stabilize `const_atomic_from_ptr`
Stabilize `const_atomic_from_ptr`
joboet commentedon Sep 17, 2025
This was stabilised in 1.84.