Skip to content

Commit 6cc81aa

Browse files
committed
Disable operations on 128-bit numbers, to work around
avr-rust/rust-legacy-fork#37 and avr-rust/rust-legacy-fork#57
1 parent 42b89ec commit 6cc81aa

File tree

5 files changed

+3
-31
lines changed

5 files changed

+3
-31
lines changed

src/fmt/num.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ trait Int: PartialEq + PartialOrd + Div<Output=Self> + Rem<Output=Self> +
3030
fn to_u16(&self) -> u16;
3131
fn to_u32(&self) -> u32;
3232
fn to_u64(&self) -> u64;
33-
fn to_u128(&self) -> u128;
3433
}
3534

3635
macro_rules! doit {
@@ -41,10 +40,9 @@ macro_rules! doit {
4140
fn to_u16(&self) -> u16 { *self as u16 }
4241
fn to_u32(&self) -> u32 { *self as u32 }
4342
fn to_u64(&self) -> u64 { *self as u64 }
44-
fn to_u128(&self) -> u128 { *self as u128 }
4543
})*)
4644
}
47-
doit! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
45+
doit! { i8 i16 i32 i64 isize u8 u16 u32 u64 usize }
4846

4947
/// A type that represents a specific radix
5048
#[doc(hidden)]
@@ -185,7 +183,6 @@ integer! { i8, u8 }
185183
integer! { i16, u16 }
186184
integer! { i32, u32 }
187185
integer! { i64, u64 }
188-
integer! { i128, u128 }
189186

190187
const DEC_DIGITS_LUT: &'static[u8] =
191188
b"0001020304050607080910111213141516171819\
@@ -261,7 +258,6 @@ macro_rules! impl_Display {
261258

262259
impl_Display!(i8, u8, i16, u16, i32, u32: to_u32);
263260
impl_Display!(i64, u64: to_u64);
264-
impl_Display!(i128, u128: to_u128);
265261
#[cfg(target_pointer_width = "16")]
266262
impl_Display!(isize, usize: to_u16);
267263
#[cfg(target_pointer_width = "32")]

src/iter/range.rs

-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ step_impl_signed!(i64);
242242
// assume here that it is less than 64-bits.
243243
#[cfg(not(target_pointer_width = "64"))]
244244
step_impl_no_between!(u64 i64);
245-
step_impl_no_between!(u128 i128);
246245

247246
/// An adapter for stepping range iterators by a custom amount.
248247
///

src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,12 @@ mod uint_macros;
121121
#[path = "num/i16.rs"] pub mod i16;
122122
#[path = "num/i32.rs"] pub mod i32;
123123
#[path = "num/i64.rs"] pub mod i64;
124-
#[path = "num/i128.rs"] pub mod i128;
125124

126125
#[path = "num/usize.rs"] pub mod usize;
127126
#[path = "num/u8.rs"] pub mod u8;
128127
#[path = "num/u16.rs"] pub mod u16;
129128
#[path = "num/u32.rs"] pub mod u32;
130129
#[path = "num/u64.rs"] pub mod u64;
131-
#[path = "num/u128.rs"] pub mod u128;
132-
133130

134131
#[macro_use]
135132
pub mod num;

src/num/mod.rs

+1-21
Original file line numberDiff line numberDiff line change
@@ -1266,14 +1266,6 @@ impl i64 {
12661266
intrinsics::mul_with_overflow }
12671267
}
12681268

1269-
#[lang = "i128"]
1270-
impl i128 {
1271-
int_impl! { i128, i128, u128, 128,
1272-
intrinsics::add_with_overflow,
1273-
intrinsics::sub_with_overflow,
1274-
intrinsics::mul_with_overflow }
1275-
}
1276-
12771269
#[cfg(target_pointer_width = "16")]
12781270
#[lang = "isize"]
12791271
impl isize {
@@ -2347,18 +2339,6 @@ impl u64 {
23472339
intrinsics::mul_with_overflow }
23482340
}
23492341

2350-
#[lang = "u128"]
2351-
impl u128 {
2352-
uint_impl! { u128, u128, 128,
2353-
intrinsics::ctpop,
2354-
intrinsics::ctlz,
2355-
intrinsics::cttz,
2356-
intrinsics::bswap,
2357-
intrinsics::add_with_overflow,
2358-
intrinsics::sub_with_overflow,
2359-
intrinsics::mul_with_overflow }
2360-
}
2361-
23622342
#[cfg(target_pointer_width = "16")]
23632343
#[lang = "usize"]
23642344
impl usize {
@@ -2642,7 +2622,7 @@ macro_rules! doit {
26422622
}
26432623
})*)
26442624
}
2645-
doit! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
2625+
doit! { i8 i16 i32 isize u8 u16 u32 usize }
26462626

26472627
fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, ParseIntError> {
26482628
use self::IntErrorKind::*;

src/num/wrapping.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ macro_rules! wrapping_impl {
307307
)*)
308308
}
309309

310-
wrapping_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
310+
wrapping_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
311311

312312
mod shift_max {
313313
#![allow(non_upper_case_globals)]

0 commit comments

Comments
 (0)