-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Make AtomicBool the same size as bool #33579
Conversation
4a69546
to
222b551
Compare
Note that the libs team discussed this change during triage the other day and the conclusion was that we're amenable to this with the other recent changes to |
Make AtomicBool the same size as bool Reopening #32365 This allows `AtomicBool` to be transmuted to a `bool`, which makes it more consistent with the other atomic types. Note that this now guarantees that the atomic type will always contain a valid `bool` value, which wasn't the case before (due to `fetch_nand`). r? @alexcrichton
@Amanieu Is this a guarantee? Like, on all platforms, all compilers, AtomicBool can be transmuted to bool? Or just specific platforms? |
As it is currently implemented, a transmute will work fine. However I am not sure whether we should make this guarantee to users. Note that currently, atomic-rs relies on |
When discussed with the libs team, the conclusion was that |
Reopening #32365
This allows
AtomicBool
to be transmuted to abool
, which makes it more consistent with the other atomic types. Note that this now guarantees that the atomic type will always contain a validbool
value, which wasn't the case before (due tofetch_nand
).r? @alexcrichton