|
| 1 | +From 449b92a496a239dbadb5137dac77e34d726ddec4 Mon Sep 17 00:00:00 2001 |
| 2 | + |
| 3 | +Date: Tue, 14 Apr 2020 14:53:34 +0200 |
| 4 | +Subject: [PATCH] Patch 128bit usage away |
| 5 | + |
| 6 | +--- |
| 7 | + src/libcore/convert/num.rs | 28 ++++++++++++++-------------- |
| 8 | + src/libcore/num/mod.rs | 8 ++++---- |
| 9 | + src/libcore/sync/atomic.rs | 4 ++-- |
| 10 | + 3 files changed, 20 insertions(+), 20 deletions(-) |
| 11 | + |
| 12 | +diff --git a/src/libcore/convert/num.rs b/src/libcore/convert/num.rs |
| 13 | +index 66ae760..3913060 100644 |
| 14 | +--- a/src/libcore/convert/num.rs |
| 15 | ++++ b/src/libcore/convert/num.rs |
| 16 | +@@ -373,13 +373,13 @@ mod ptr_try_from_impls { |
| 17 | + } |
| 18 | + |
| 19 | + // Conversion traits for non-zero integer types |
| 20 | +-use crate::num::NonZeroI128; |
| 21 | ++//use crate::num::NonZeroI128; |
| 22 | + use crate::num::NonZeroI16; |
| 23 | + use crate::num::NonZeroI32; |
| 24 | + use crate::num::NonZeroI64; |
| 25 | + use crate::num::NonZeroI8; |
| 26 | + use crate::num::NonZeroIsize; |
| 27 | +-use crate::num::NonZeroU128; |
| 28 | ++//use crate::num::NonZeroU128; |
| 29 | + use crate::num::NonZeroU16; |
| 30 | + use crate::num::NonZeroU32; |
| 31 | + use crate::num::NonZeroU64; |
| 32 | +@@ -416,39 +416,39 @@ macro_rules! nzint_impl_from { |
| 33 | + nzint_impl_from! { NonZeroU8, NonZeroU16, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 34 | + nzint_impl_from! { NonZeroU8, NonZeroU32, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 35 | + nzint_impl_from! { NonZeroU8, NonZeroU64, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 36 | +-nzint_impl_from! { NonZeroU8, NonZeroU128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 37 | ++//nzint_impl_from! { NonZeroU8, NonZeroU128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 38 | + nzint_impl_from! { NonZeroU8, NonZeroUsize, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 39 | + nzint_impl_from! { NonZeroU16, NonZeroU32, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 40 | + nzint_impl_from! { NonZeroU16, NonZeroU64, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 41 | +-nzint_impl_from! { NonZeroU16, NonZeroU128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 42 | ++//nzint_impl_from! { NonZeroU16, NonZeroU128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 43 | + nzint_impl_from! { NonZeroU16, NonZeroUsize, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 44 | + nzint_impl_from! { NonZeroU32, NonZeroU64, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 45 | +-nzint_impl_from! { NonZeroU32, NonZeroU128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 46 | +-nzint_impl_from! { NonZeroU64, NonZeroU128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 47 | ++//nzint_impl_from! { NonZeroU32, NonZeroU128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 48 | ++//nzint_impl_from! { NonZeroU64, NonZeroU128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 49 | + |
| 50 | + // Non-zero Signed -> Non-zero Signed |
| 51 | + nzint_impl_from! { NonZeroI8, NonZeroI16, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 52 | + nzint_impl_from! { NonZeroI8, NonZeroI32, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 53 | + nzint_impl_from! { NonZeroI8, NonZeroI64, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 54 | +-nzint_impl_from! { NonZeroI8, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 55 | ++//nzint_impl_from! { NonZeroI8, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 56 | + nzint_impl_from! { NonZeroI8, NonZeroIsize, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 57 | + nzint_impl_from! { NonZeroI16, NonZeroI32, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 58 | + nzint_impl_from! { NonZeroI16, NonZeroI64, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 59 | +-nzint_impl_from! { NonZeroI16, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 60 | ++//nzint_impl_from! { NonZeroI16, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 61 | + nzint_impl_from! { NonZeroI16, NonZeroIsize, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 62 | + nzint_impl_from! { NonZeroI32, NonZeroI64, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 63 | +-nzint_impl_from! { NonZeroI32, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 64 | +-nzint_impl_from! { NonZeroI64, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 65 | ++//nzint_impl_from! { NonZeroI32, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 66 | ++//nzint_impl_from! { NonZeroI64, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 67 | + |
| 68 | + // NonZero UnSigned -> Non-zero Signed |
| 69 | + nzint_impl_from! { NonZeroU8, NonZeroI16, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 70 | + nzint_impl_from! { NonZeroU8, NonZeroI32, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 71 | + nzint_impl_from! { NonZeroU8, NonZeroI64, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 72 | +-nzint_impl_from! { NonZeroU8, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 73 | ++//nzint_impl_from! { NonZeroU8, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 74 | + nzint_impl_from! { NonZeroU8, NonZeroIsize, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 75 | + nzint_impl_from! { NonZeroU16, NonZeroI32, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 76 | + nzint_impl_from! { NonZeroU16, NonZeroI64, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 77 | +-nzint_impl_from! { NonZeroU16, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 78 | ++//nzint_impl_from! { NonZeroU16, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 79 | + nzint_impl_from! { NonZeroU32, NonZeroI64, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 80 | +-nzint_impl_from! { NonZeroU32, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 81 | +-nzint_impl_from! { NonZeroU64, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 82 | ++//nzint_impl_from! { NonZeroU32, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 83 | ++//nzint_impl_from! { NonZeroU64, NonZeroI128, #[stable(feature = "nz_int_conv", since = "1.41.0")] } |
| 84 | +diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs |
| 85 | +index 7ba4004..560ea38 100644 |
| 86 | +--- a/src/libcore/num/mod.rs |
| 87 | ++++ b/src/libcore/num/mod.rs |
| 88 | +@@ -122,13 +122,13 @@ nonzero_integers! { |
| 89 | + #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU16(u16); |
| 90 | + #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU32(u32); |
| 91 | + #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU64(u64); |
| 92 | +- #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU128(u128); |
| 93 | ++ //#[stable(feature = "nonzero", since = "1.28.0")] NonZeroU128(u128); |
| 94 | + #[stable(feature = "nonzero", since = "1.28.0")] NonZeroUsize(usize); |
| 95 | + #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI8(i8); |
| 96 | + #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI16(i16); |
| 97 | + #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI32(i32); |
| 98 | + #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI64(i64); |
| 99 | +- #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI128(i128); |
| 100 | ++ //#[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI128(i128); |
| 101 | + #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroIsize(isize); |
| 102 | + } |
| 103 | + |
| 104 | +@@ -147,8 +147,8 @@ macro_rules! from_str_radix_nzint_impl { |
| 105 | + )*} |
| 106 | + } |
| 107 | + |
| 108 | +-from_str_radix_nzint_impl! { NonZeroU8 NonZeroU16 NonZeroU32 NonZeroU64 NonZeroU128 NonZeroUsize |
| 109 | +-NonZeroI8 NonZeroI16 NonZeroI32 NonZeroI64 NonZeroI128 NonZeroIsize } |
| 110 | ++from_str_radix_nzint_impl! { NonZeroU8 NonZeroU16 NonZeroU32 NonZeroU64 NonZeroUsize |
| 111 | ++NonZeroI8 NonZeroI16 NonZeroI32 NonZeroI64 NonZeroIsize } |
| 112 | + |
| 113 | + /// Provides intentionally-wrapped arithmetic on `T`. |
| 114 | + /// |
| 115 | +diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs |
| 116 | +index 220f221..134d8b1 100644 |
| 117 | +--- a/src/libcore/sync/atomic.rs |
| 118 | ++++ b/src/libcore/sync/atomic.rs |
| 119 | +@@ -2152,7 +2152,7 @@ atomic_int! { |
| 120 | + "AtomicU64::new(0)", |
| 121 | + u64 AtomicU64 ATOMIC_U64_INIT |
| 122 | + } |
| 123 | +-#[cfg(target_has_atomic_load_store = "128")] |
| 124 | ++/*#[cfg(target_has_atomic_load_store = "128")] |
| 125 | + atomic_int! { |
| 126 | + cfg(target_has_atomic = "128"), |
| 127 | + unstable(feature = "integer_atomics", issue = "32976"), |
| 128 | +@@ -2187,7 +2187,7 @@ atomic_int! { |
| 129 | + 16, |
| 130 | + "AtomicU128::new(0)", |
| 131 | + u128 AtomicU128 ATOMIC_U128_INIT |
| 132 | +-} |
| 133 | ++}*/ |
| 134 | + #[cfg(target_has_atomic_load_store = "ptr")] |
| 135 | + #[cfg(target_pointer_width = "16")] |
| 136 | + macro_rules! ptr_width { |
| 137 | +-- |
| 138 | +2.20.1 |
| 139 | + |
0 commit comments