Skip to content

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

Open
@WaffleLapkin

Description

@WaffleLapkin
Member

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

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
tgross35

tgross35 commented on Sep 9, 2023

@tgross35
Contributor

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.

WaffleLapkin

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

tgross35

tgross35 commented on Sep 9, 2023

@tgross35
Contributor

@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

added a commit that references this issue on Oct 14, 2023

Auto merge of rust-lang#115719 - tgross35:atomic-from-ptr, r=dtolnay

Dylan-DPC

Dylan-DPC commented on Mar 7, 2024

@Dylan-DPC
Member

Stabilised in #115719

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

tgross35 commented on Oct 14, 2024

@tgross35
Contributor

Reopening this since the const gate still points here

added a commit that references this issue on Oct 29, 2024
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-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tgross35@WaffleLapkin@Dylan-DPC

        Issue actions

          Tracking Issue for `Atomic*::from_ptr` and `const_atomic_from_ptr` · Issue #108652 · rust-lang/rust