-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Use pointer type in AtomicPtr::swap implementation #80236
Conversation
The job Click to see the possible cause of the failure (guessed by this bot)
|
This comment has been minimized.
This comment has been minimized.
if int_type_width_signed(ty, bx.tcx()).is_some() { | ||
bx.atomic_rmw(atom_op, args[0].immediate(), args[1].immediate(), order) | ||
if int_type_width_signed(ty, bx.tcx()).is_some() | ||
|| (ty.is_unsafe_ptr() && op == "xchg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a bit piecemeal to do this just for one operation. Won't we simply be back at this soon with another operation?
If you have the time, could you remove all as *mut usize
and as usize
from the implementation of AtomicPtr
and adjust the intrinsics accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is anything left (though I might have missed something). Remaining operations are intentionally unsupported in atomic ptr, so I don't think we should support them in intrinsics either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, great, thanks for having a look!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this was not quite right (or the situation changed since then)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no pointer to integer casts in AtomicPtr implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, you are right... need to follow up in that issue then.
@bors r+ |
📌 Commit 4ad53dc has been approved by |
Use pointer type in AtomicPtr::swap implementation Closes rust-lang#80234.
Rollup of 11 pull requests Successful merges: - rust-lang#80159 (Add array search aliases) - rust-lang#80166 (Edit rustc_middle docs) - rust-lang#80170 (Fix ICE when lookup method in trait for type that have bound vars) - rust-lang#80171 (Edit rustc_middle::ty::TyKind docs) - rust-lang#80199 (also const-check FakeRead) - rust-lang#80211 (Handle desugaring in impl trait bound suggestion) - rust-lang#80236 (Use pointer type in AtomicPtr::swap implementation) - rust-lang#80239 (Update Clippy) - rust-lang#80240 (make sure installer only creates directories in DESTDIR) - rust-lang#80244 (Cleanup markdown span handling) - rust-lang#80250 (Minor cleanups in LateResolver) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Closes #80234.