Skip to content

Tracking Issue for Atomic*::from_ptr and const_atomic_from_ptr #108652

Description

@WaffleLapkin

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

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    A-atomicArea: Atomics, barriers, and sync primitives
    on Mar 2, 2023
  2. tgross35 commented on Sep 9, 2023

    @tgross35
    Member

    I think there is a duplication in the docs, I think the bool line shouldn't be there?

    image

    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.

  3. WaffleLapkin commented on Sep 9, 2023

    @WaffleLapkin
    MemberAuthor

    @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

  4. tgross35 commented on Sep 9, 2023

    @tgross35
    Member

    @tgross35 I have no opposition, however do note that the decision here is on the libs-api team =)

    Rightieo, this change is small enough that I opened #115719 to get the ball rolling

  5. added a commit that references this issue on Oct 14, 2023
  6. Dylan-DPC commented on Mar 7, 2024

    @Dylan-DPC
    Member

    Stabilised in #115719

  7. changed the title [-]Tracking Issue for `Atomic*::from_ptr`[/-] [+]Tracking Issue for `Atomic*::from_ptr` and `const_atomic_from_ptr`[/+] on Oct 14, 2024
  8. tgross35 commented on Oct 14, 2024

    @tgross35
    Member

    Reopening this since the const gate still points here

  9. added a commit that references this issue on Oct 29, 2024
  10. added
    T-libs-api[DEPRECATED; DO NOT USE]
    and removed
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    on Sep 17, 2025
  11. joboet commented on Sep 17, 2025

    @joboet
    Member

    This was stabilised in 1.84.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-atomicArea: Atomics, barriers, and sync primitivesC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions