Skip to content

Commit

Permalink
Merge #766
Browse files Browse the repository at this point in the history
766: Remove unneeded branch from atomic! and atomic_is_lock_free r=taiki-e a=taiki-e

They are covered by branches of AtomicU32/AtomicU64.

Co-authored-by: Taiki Endo <te316e89@gmail.com>
  • Loading branch information
bors[bot] and taiki-e committed Jan 8, 2022
2 parents 46a4d60 + 361565a commit ed4b555
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions crossbeam-utils/src/atomic/atomic_cell.rs
Expand Up @@ -741,7 +741,6 @@ macro_rules! atomic {
($t:ty, $a:ident, $atomic_op:expr, $fallback_op:expr) => {
loop {
atomic!(@check, $t, AtomicUnit, $a, $atomic_op);
atomic!(@check, $t, atomic::AtomicUsize, $a, $atomic_op);

atomic!(@check, $t, atomic::AtomicU8, $a, $atomic_op);
atomic!(@check, $t, atomic::AtomicU16, $a, $atomic_op);
Expand All @@ -763,7 +762,6 @@ macro_rules! atomic {
const fn atomic_is_lock_free<T>() -> bool {
// HACK(taiki-e): This is equivalent to `atomic! { T, _a, true, false }`, but can be used in const fn even in Rust 1.36.
let is_lock_free = can_transmute::<T, AtomicUnit>()
| can_transmute::<T, atomic::AtomicUsize>()
| can_transmute::<T, atomic::AtomicU8>()
| can_transmute::<T, atomic::AtomicU16>()
| can_transmute::<T, atomic::AtomicU32>();
Expand Down

0 comments on commit ed4b555

Please sign in to comment.