Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Tracking Issue for generic Atomic #130539

Copy link
Copy link
@CAD97

Description

@CAD97
Issue body actions

Feature gate: #![feature(generic_atomic)]

This is a tracking issue for replacing the distinct Atomic* types with a generic Atomic<T> type. This allows using Atomic with FFI type aliases and helps clean up some API surface. Only types with existing AtomicT are usable in Atomic<T>.

Public API

// core::sync::atomic

pub struct Atomic<T: AtomicPrimitive>(/* private fields*/);

pub type AtomicI32 = Atomic<i32>; // etc

Steps / History

Unresolved Questions

  • Atomic<T> is soft-blocked on 128-bit atomics, because since trait implementations cannot be unstable, gating Atomic<i128> separately from Atomic<i32> isn't possible.
    • If necessary, AtomicI128 could instead name Atomic<Wrapper<i128>> for some unstable name Wrapper until 128-bit atomics are stable, to prevent Atomic<i128> from being usable from stable earlier than intended.

Footnotes

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

MolotovCherry and jasper310899MolotovCherry and jasper310899bjoernager, Serial-ATA, MolotovCherry, joseluis and jasper310899

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.