Skip to content

Clean up atomics support #1592

Closed as not planned
Closed as not planned
@joshlf

Description

@joshlf

#1586 gates impls of zerocopy traits for atomic types on target_has_atomic = "xxx", ensuring that we don't emit invalid impls. On its own, that PR is correct, but attempts to be minimal in order to make quick progress and to avoid lumping a large refactor into what would otherwise be a small PR.

Separately, we should follow up and clean up atomics support in general:

  • Consider co-locating the definition of unsafe_impl_transparent_wrapper_for_atomic! (in util in #1586) with its uses (in impls in #1586). Note that we may also want to avoid doing that since reasoning about the soundness of the body of that macro requires understanding the semantics of TransparentWrapper, so having it next to the definition of TransparentWrapper might be good.
  • Consider indirecting via an Atomic trait as prototyped in Gate implementations for Atomic* types behind #[cfg(target_has_atomic)] and Rust 1.60 #1091
  • Consider adopting any other ideas from #1091 which weren't already carved out into separate PRs (#1585 and #1585)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions