diff --git a/0002-Disable-u128-and-i128-in-libcore.patch b/0002-Disable-u128-and-i128-in-libcore.patch index 8b837400468..a8f2005a64c 100644 --- a/0002-Disable-u128-and-i128-in-libcore.patch +++ b/0002-Disable-u128-and-i128-in-libcore.patch @@ -1,27 +1,27 @@ -From 13b3aab50eec5bd0ae22ebb76eba4d0ccb90ae14 Mon Sep 17 00:00:00 2001 +From 7a466d258ff8c795fa52274e0627a39becb3bdf3 Mon Sep 17 00:00:00 2001 From: bjorn3 -Date: Sat, 10 Nov 2018 10:49:26 +0100 +Date: Tue, 13 Nov 2018 18:11:23 +0100 Subject: [PATCH] Disable u128 and i128 in libcore --- src/libcore/clone.rs | 4 +- - src/libcore/cmp.rs | 6 +- + src/libcore/cmp.rs | 6 +-- src/libcore/default.rs | 2 - - src/libcore/fmt/num.rs | 6 +- - src/libcore/hash/mod.rs | 20 ------ + src/libcore/fmt/num.rs | 6 +-- + src/libcore/hash/mod.rs | 20 ------- src/libcore/iter/range.rs | 1 - src/libcore/iter/traits.rs | 2 +- src/libcore/lib.rs | 2 - src/libcore/marker.rs | 4 +- src/libcore/mem.rs | 2 - - src/libcore/num/mod.rs | 99 ++++++++------------------- - src/libcore/num/wrapping.rs | 14 ++-- - src/libcore/ops/arith.rs | 22 +++--- - src/libcore/ops/bit.rs | 30 +++------ - src/libcore/sync/atomic.rs | 28 -------- - src/libcore/tests/iter.rs | 15 ----- - src/libcore/tests/num/mod.rs | 18 ----- - src/libcore/time.rs | 126 ----------------------------------- + src/libcore/num/mod.rs | 99 +++++++++------------------------- + src/libcore/num/wrapping.rs | 14 ++--- + src/libcore/ops/arith.rs | 22 ++++---- + src/libcore/ops/bit.rs | 30 ++++------- + src/libcore/sync/atomic.rs | 28 ---------- + src/libcore/tests/iter.rs | 15 ------ + src/libcore/tests/num/mod.rs | 18 ------- + src/libcore/time.rs | 126 ------------------------------------------- 18 files changed, 62 insertions(+), 339 deletions(-) diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs @@ -214,10 +214,10 @@ index f95f8e7..549d832 100644 /// An iterator adapter that produces output as long as the underlying diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs -index 3e7db7a..1217d4a 100644 +index 1fec2e5..04266ee 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs -@@ -153,14 +153,12 @@ mod uint_macros; +@@ -152,14 +152,12 @@ mod uint_macros; #[path = "num/i16.rs"] pub mod i16; #[path = "num/i32.rs"] pub mod i32; #[path = "num/i64.rs"] pub mod i64; @@ -248,7 +248,7 @@ index 662a8dd..856878e 100644 bool char } diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs -index 1d0b194..cf15fda 100644 +index d4b7094..3b5a197 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -162,12 +162,10 @@ pub fn forget(t: T) { @@ -265,7 +265,7 @@ index 1d0b194..cf15fda 100644 /// f64 | 8 /// char | 4 diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs -index c6cbeea..08ef46c 100644 +index 30b7b45..88a294a 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -112,7 +112,6 @@ nonzero_integers! { @@ -295,7 +295,7 @@ index c6cbeea..08ef46c 100644 #[cfg(target_pointer_width = "16")] #[lang = "isize"] impl isize { -@@ -4337,17 +4324,6 @@ impl u64 { +@@ -4349,17 +4336,6 @@ impl u64 { "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]" } } @@ -313,7 +313,7 @@ index c6cbeea..08ef46c 100644 #[cfg(target_pointer_width = "16")] #[lang = "usize"] impl usize { -@@ -4431,7 +4407,7 @@ macro_rules! from_str_radix_int_impl { +@@ -4443,7 +4419,7 @@ macro_rules! from_str_radix_int_impl { } )*} } @@ -322,7 +322,7 @@ index c6cbeea..08ef46c 100644 /// The error type returned when a checked integral type conversion fails. #[unstable(feature = "try_from", issue = "33417")] -@@ -4547,30 +4523,25 @@ macro_rules! rev { +@@ -4559,30 +4535,25 @@ macro_rules! rev { try_from_upper_bounded!(u16, u8); try_from_upper_bounded!(u32, u16, u8); try_from_upper_bounded!(u64, u32, u16, u8); @@ -357,7 +357,7 @@ index c6cbeea..08ef46c 100644 // usize/isize try_from_upper_bounded!(usize, isize); -@@ -4582,21 +4553,21 @@ mod ptr_try_from_impls { +@@ -4594,21 +4565,21 @@ mod ptr_try_from_impls { use convert::TryFrom; try_from_upper_bounded!(usize, u8); @@ -387,7 +387,7 @@ index c6cbeea..08ef46c 100644 } #[cfg(target_pointer_width = "32")] -@@ -4605,24 +4576,24 @@ mod ptr_try_from_impls { +@@ -4617,24 +4588,24 @@ mod ptr_try_from_impls { use convert::TryFrom; try_from_upper_bounded!(usize, u8, u16); @@ -420,7 +420,7 @@ index c6cbeea..08ef46c 100644 } #[cfg(target_pointer_width = "64")] -@@ -4631,24 +4602,20 @@ mod ptr_try_from_impls { +@@ -4643,24 +4614,20 @@ mod ptr_try_from_impls { use convert::TryFrom; try_from_upper_bounded!(usize, u8, u16, u32); @@ -449,7 +449,7 @@ index c6cbeea..08ef46c 100644 } #[doc(hidden)] -@@ -4683,7 +4650,7 @@ macro_rules! doit { +@@ -4695,7 +4662,7 @@ macro_rules! doit { } })*) } @@ -458,7 +458,7 @@ index c6cbeea..08ef46c 100644 fn from_str_radix(src: &str, radix: u32) -> Result { use self::IntErrorKind::*; -@@ -4851,52 +4818,38 @@ impl_from_bool! { u8, #[stable(feature = "from_bool", since = "1.28.0")] } +@@ -4863,52 +4830,38 @@ impl_from_bool! { u8, #[stable(feature = "from_bool", since = "1.28.0")] } impl_from_bool! { u16, #[stable(feature = "from_bool", since = "1.28.0")] } impl_from_bool! { u32, #[stable(feature = "from_bool", since = "1.28.0")] } impl_from_bool! { u64, #[stable(feature = "from_bool", since = "1.28.0")] } @@ -512,7 +512,7 @@ index c6cbeea..08ef46c 100644 // The C99 standard defines bounds on INTPTR_MIN, INTPTR_MAX, and UINTPTR_MAX // which imply that pointer-sized integers must be at least 16 bits: diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs -index 1c826c2..0779e31 100644 +index 00134a5..ea15481 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -112,19 +112,17 @@ macro_rules! sh_impl_all { @@ -886,11 +886,10 @@ index 2476c07..2075670 100644 #[derive(Clone)] struct Test(Bigger); -@@ -1877,19 +1875,6 @@ fn test_step_replace_signed() { - assert_eq!(y, 5); +@@ -1878,19 +1876,6 @@ fn test_step_replace_signed() { } --#[test] + #[test] -fn test_step_replace_no_between() { - let mut x = 4u128; - let y = x.replace_zero(); @@ -903,9 +902,10 @@ index 2476c07..2075670 100644 - assert_eq!(y, 5); -} - - #[test] +-#[test] fn test_rev_try_folds() { let f = &|acc, x| i32::checked_add(2*acc, x); + assert_eq!((1..10).rev().try_fold(7, f), (1..10).try_rfold(7, f)); diff --git a/src/libcore/tests/num/mod.rs b/src/libcore/tests/num/mod.rs index ab96d31..bb5c1d0 100644 --- a/src/libcore/tests/num/mod.rs @@ -976,7 +976,7 @@ index ab96d31..bb5c1d0 100644 test_impl_try_from_always_ok! { test_try_usizeusize, usize, usize } test_impl_try_from_always_ok! { test_try_isizeisize, isize, isize } diff --git a/src/libcore/time.rs b/src/libcore/time.rs -index cfbd431..aee8065 100644 +index 938e975..2ba930d 100644 --- a/src/libcore/time.rs +++ b/src/libcore/time.rs @@ -30,7 +30,6 @@ const NANOS_PER_MILLI: u32 = 1_000_000; @@ -987,7 +987,7 @@ index cfbd431..aee8065 100644 /// A `Duration` type to represent a span of time, typically used for system /// timeouts. -@@ -273,57 +272,6 @@ impl Duration { +@@ -269,57 +268,6 @@ impl Duration { #[inline] pub const fn subsec_nanos(&self) -> u32 { self.nanos } @@ -1004,7 +1004,7 @@ index cfbd431..aee8065 100644 - /// ``` - #[unstable(feature = "duration_as_u128", issue = "50202")] - #[inline] -- pub fn as_millis(&self) -> u128 { +- pub const fn as_millis(&self) -> u128 { - self.secs as u128 * MILLIS_PER_SEC as u128 + (self.nanos / NANOS_PER_MILLI) as u128 - } - @@ -1021,7 +1021,7 @@ index cfbd431..aee8065 100644 - /// ``` - #[unstable(feature = "duration_as_u128", issue = "50202")] - #[inline] -- pub fn as_micros(&self) -> u128 { +- pub const fn as_micros(&self) -> u128 { - self.secs as u128 * MICROS_PER_SEC as u128 + (self.nanos / NANOS_PER_MICRO) as u128 - } - @@ -1038,14 +1038,14 @@ index cfbd431..aee8065 100644 - /// ``` - #[unstable(feature = "duration_as_u128", issue = "50202")] - #[inline] -- pub fn as_nanos(&self) -> u128 { +- pub const fn as_nanos(&self) -> u128 { - self.secs as u128 * NANOS_PER_SEC as u128 + self.nanos as u128 - } - /// Checked `Duration` addition. Computes `self + other`, returning [`None`] /// if overflow occurred. /// -@@ -482,80 +430,6 @@ impl Duration { +@@ -478,80 +426,6 @@ impl Duration { (self.secs as f64) + (self.nanos as f64) / (NANOS_PER_SEC as f64) } @@ -1127,5 +1127,5 @@ index cfbd431..aee8065 100644 /// /// # Examples -- -2.17.2 (Apple Git-113) +2.11.0