1 From d723688cb9f94c7c90617eb96b1d64fd968a02c3 Mon Sep 17 00:00:00 2001
2 From: bjorn3 <bjorn3@users.noreply.github.com>
3 Date: Sat, 2 Feb 2019 11:30:28 +0100
4 Subject: [PATCH] Disable u128 and i128 in libcore
7 src/libcore/clone.rs | 4 +-
8 src/libcore/cmp.rs | 6 +-
9 src/libcore/default.rs | 2 -
10 src/libcore/fmt/num.rs | 6 +-
11 src/libcore/hash/mod.rs | 20 -------
12 src/libcore/iter/range.rs | 1 -
13 src/libcore/iter/traits/accum.rs | 2 +-
14 src/libcore/lib.rs | 2 -
15 src/libcore/marker.rs | 4 +-
16 src/libcore/mem.rs | 2 -
17 src/libcore/num/mod.rs | 100 +++++++++----------------------
18 src/libcore/num/wrapping.rs | 14 ++---
19 src/libcore/ops/arith.rs | 22 +++----
20 src/libcore/ops/bit.rs | 30 ++++------
21 src/libcore/sync/atomic.rs | 30 ----------
22 src/libcore/tests/iter.rs | 15 -----
23 src/libcore/tests/num/mod.rs | 18 ------
24 src/libcore/time.rs | 123 ---------------------------------------
25 src/libstd/lib.rs | 4 --
26 src/libstd/net/ip.rs | 20 -------
27 src/libstd/num.rs | 2 +-
28 src/libstd/panic.rs | 6 --
29 22 files changed, 63 insertions(+), 370 deletions(-)
31 diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs
32 index ed90b7d..1739f91 100644
33 --- a/src/libcore/clone.rs
34 +++ b/src/libcore/clone.rs
35 @@ -173,8 +173,8 @@ mod impls {
39 - usize u8 u16 u32 u64 u128
40 - isize i8 i16 i32 i64 i128
41 + usize u8 u16 u32 u64
42 + isize i8 i16 i32 i64
46 diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs
47 index d43a5c1..268e5f1 100644
48 --- a/src/libcore/cmp.rs
49 +++ b/src/libcore/cmp.rs
50 @@ -876,7 +876,7 @@ mod impls {
54 - bool char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64
55 + bool char usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64
58 macro_rules! eq_impl {
59 @@ -886,7 +886,7 @@ mod impls {
63 - eq_impl! { () bool char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
64 + eq_impl! { () bool char usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
66 macro_rules! partial_ord_impl {
68 @@ -975,7 +975,7 @@ mod impls {
72 - ord_impl! { char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
73 + ord_impl! { char usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
75 #[unstable(feature = "never_type", issue = "35121")]
76 impl PartialEq for ! {
77 diff --git a/src/libcore/default.rs b/src/libcore/default.rs
78 index 0e47c2f..570b949 100644
79 --- a/src/libcore/default.rs
80 +++ b/src/libcore/default.rs
81 @@ -135,14 +135,12 @@ default_impl! { u8, 0, "Returns the default value of `0`" }
82 default_impl! { u16, 0, "Returns the default value of `0`" }
83 default_impl! { u32, 0, "Returns the default value of `0`" }
84 default_impl! { u64, 0, "Returns the default value of `0`" }
85 -default_impl! { u128, 0, "Returns the default value of `0`" }
87 default_impl! { isize, 0, "Returns the default value of `0`" }
88 default_impl! { i8, 0, "Returns the default value of `0`" }
89 default_impl! { i16, 0, "Returns the default value of `0`" }
90 default_impl! { i32, 0, "Returns the default value of `0`" }
91 default_impl! { i64, 0, "Returns the default value of `0`" }
92 -default_impl! { i128, 0, "Returns the default value of `0`" }
94 default_impl! { f32, 0.0f32, "Returns the default value of `0.0`" }
95 default_impl! { f64, 0.0f64, "Returns the default value of `0.0`" }
96 diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs
97 index 3a81233..f889d57 100644
98 --- a/src/libcore/fmt/num.rs
99 +++ b/src/libcore/fmt/num.rs
100 @@ -17,7 +17,6 @@ trait Int: PartialEq + PartialOrd + Div<Output=Self> + Rem<Output=Self> +
101 fn to_u16(&self) -> u16;
102 fn to_u32(&self) -> u32;
103 fn to_u64(&self) -> u64;
104 - fn to_u128(&self) -> u128;
108 @@ -28,10 +27,9 @@ macro_rules! doit {
109 fn to_u16(&self) -> u16 { *self as u16 }
110 fn to_u32(&self) -> u32 { *self as u32 }
111 fn to_u64(&self) -> u64 { *self as u64 }
112 - fn to_u128(&self) -> u128 { *self as u128 }
115 -doit! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
116 +doit! { i8 i16 i32 i64 isize u8 u16 u32 u64 usize }
118 /// A type that represents a specific radix
120 @@ -176,7 +174,6 @@ integer! { i8, u8 }
121 integer! { i16, u16 }
122 integer! { i32, u32 }
123 integer! { i64, u64 }
124 -integer! { i128, u128 }
126 const DEC_DIGITS_LUT: &'static[u8] =
127 b"0001020304050607080910111213141516171819\
128 @@ -252,7 +249,6 @@ macro_rules! impl_Display {
130 impl_Display!(i8, u8, i16, u16, i32, u32: to_u32);
131 impl_Display!(i64, u64: to_u64);
132 -impl_Display!(i128, u128: to_u128);
133 #[cfg(target_pointer_width = "16")]
134 impl_Display!(isize, usize: to_u16);
135 #[cfg(target_pointer_width = "32")]
136 diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs
137 index d5d29c9..f98f382 100644
138 --- a/src/libcore/hash/mod.rs
139 +++ b/src/libcore/hash/mod.rs
140 @@ -296,12 +296,6 @@ pub trait Hasher {
141 fn write_u64(&mut self, i: u64) {
142 self.write(&unsafe { mem::transmute::<_, [u8; 8]>(i) })
144 - /// Writes a single `u128` into this hasher.
146 - #[stable(feature = "i128", since = "1.26.0")]
147 - fn write_u128(&mut self, i: u128) {
148 - self.write(&unsafe { mem::transmute::<_, [u8; 16]>(i) })
150 /// Writes a single `usize` into this hasher.
152 #[stable(feature = "hasher_write", since = "1.3.0")]
153 @@ -336,12 +330,6 @@ pub trait Hasher {
154 fn write_i64(&mut self, i: i64) {
155 self.write_u64(i as u64)
157 - /// Writes a single `i128` into this hasher.
159 - #[stable(feature = "i128", since = "1.26.0")]
160 - fn write_i128(&mut self, i: i128) {
161 - self.write_u128(i as u128)
163 /// Writes a single `isize` into this hasher.
165 #[stable(feature = "hasher_write", since = "1.3.0")]
166 @@ -370,9 +358,6 @@ impl<H: Hasher + ?Sized> Hasher for &mut H {
167 fn write_u64(&mut self, i: u64) {
168 (**self).write_u64(i)
170 - fn write_u128(&mut self, i: u128) {
171 - (**self).write_u128(i)
173 fn write_usize(&mut self, i: usize) {
174 (**self).write_usize(i)
176 @@ -388,9 +373,6 @@ impl<H: Hasher + ?Sized> Hasher for &mut H {
177 fn write_i64(&mut self, i: i64) {
178 (**self).write_i64(i)
180 - fn write_i128(&mut self, i: i128) {
181 - (**self).write_i128(i)
183 fn write_isize(&mut self, i: isize) {
184 (**self).write_isize(i)
186 @@ -577,8 +559,6 @@ mod impls {
189 (isize, write_isize),
190 - (u128, write_u128),
191 - (i128, write_i128),
194 #[stable(feature = "rust1", since = "1.0.0")]
195 diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs
196 index 66c09a0..1b8c5c9 100644
197 --- a/src/libcore/iter/range.rs
198 +++ b/src/libcore/iter/range.rs
199 @@ -173,7 +173,6 @@ step_impl_signed!([i64: u64]);
200 // assume here that it is less than 64-bits.
201 #[cfg(not(target_pointer_width = "64"))]
202 step_impl_no_between!(u64 i64);
203 -step_impl_no_between!(u128 i128);
205 macro_rules! range_exact_iter_impl {
207 diff --git a/src/libcore/iter/traits/accum.rs b/src/libcore/iter/traits/accum.rs
208 index dfe1d2a..06cc578 100644
209 --- a/src/libcore/iter/traits/accum.rs
210 +++ b/src/libcore/iter/traits/accum.rs
211 @@ -111,7 +111,7 @@ macro_rules! float_sum_product {
215 -integer_sum_product! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
216 +integer_sum_product! { i8 i16 i32 i64 isize u8 u16 u32 u64 usize }
217 float_sum_product! { f32 f64 }
219 /// An iterator adapter that produces output as long as the underlying
220 diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
221 index 97b07aa..9e1e9a6 100644
222 --- a/src/libcore/lib.rs
223 +++ b/src/libcore/lib.rs
224 @@ -149,14 +149,12 @@ mod uint_macros;
225 #[path = "num/i16.rs"] pub mod i16;
226 #[path = "num/i32.rs"] pub mod i32;
227 #[path = "num/i64.rs"] pub mod i64;
228 -#[path = "num/i128.rs"] pub mod i128;
230 #[path = "num/usize.rs"] pub mod usize;
231 #[path = "num/u8.rs"] pub mod u8;
232 #[path = "num/u16.rs"] pub mod u16;
233 #[path = "num/u32.rs"] pub mod u32;
234 #[path = "num/u64.rs"] pub mod u64;
235 -#[path = "num/u128.rs"] pub mod u128;
237 #[path = "num/f32.rs"] pub mod f32;
238 #[path = "num/f64.rs"] pub mod f64;
239 diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
240 index 457d556..91425fb 100644
241 --- a/src/libcore/marker.rs
242 +++ b/src/libcore/marker.rs
243 @@ -664,8 +664,8 @@ mod copy_impls {
247 - usize u8 u16 u32 u64 u128
248 - isize i8 i16 i32 i64 i128
249 + usize u8 u16 u32 u64
250 + isize i8 i16 i32 i64
254 diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs
255 index 8b6d9d8..8023dc1 100644
256 --- a/src/libcore/mem.rs
257 +++ b/src/libcore/mem.rs
258 @@ -163,12 +163,10 @@ pub fn forget_unsized<T: ?Sized>(t: T) {
271 diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
272 index f80f839..eed1241 100644
273 --- a/src/libcore/num/mod.rs
274 +++ b/src/libcore/num/mod.rs
275 @@ -102,13 +102,11 @@ nonzero_integers! {
276 #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU16(u16);
277 #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU32(u32);
278 #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU64(u64);
279 - #[stable(feature = "nonzero", since = "1.28.0")] NonZeroU128(u128);
280 #[stable(feature = "nonzero", since = "1.28.0")] NonZeroUsize(usize);
281 #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI8(i8);
282 #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI16(i16);
283 #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI32(i32);
284 #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI64(i64);
285 - #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroI128(i128);
286 #[stable(feature = "signed_nonzero", since = "1.34.0")] NonZeroIsize(isize);
289 @@ -2084,18 +2082,6 @@ impl i64 {
290 "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]" }
295 - int_impl! { i128, i128, u128, 128, -170141183460469231731687303715884105728,
296 - 170141183460469231731687303715884105727, "", "", 16,
297 - "0x13f40000000000000000000000004f76", "0x4f7613f4", "0x12345678901234567890123456789012",
298 - "0x12907856341290785634129078563412", "0x48091e6a2c48091e6a2c48091e6a2c48",
299 - "[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, \
300 - 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
301 - "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, \
302 - 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]" }
305 #[cfg(target_pointer_width = "16")]
308 @@ -4336,17 +4322,6 @@ impl u64 {
309 "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]" }
314 - uint_impl! { u128, u128, 128, 340282366920938463463374607431768211455, "", "", 16,
315 - "0x13f40000000000000000000000004f76", "0x4f7613f4", "0x12345678901234567890123456789012",
316 - "0x12907856341290785634129078563412", "0x48091e6a2c48091e6a2c48091e6a2c48",
317 - "[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, \
318 - 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
319 - "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, \
320 - 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]" }
323 #[cfg(target_pointer_width = "16")]
326 @@ -4430,7 +4405,7 @@ macro_rules! from_str_radix_int_impl {
330 -from_str_radix_int_impl! { isize i8 i16 i32 i64 i128 usize u8 u16 u32 u64 u128 }
331 +from_str_radix_int_impl! { isize i8 i16 i32 i64 usize u8 u16 u32 u64 }
333 /// The error type returned when a checked integral type conversion fails.
334 #[unstable(feature = "try_from", issue = "33417")]
335 @@ -4546,30 +4521,25 @@ macro_rules! rev {
336 try_from_upper_bounded!(u16, u8);
337 try_from_upper_bounded!(u32, u16, u8);
338 try_from_upper_bounded!(u64, u32, u16, u8);
339 -try_from_upper_bounded!(u128, u64, u32, u16, u8);
341 try_from_both_bounded!(i16, i8);
342 try_from_both_bounded!(i32, i16, i8);
343 try_from_both_bounded!(i64, i32, i16, i8);
344 -try_from_both_bounded!(i128, i64, i32, i16, i8);
346 // unsigned-to-signed
347 try_from_upper_bounded!(u8, i8);
348 try_from_upper_bounded!(u16, i8, i16);
349 try_from_upper_bounded!(u32, i8, i16, i32);
350 try_from_upper_bounded!(u64, i8, i16, i32, i64);
351 -try_from_upper_bounded!(u128, i8, i16, i32, i64, i128);
353 // signed-to-unsigned
354 -try_from_lower_bounded!(i8, u8, u16, u32, u64, u128);
355 -try_from_lower_bounded!(i16, u16, u32, u64, u128);
356 -try_from_lower_bounded!(i32, u32, u64, u128);
357 -try_from_lower_bounded!(i64, u64, u128);
358 -try_from_lower_bounded!(i128, u128);
359 +try_from_lower_bounded!(i8, u8, u16, u32, u64);
360 +try_from_lower_bounded!(i16, u16, u32, u64);
361 +try_from_lower_bounded!(i32, u32, u64);
362 +try_from_lower_bounded!(i64, u64);
363 try_from_both_bounded!(i16, u8);
364 try_from_both_bounded!(i32, u16, u8);
365 try_from_both_bounded!(i64, u32, u16, u8);
366 -try_from_both_bounded!(i128, u64, u32, u16, u8);
369 try_from_upper_bounded!(usize, isize);
370 @@ -4581,21 +4551,21 @@ mod ptr_try_from_impls {
371 use convert::TryFrom;
373 try_from_upper_bounded!(usize, u8);
374 - try_from_unbounded!(usize, u16, u32, u64, u128);
375 + try_from_unbounded!(usize, u16, u32, u64);
376 try_from_upper_bounded!(usize, i8, i16);
377 - try_from_unbounded!(usize, i32, i64, i128);
378 + try_from_unbounded!(usize, i32, i64);
380 try_from_both_bounded!(isize, u8);
381 - try_from_lower_bounded!(isize, u16, u32, u64, u128);
382 + try_from_lower_bounded!(isize, u16, u32, u64);
383 try_from_both_bounded!(isize, i8);
384 - try_from_unbounded!(isize, i16, i32, i64, i128);
385 + try_from_unbounded!(isize, i16, i32, i64);
387 - rev!(try_from_upper_bounded, usize, u32, u64, u128);
388 + rev!(try_from_upper_bounded, usize, u32, u64);
389 rev!(try_from_lower_bounded, usize, i8, i16);
390 - rev!(try_from_both_bounded, usize, i32, i64, i128);
391 + rev!(try_from_both_bounded, usize, i32, i64);
393 - rev!(try_from_upper_bounded, isize, u16, u32, u64, u128);
394 - rev!(try_from_both_bounded, isize, i32, i64, i128);
395 + rev!(try_from_upper_bounded, isize, u16, u32, u64);
396 + rev!(try_from_both_bounded, isize, i32, i64);
399 #[cfg(target_pointer_width = "32")]
400 @@ -4604,24 +4574,24 @@ mod ptr_try_from_impls {
401 use convert::TryFrom;
403 try_from_upper_bounded!(usize, u8, u16);
404 - try_from_unbounded!(usize, u32, u64, u128);
405 + try_from_unbounded!(usize, u32, u64);
406 try_from_upper_bounded!(usize, i8, i16, i32);
407 - try_from_unbounded!(usize, i64, i128);
408 + try_from_unbounded!(usize, i64);
410 try_from_both_bounded!(isize, u8, u16);
411 - try_from_lower_bounded!(isize, u32, u64, u128);
412 + try_from_lower_bounded!(isize, u32, u64);
413 try_from_both_bounded!(isize, i8, i16);
414 - try_from_unbounded!(isize, i32, i64, i128);
415 + try_from_unbounded!(isize, i32, i64);
417 rev!(try_from_unbounded, usize, u32);
418 - rev!(try_from_upper_bounded, usize, u64, u128);
419 + rev!(try_from_upper_bounded, usize, u64);
420 rev!(try_from_lower_bounded, usize, i8, i16, i32);
421 - rev!(try_from_both_bounded, usize, i64, i128);
422 + rev!(try_from_both_bounded, usize, i64);
424 rev!(try_from_unbounded, isize, u16);
425 - rev!(try_from_upper_bounded, isize, u32, u64, u128);
426 + rev!(try_from_upper_bounded, isize, u32, u64);
427 rev!(try_from_unbounded, isize, i32);
428 - rev!(try_from_both_bounded, isize, i64, i128);
429 + rev!(try_from_both_bounded, isize, i64);
432 #[cfg(target_pointer_width = "64")]
433 @@ -4630,24 +4600,20 @@ mod ptr_try_from_impls {
434 use convert::TryFrom;
436 try_from_upper_bounded!(usize, u8, u16, u32);
437 - try_from_unbounded!(usize, u64, u128);
438 + try_from_unbounded!(usize, u64);
439 try_from_upper_bounded!(usize, i8, i16, i32, i64);
440 - try_from_unbounded!(usize, i128);
442 try_from_both_bounded!(isize, u8, u16, u32);
443 - try_from_lower_bounded!(isize, u64, u128);
444 + try_from_lower_bounded!(isize, u64);
445 try_from_both_bounded!(isize, i8, i16, i32);
446 - try_from_unbounded!(isize, i64, i128);
447 + try_from_unbounded!(isize, i64);
449 rev!(try_from_unbounded, usize, u32, u64);
450 - rev!(try_from_upper_bounded, usize, u128);
451 rev!(try_from_lower_bounded, usize, i8, i16, i32, i64);
452 - rev!(try_from_both_bounded, usize, i128);
454 rev!(try_from_unbounded, isize, u16, u32);
455 - rev!(try_from_upper_bounded, isize, u64, u128);
456 + rev!(try_from_upper_bounded, isize, u64);
457 rev!(try_from_unbounded, isize, i32, i64);
458 - rev!(try_from_both_bounded, isize, i128);
462 @@ -4682,7 +4648,7 @@ macro_rules! doit {
466 -doit! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
467 +doit! { i8 i16 i32 i64 isize u8 u16 u32 u64 usize }
469 fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, ParseIntError> {
470 use self::IntErrorKind::*;
471 @@ -4873,52 +4839,38 @@ impl_from_bool! { u8, #[stable(feature = "from_bool", since = "1.28.0")] }
472 impl_from_bool! { u16, #[stable(feature = "from_bool", since = "1.28.0")] }
473 impl_from_bool! { u32, #[stable(feature = "from_bool", since = "1.28.0")] }
474 impl_from_bool! { u64, #[stable(feature = "from_bool", since = "1.28.0")] }
475 -impl_from_bool! { u128, #[stable(feature = "from_bool", since = "1.28.0")] }
476 impl_from_bool! { usize, #[stable(feature = "from_bool", since = "1.28.0")] }
477 impl_from_bool! { i8, #[stable(feature = "from_bool", since = "1.28.0")] }
478 impl_from_bool! { i16, #[stable(feature = "from_bool", since = "1.28.0")] }
479 impl_from_bool! { i32, #[stable(feature = "from_bool", since = "1.28.0")] }
480 impl_from_bool! { i64, #[stable(feature = "from_bool", since = "1.28.0")] }
481 -impl_from_bool! { i128, #[stable(feature = "from_bool", since = "1.28.0")] }
482 impl_from_bool! { isize, #[stable(feature = "from_bool", since = "1.28.0")] }
484 // Unsigned -> Unsigned
485 impl_from! { u8, u16, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
486 impl_from! { u8, u32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
487 impl_from! { u8, u64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
488 -impl_from! { u8, u128, #[stable(feature = "i128", since = "1.26.0")] }
489 impl_from! { u8, usize, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
490 impl_from! { u16, u32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
491 impl_from! { u16, u64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
492 -impl_from! { u16, u128, #[stable(feature = "i128", since = "1.26.0")] }
493 impl_from! { u32, u64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
494 -impl_from! { u32, u128, #[stable(feature = "i128", since = "1.26.0")] }
495 -impl_from! { u64, u128, #[stable(feature = "i128", since = "1.26.0")] }
498 impl_from! { i8, i16, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
499 impl_from! { i8, i32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
500 impl_from! { i8, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
501 -impl_from! { i8, i128, #[stable(feature = "i128", since = "1.26.0")] }
502 impl_from! { i8, isize, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
503 impl_from! { i16, i32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
504 impl_from! { i16, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
505 -impl_from! { i16, i128, #[stable(feature = "i128", since = "1.26.0")] }
506 impl_from! { i32, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
507 -impl_from! { i32, i128, #[stable(feature = "i128", since = "1.26.0")] }
508 -impl_from! { i64, i128, #[stable(feature = "i128", since = "1.26.0")] }
510 // Unsigned -> Signed
511 impl_from! { u8, i16, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
512 impl_from! { u8, i32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
513 impl_from! { u8, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
514 -impl_from! { u8, i128, #[stable(feature = "i128", since = "1.26.0")] }
515 impl_from! { u16, i32, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
516 impl_from! { u16, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
517 -impl_from! { u16, i128, #[stable(feature = "i128", since = "1.26.0")] }
518 impl_from! { u32, i64, #[stable(feature = "lossless_int_conv", since = "1.5.0")] }
519 -impl_from! { u32, i128, #[stable(feature = "i128", since = "1.26.0")] }
520 -impl_from! { u64, i128, #[stable(feature = "i128", since = "1.26.0")] }
522 // The C99 standard defines bounds on INTPTR_MIN, INTPTR_MAX, and UINTPTR_MAX
523 // which imply that pointer-sized integers must be at least 16 bits:
524 diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs
525 index 50e189c..2da3b35 100644
526 --- a/src/libcore/num/wrapping.rs
527 +++ b/src/libcore/num/wrapping.rs
528 @@ -102,19 +102,17 @@ macro_rules! sh_impl_all {
529 //sh_impl_unsigned! { $t, u16 }
530 //sh_impl_unsigned! { $t, u32 }
531 //sh_impl_unsigned! { $t, u64 }
532 - //sh_impl_unsigned! { $t, u128 }
533 sh_impl_unsigned! { $t, usize }
535 //sh_impl_signed! { $t, i8 }
536 //sh_impl_signed! { $t, i16 }
537 //sh_impl_signed! { $t, i32 }
538 //sh_impl_signed! { $t, i64 }
539 - //sh_impl_signed! { $t, i128 }
540 //sh_impl_signed! { $t, isize }
544 -sh_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
545 +sh_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
547 // FIXME(30524): impl Op<T> for Wrapping<T>, impl OpAssign<T> for Wrapping<T>
548 macro_rules! wrapping_impl {
549 @@ -313,7 +311,7 @@ macro_rules! wrapping_impl {
553 -wrapping_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
554 +wrapping_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
556 macro_rules! wrapping_int_impl {
558 @@ -675,7 +673,7 @@ assert_eq!(Wrapping(3i8).pow(6), Wrapping(-39));
562 -wrapping_int_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
563 +wrapping_int_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
565 macro_rules! wrapping_int_impl_signed {
567 @@ -804,7 +802,7 @@ assert!(!Wrapping(10", stringify!($t), ").is_negative());
571 -wrapping_int_impl_signed! { isize i8 i16 i32 i64 i128 }
572 +wrapping_int_impl_signed! { isize i8 i16 i32 i64 }
574 macro_rules! wrapping_int_impl_unsigned {
576 @@ -881,7 +879,7 @@ assert_eq!(Wrapping(200_u8).next_power_of_two(), Wrapping(0));
580 -wrapping_int_impl_unsigned! { usize u8 u16 u32 u64 u128 }
581 +wrapping_int_impl_unsigned! { usize u8 u16 u32 u64 }
584 #![allow(non_upper_case_globals)]
585 @@ -908,13 +906,11 @@ mod shift_max {
586 pub const i16: u32 = (1 << 4) - 1;
587 pub const i32: u32 = (1 << 5) - 1;
588 pub const i64: u32 = (1 << 6) - 1;
589 - pub const i128: u32 = (1 << 7) - 1;
590 pub use self::platform::isize;
592 pub const u8: u32 = i8;
593 pub const u16: u32 = i16;
594 pub const u32: u32 = i32;
595 pub const u64: u32 = i64;
596 - pub const u128: u32 = i128;
597 pub use self::platform::usize;
599 diff --git a/src/libcore/ops/arith.rs b/src/libcore/ops/arith.rs
600 index 7d8bf18..91fd879 100644
601 --- a/src/libcore/ops/arith.rs
602 +++ b/src/libcore/ops/arith.rs
603 @@ -104,7 +104,7 @@ macro_rules! add_impl {
607 -add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
608 +add_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
610 /// The subtraction operator `-`.
612 @@ -202,7 +202,7 @@ macro_rules! sub_impl {
616 -sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
617 +sub_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
619 /// The multiplication operator `*`.
621 @@ -322,7 +322,7 @@ macro_rules! mul_impl {
625 -mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
626 +mul_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
628 /// The division operator `/`.
630 @@ -447,7 +447,7 @@ macro_rules! div_impl_integer {
634 -div_impl_integer! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
635 +div_impl_integer! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
637 macro_rules! div_impl_float {
639 @@ -532,7 +532,7 @@ macro_rules! rem_impl_integer {
643 -rem_impl_integer! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
644 +rem_impl_integer! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
647 macro_rules! rem_impl_float {
648 @@ -631,7 +631,7 @@ macro_rules! neg_impl_unsigned {
651 // neg_impl_unsigned! { usize u8 u16 u32 u64 }
652 -neg_impl_numeric! { isize i8 i16 i32 i64 i128 f32 f64 }
653 +neg_impl_numeric! { isize i8 i16 i32 i64 f32 f64 }
655 /// The addition assignment operator `+=`.
657 @@ -687,7 +687,7 @@ macro_rules! add_assign_impl {
661 -add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
662 +add_assign_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
664 /// The subtraction assignment operator `-=`.
666 @@ -743,7 +743,7 @@ macro_rules! sub_assign_impl {
670 -sub_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
671 +sub_assign_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
673 /// The multiplication assignment operator `*=`.
675 @@ -790,7 +790,7 @@ macro_rules! mul_assign_impl {
679 -mul_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
680 +mul_assign_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
682 /// The division assignment operator `/=`.
684 @@ -836,7 +836,7 @@ macro_rules! div_assign_impl {
688 -div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
689 +div_assign_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
691 /// The remainder assignment operator `%=`.
693 @@ -886,4 +886,4 @@ macro_rules! rem_assign_impl {
697 -rem_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
698 +rem_assign_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
699 diff --git a/src/libcore/ops/bit.rs b/src/libcore/ops/bit.rs
700 index 2c9bf24..af2ab6f 100644
701 --- a/src/libcore/ops/bit.rs
702 +++ b/src/libcore/ops/bit.rs
703 @@ -55,7 +55,7 @@ macro_rules! not_impl {
707 -not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
708 +not_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
710 /// The bitwise AND operator `&`.
712 @@ -139,7 +139,7 @@ macro_rules! bitand_impl {
716 -bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
717 +bitand_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
719 /// The bitwise OR operator `|`.
721 @@ -223,7 +223,7 @@ macro_rules! bitor_impl {
725 -bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
726 +bitor_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
728 /// The bitwise XOR operator `^`.
730 @@ -310,7 +310,7 @@ macro_rules! bitxor_impl {
734 -bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
735 +bitxor_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
737 /// The left shift operator `<<`. Note that because this trait is implemented
738 /// for all integer types with multiple right-hand-side types, Rust's type
739 @@ -407,19 +407,17 @@ macro_rules! shl_impl_all {
740 shl_impl! { $t, u16 }
741 shl_impl! { $t, u32 }
742 shl_impl! { $t, u64 }
743 - shl_impl! { $t, u128 }
744 shl_impl! { $t, usize }
747 shl_impl! { $t, i16 }
748 shl_impl! { $t, i32 }
749 shl_impl! { $t, i64 }
750 - shl_impl! { $t, i128 }
751 shl_impl! { $t, isize }
755 -shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }
756 +shl_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
758 /// The right shift operator `>>`. Note that because this trait is implemented
759 /// for all integer types with multiple right-hand-side types, Rust's type
760 @@ -516,19 +514,17 @@ macro_rules! shr_impl_all {
761 shr_impl! { $t, u16 }
762 shr_impl! { $t, u32 }
763 shr_impl! { $t, u64 }
764 - shr_impl! { $t, u128 }
765 shr_impl! { $t, usize }
768 shr_impl! { $t, i16 }
769 shr_impl! { $t, i32 }
770 shr_impl! { $t, i64 }
771 - shr_impl! { $t, i128 }
772 shr_impl! { $t, isize }
776 -shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
777 +shr_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
779 /// The bitwise AND assignment operator `&=`.
781 @@ -616,7 +612,7 @@ macro_rules! bitand_assign_impl {
785 -bitand_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
786 +bitand_assign_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
788 /// The bitwise OR assignment operator `|=`.
790 @@ -665,7 +661,7 @@ macro_rules! bitor_assign_impl {
794 -bitor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
795 +bitor_assign_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
797 /// The bitwise XOR assignment operator `^=`.
799 @@ -714,7 +710,7 @@ macro_rules! bitxor_assign_impl {
803 -bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
804 +bitxor_assign_impl! { bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
806 /// The left shift assignment operator `<<=`.
808 @@ -770,19 +766,17 @@ macro_rules! shl_assign_impl_all {
809 shl_assign_impl! { $t, u16 }
810 shl_assign_impl! { $t, u32 }
811 shl_assign_impl! { $t, u64 }
812 - shl_assign_impl! { $t, u128 }
813 shl_assign_impl! { $t, usize }
815 shl_assign_impl! { $t, i8 }
816 shl_assign_impl! { $t, i16 }
817 shl_assign_impl! { $t, i32 }
818 shl_assign_impl! { $t, i64 }
819 - shl_assign_impl! { $t, i128 }
820 shl_assign_impl! { $t, isize }
824 -shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
825 +shl_assign_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
827 /// The right shift assignment operator `>>=`.
829 @@ -838,16 +832,14 @@ macro_rules! shr_assign_impl_all {
830 shr_assign_impl! { $t, u16 }
831 shr_assign_impl! { $t, u32 }
832 shr_assign_impl! { $t, u64 }
833 - shr_assign_impl! { $t, u128 }
834 shr_assign_impl! { $t, usize }
836 shr_assign_impl! { $t, i8 }
837 shr_assign_impl! { $t, i16 }
838 shr_assign_impl! { $t, i32 }
839 shr_assign_impl! { $t, i64 }
840 - shr_assign_impl! { $t, i128 }
841 shr_assign_impl! { $t, isize }
845 -shr_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
846 +shr_assign_impl_all! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
847 diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
848 index 8c5dde7..8122120 100644
849 --- a/src/libcore/sync/atomic.rs
850 +++ b/src/libcore/sync/atomic.rs
851 @@ -2003,36 +2003,6 @@ atomic_int! {
853 u64 AtomicU64 ATOMIC_U64_INIT
855 -#[cfg(target_has_atomic = "128")]
857 - unstable(feature = "integer_atomics", issue = "32976"),
858 - unstable(feature = "integer_atomics", issue = "32976"),
859 - unstable(feature = "integer_atomics", issue = "32976"),
860 - unstable(feature = "integer_atomics", issue = "32976"),
861 - unstable(feature = "integer_atomics", issue = "32976"),
862 - unstable(feature = "integer_atomics", issue = "32976"),
863 - "i128", "../../../std/primitive.i128.html",
864 - "#![feature(integer_atomics)]\n\n",
865 - atomic_min, atomic_max,
867 - "AtomicI128::new(0)",
868 - i128 AtomicI128 ATOMIC_I128_INIT
870 -#[cfg(target_has_atomic = "128")]
872 - unstable(feature = "integer_atomics", issue = "32976"),
873 - unstable(feature = "integer_atomics", issue = "32976"),
874 - unstable(feature = "integer_atomics", issue = "32976"),
875 - unstable(feature = "integer_atomics", issue = "32976"),
876 - unstable(feature = "integer_atomics", issue = "32976"),
877 - unstable(feature = "integer_atomics", issue = "32976"),
878 - "u128", "../../../std/primitive.u128.html",
879 - "#![feature(integer_atomics)]\n\n",
880 - atomic_umin, atomic_umax,
882 - "AtomicU128::new(0)",
883 - u128 AtomicU128 ATOMIC_U128_INIT
885 #[cfg(target_pointer_width = "16")]
886 macro_rules! ptr_width {
888 diff --git a/src/libcore/tests/iter.rs b/src/libcore/tests/iter.rs
889 index 0fa9974..75b44b1 100644
890 --- a/src/libcore/tests/iter.rs
891 +++ b/src/libcore/tests/iter.rs
892 @@ -215,8 +215,6 @@ fn test_iterator_step_by_nth_overflow() {
894 #[cfg(target_pointer_width = "32")]
896 - #[cfg(target_pointer_width = "64")]
897 - type Bigger = u128;
901 @@ -1969,19 +1967,6 @@ fn test_step_replace_signed() {
905 -fn test_step_replace_no_between() {
907 - let y = x.replace_zero();
912 - let y = x.replace_one();
918 fn test_rev_try_folds() {
919 let f = &|acc, x| i32::checked_add(2*acc, x);
920 assert_eq!((1..10).rev().try_fold(7, f), (1..10).try_rfold(7, f));
921 diff --git a/src/libcore/tests/num/mod.rs b/src/libcore/tests/num/mod.rs
922 index a17c094..3c36d10 100644
923 --- a/src/libcore/tests/num/mod.rs
924 +++ b/src/libcore/tests/num/mod.rs
925 @@ -178,12 +178,10 @@ test_impl_from! { test_boolu8, bool, u8 }
926 test_impl_from! { test_boolu16, bool, u16 }
927 test_impl_from! { test_boolu32, bool, u32 }
928 test_impl_from! { test_boolu64, bool, u64 }
929 -test_impl_from! { test_boolu128, bool, u128 }
930 test_impl_from! { test_booli8, bool, i8 }
931 test_impl_from! { test_booli16, bool, i16 }
932 test_impl_from! { test_booli32, bool, i32 }
933 test_impl_from! { test_booli64, bool, i64 }
934 -test_impl_from! { test_booli128, bool, i128 }
937 test_impl_from! { test_i8f32, i8, f32 }
938 @@ -265,51 +263,35 @@ test_impl_try_from_always_ok! { test_try_u8u8, u8, u8 }
939 test_impl_try_from_always_ok! { test_try_u8u16, u8, u16 }
940 test_impl_try_from_always_ok! { test_try_u8u32, u8, u32 }
941 test_impl_try_from_always_ok! { test_try_u8u64, u8, u64 }
942 -test_impl_try_from_always_ok! { test_try_u8u128, u8, u128 }
943 test_impl_try_from_always_ok! { test_try_u8i16, u8, i16 }
944 test_impl_try_from_always_ok! { test_try_u8i32, u8, i32 }
945 test_impl_try_from_always_ok! { test_try_u8i64, u8, i64 }
946 -test_impl_try_from_always_ok! { test_try_u8i128, u8, i128 }
948 test_impl_try_from_always_ok! { test_try_u16u16, u16, u16 }
949 test_impl_try_from_always_ok! { test_try_u16u32, u16, u32 }
950 test_impl_try_from_always_ok! { test_try_u16u64, u16, u64 }
951 -test_impl_try_from_always_ok! { test_try_u16u128, u16, u128 }
952 test_impl_try_from_always_ok! { test_try_u16i32, u16, i32 }
953 test_impl_try_from_always_ok! { test_try_u16i64, u16, i64 }
954 -test_impl_try_from_always_ok! { test_try_u16i128, u16, i128 }
956 test_impl_try_from_always_ok! { test_try_u32u32, u32, u32 }
957 test_impl_try_from_always_ok! { test_try_u32u64, u32, u64 }
958 -test_impl_try_from_always_ok! { test_try_u32u128, u32, u128 }
959 test_impl_try_from_always_ok! { test_try_u32i64, u32, i64 }
960 -test_impl_try_from_always_ok! { test_try_u32i128, u32, i128 }
962 test_impl_try_from_always_ok! { test_try_u64u64, u64, u64 }
963 -test_impl_try_from_always_ok! { test_try_u64u128, u64, u128 }
964 -test_impl_try_from_always_ok! { test_try_u64i128, u64, i128 }
966 -test_impl_try_from_always_ok! { test_try_u128u128, u128, u128 }
968 test_impl_try_from_always_ok! { test_try_i8i8, i8, i8 }
969 test_impl_try_from_always_ok! { test_try_i8i16, i8, i16 }
970 test_impl_try_from_always_ok! { test_try_i8i32, i8, i32 }
971 test_impl_try_from_always_ok! { test_try_i8i64, i8, i64 }
972 -test_impl_try_from_always_ok! { test_try_i8i128, i8, i128 }
974 test_impl_try_from_always_ok! { test_try_i16i16, i16, i16 }
975 test_impl_try_from_always_ok! { test_try_i16i32, i16, i32 }
976 test_impl_try_from_always_ok! { test_try_i16i64, i16, i64 }
977 -test_impl_try_from_always_ok! { test_try_i16i128, i16, i128 }
979 test_impl_try_from_always_ok! { test_try_i32i32, i32, i32 }
980 test_impl_try_from_always_ok! { test_try_i32i64, i32, i64 }
981 -test_impl_try_from_always_ok! { test_try_i32i128, i32, i128 }
983 test_impl_try_from_always_ok! { test_try_i64i64, i64, i64 }
984 -test_impl_try_from_always_ok! { test_try_i64i128, i64, i128 }
986 -test_impl_try_from_always_ok! { test_try_i128i128, i128, i128 }
988 test_impl_try_from_always_ok! { test_try_usizeusize, usize, usize }
989 test_impl_try_from_always_ok! { test_try_isizeisize, isize, isize }
990 diff --git a/src/libcore/time.rs b/src/libcore/time.rs
991 index a751965..5d162cb 100644
992 --- a/src/libcore/time.rs
993 +++ b/src/libcore/time.rs
994 @@ -21,7 +21,6 @@ const NANOS_PER_MILLI: u32 = 1_000_000;
995 const NANOS_PER_MICRO: u32 = 1_000;
996 const MILLIS_PER_SEC: u64 = 1_000;
997 const MICROS_PER_SEC: u64 = 1_000_000;
998 -const MAX_NANOS_F64: f64 = ((u64::MAX as u128 + 1)*(NANOS_PER_SEC as u128)) as f64;
1000 /// The duration of one second.
1001 #[unstable(feature = "duration_constants", issue = "57391")]
1002 @@ -276,54 +275,6 @@ impl Duration {
1004 pub const fn subsec_nanos(&self) -> u32 { self.nanos }
1006 - /// Returns the total number of whole milliseconds contained by this `Duration`.
1011 - /// use std::time::Duration;
1013 - /// let duration = Duration::new(5, 730023852);
1014 - /// assert_eq!(duration.as_millis(), 5730);
1016 - #[stable(feature = "duration_as_u128", since = "1.33.0")]
1018 - pub const fn as_millis(&self) -> u128 {
1019 - self.secs as u128 * MILLIS_PER_SEC as u128 + (self.nanos / NANOS_PER_MILLI) as u128
1022 - /// Returns the total number of whole microseconds contained by this `Duration`.
1027 - /// use std::time::Duration;
1029 - /// let duration = Duration::new(5, 730023852);
1030 - /// assert_eq!(duration.as_micros(), 5730023);
1032 - #[stable(feature = "duration_as_u128", since = "1.33.0")]
1034 - pub const fn as_micros(&self) -> u128 {
1035 - self.secs as u128 * MICROS_PER_SEC as u128 + (self.nanos / NANOS_PER_MICRO) as u128
1038 - /// Returns the total number of nanoseconds contained by this `Duration`.
1043 - /// use std::time::Duration;
1045 - /// let duration = Duration::new(5, 730023852);
1046 - /// assert_eq!(duration.as_nanos(), 5730023852);
1048 - #[stable(feature = "duration_as_u128", since = "1.33.0")]
1050 - pub const fn as_nanos(&self) -> u128 {
1051 - self.secs as u128 * NANOS_PER_SEC as u128 + self.nanos as u128
1054 /// Checked `Duration` addition. Computes `self + other`, returning [`None`]
1055 /// if overflow occurred.
1057 @@ -482,80 +433,6 @@ impl Duration {
1058 (self.secs as f64) + (self.nanos as f64) / (NANOS_PER_SEC as f64)
1061 - /// Creates a new `Duration` from the specified number of seconds.
1064 - /// This constructor will panic if `secs` is not finite, negative or overflows `Duration`.
1068 - /// #![feature(duration_float)]
1069 - /// use std::time::Duration;
1071 - /// let dur = Duration::from_float_secs(2.7);
1072 - /// assert_eq!(dur, Duration::new(2, 700_000_000));
1074 - #[unstable(feature = "duration_float", issue = "54361")]
1076 - pub fn from_float_secs(secs: f64) -> Duration {
1077 - let nanos = secs * (NANOS_PER_SEC as f64);
1078 - if !nanos.is_finite() {
1079 - panic!("got non-finite value when converting float to duration");
1081 - if nanos >= MAX_NANOS_F64 {
1082 - panic!("overflow when converting float to duration");
1085 - panic!("underflow when converting float to duration");
1087 - let nanos = nanos as u128;
1089 - secs: (nanos / (NANOS_PER_SEC as u128)) as u64,
1090 - nanos: (nanos % (NANOS_PER_SEC as u128)) as u32,
1094 - /// Multiply `Duration` by `f64`.
1097 - /// This method will panic if result is not finite, negative or overflows `Duration`.
1101 - /// #![feature(duration_float)]
1102 - /// use std::time::Duration;
1104 - /// let dur = Duration::new(2, 700_000_000);
1105 - /// assert_eq!(dur.mul_f64(3.14), Duration::new(8, 478_000_000));
1106 - /// assert_eq!(dur.mul_f64(3.14e5), Duration::new(847_800, 0));
1108 - #[unstable(feature = "duration_float", issue = "54361")]
1110 - pub fn mul_f64(self, rhs: f64) -> Duration {
1111 - Duration::from_float_secs(rhs * self.as_float_secs())
1114 - /// Divide `Duration` by `f64`.
1117 - /// This method will panic if result is not finite, negative or overflows `Duration`.
1121 - /// #![feature(duration_float)]
1122 - /// use std::time::Duration;
1124 - /// let dur = Duration::new(2, 700_000_000);
1125 - /// assert_eq!(dur.div_f64(3.14), Duration::new(0, 859_872_611));
1126 - /// // note that truncation is used, not rounding
1127 - /// assert_eq!(dur.div_f64(3.14e5), Duration::new(0, 8_598));
1129 - #[unstable(feature = "duration_float", issue = "54361")]
1131 - pub fn div_f64(self, rhs: f64) -> Duration {
1132 - Duration::from_float_secs(self.as_float_secs() / rhs)
1135 /// Divide `Duration` by `Duration` and return `f64`.
1138 diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
1139 index f269fda..07c3680 100644
1140 --- a/src/libstd/lib.rs
1141 +++ b/src/libstd/lib.rs
1142 @@ -397,8 +397,6 @@ pub use core::i16;
1144 #[stable(feature = "rust1", since = "1.0.0")]
1146 -#[stable(feature = "i128", since = "1.26.0")]
1147 -pub use core::i128;
1148 #[stable(feature = "rust1", since = "1.0.0")]
1149 pub use core::usize;
1150 #[stable(feature = "rust1", since = "1.0.0")]
1151 @@ -431,8 +429,6 @@ pub use alloc_crate::string;
1152 pub use alloc_crate::vec;
1153 #[stable(feature = "rust1", since = "1.0.0")]
1155 -#[stable(feature = "i128", since = "1.26.0")]
1156 -pub use core::u128;
1157 #[stable(feature = "core_hint", since = "1.27.0")]
1160 diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs
1161 index f45cd8b..cf5ba85 100644
1162 --- a/src/libstd/net/ip.rs
1163 +++ b/src/libstd/net/ip.rs
1164 @@ -1381,26 +1381,6 @@ impl FromInner<c::in6_addr> for Ipv6Addr {
1168 -#[stable(feature = "i128", since = "1.26.0")]
1169 -impl From<Ipv6Addr> for u128 {
1170 - fn from(ip: Ipv6Addr) -> u128 {
1171 - let ip = ip.segments();
1172 - ((ip[0] as u128) << 112) + ((ip[1] as u128) << 96) + ((ip[2] as u128) << 80) +
1173 - ((ip[3] as u128) << 64) + ((ip[4] as u128) << 48) + ((ip[5] as u128) << 32) +
1174 - ((ip[6] as u128) << 16) + (ip[7] as u128)
1177 -#[stable(feature = "i128", since = "1.26.0")]
1178 -impl From<u128> for Ipv6Addr {
1179 - fn from(ip: u128) -> Ipv6Addr {
1181 - (ip >> 112) as u16, (ip >> 96) as u16, (ip >> 80) as u16,
1182 - (ip >> 64) as u16, (ip >> 48) as u16, (ip >> 32) as u16,
1183 - (ip >> 16) as u16, ip as u16,
1188 #[stable(feature = "ipv6_from_octets", since = "1.9.0")]
1189 impl From<[u8; 16]> for Ipv6Addr {
1190 fn from(octets: [u8; 16]) -> Ipv6Addr {
1191 diff --git a/src/libstd/num.rs b/src/libstd/num.rs
1192 index c80b9a5..e32a6b3 100644
1193 --- a/src/libstd/num.rs
1194 +++ b/src/libstd/num.rs
1195 @@ -12,7 +12,7 @@ pub use core::num::{FpCategory, ParseIntError, ParseFloatError, TryFromIntError}
1196 pub use core::num::Wrapping;
1198 #[stable(feature = "nonzero", since = "1.28.0")]
1199 -pub use core::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, NonZeroUsize};
1200 +pub use core::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroUsize};
1202 #[cfg(test)] use fmt;
1203 #[cfg(test)] use ops::{Add, Sub, Mul, Div, Rem};
1204 diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs
1205 index d27f6ca..8ac2a44 100644
1206 --- a/src/libstd/panic.rs
1207 +++ b/src/libstd/panic.rs
1208 @@ -254,9 +254,6 @@ impl RefUnwindSafe for atomic::AtomicI32 {}
1209 #[cfg(target_has_atomic = "64")]
1210 #[unstable(feature = "integer_atomics", issue = "32976")]
1211 impl RefUnwindSafe for atomic::AtomicI64 {}
1212 -#[cfg(target_has_atomic = "128")]
1213 -#[unstable(feature = "integer_atomics", issue = "32976")]
1214 -impl RefUnwindSafe for atomic::AtomicI128 {}
1216 #[cfg(target_has_atomic = "ptr")]
1217 #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
1218 @@ -273,9 +270,6 @@ impl RefUnwindSafe for atomic::AtomicU32 {}
1219 #[cfg(target_has_atomic = "64")]
1220 #[unstable(feature = "integer_atomics", issue = "32976")]
1221 impl RefUnwindSafe for atomic::AtomicU64 {}
1222 -#[cfg(target_has_atomic = "128")]
1223 -#[unstable(feature = "integer_atomics", issue = "32976")]
1224 -impl RefUnwindSafe for atomic::AtomicU128 {}
1226 #[cfg(target_has_atomic = "8")]
1227 #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]