-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for generic Atomic
#130539
Comments
Would/could this allow |
Not in the initial implementation tracked here, which does not aim to extend the set of types usable atomically yet. In the future, yes, this moves us into the direction of being able to support additional atomic types in the API. |
Create `Atomic<T>` type alias and use it in core/alloc/std where possible, ignoring test files for now. This is step one, creating the alias from `Atomic<T>` to `AtomicT`. The next step of flipping this and aliasing `AtomicT` to `Atomic<T>` will have a bigger impact, since `AtomicT` imports can be dropped once `Atomic::new` is a usable name. First commit is the true change. Second commit is mostly mechanical replacement of `AtomicT` type names with `Atomic<T>`. See [how this was done for `NonZero`](rust-lang#120257) for the rough blueprint I'm following. - ACP: rust-lang/libs-team#443 (comment) - Tracking issue: rust-lang#130539
From the ACP
This is surprising to me, why does this not propagate the |
In this case, because I was overly terse laying out the API in the ACP, apparently. Both the But also,
|
Feature gate:
#![feature(generic_atomic)]
This is a tracking issue for replacing the distinct
Atomic*
types with a genericAtomic<T>
type. This allows usingAtomic
with FFI type aliases and helps clean up some API surface. Only types with existingAtomicT
are usable inAtomic<T>
.Public API
Steps / History
Atomic<T>
libs-team#443Atomic<T>
as an alias toAtomicT
: CreateAtomic<T>
type alias #130543AtomicT
is an alias toAtomic<T>
AtomicT
toAtomic<_>
Unresolved Questions
Atomic<T>
is soft-blocked on 128-bit atomics, because since trait implementations cannot be unstable, gatingAtomic<i128>
separately fromAtomic<i32>
isn't possible.AtomicI128
could instead nameAtomic<Wrapper<i128>>
for some unstable nameWrapper
until 128-bit atomics are stable, to preventAtomic<i128>
from being usable from stable earlier than intended.Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: