Skip to content

Commit

Permalink
Kernel - Nightly compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thepowersgang committed Nov 11, 2017
1 parent 4dcc4b6 commit 83677eb
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 43 deletions.
3 changes: 1 addition & 2 deletions Kernel/Core/lib/pod.rs
Expand Up @@ -5,8 +5,7 @@
//! Plain-old-data support

/// Plain-old-data trait
pub unsafe trait POD {}
unsafe impl POD for .. {}
pub unsafe auto trait POD {}
//impl<T: ::core::ops::Drop> !POD for T {} // - I would love this, but it collides with every other !POD impl
impl<T> !POD for ::core::cell::UnsafeCell<T> {}
impl<T> !POD for ::core::ptr::Unique<T> {}
Expand Down
100 changes: 59 additions & 41 deletions libcore_nofp.patch
@@ -1,14 +1,21 @@
Only in libcore/: clone.rs.orig
Only in libcore/: clone.rs.rej
diff -rub libcore_orig/default.rs libcore/default.rs
--- libcore_orig/default.rs 2017-06-22 16:51:20.271895100 +0800
+++ libcore/default.rs 2017-06-22 16:51:09.831744196 +0800
@@ -157,2 +157,4 @@
--- libcore_orig/default.rs 2017-11-11 10:43:12.134174979 +0800
+++ libcore/default.rs 2017-11-11 10:40:42.210064028 +0800
@@ -154,5 +154,7 @@
default_impl! { i64, 0, "Returns the default value of `0`" }
default_impl! { i128, 0, "Returns the default value of `0`" }

+#[cfg(not(disable_float))]
default_impl! { f32, 0.0f32, "Returns the default value of `0.0`" }
+#[cfg(not(disable_float))]
default_impl! { f64, 0.0f64, "Returns the default value of `0.0`" }
Only in libcore/: default.rs.orig
Only in libcore/: default.rs.rej
diff -rub libcore_orig/fmt/mod.rs libcore/fmt/mod.rs
--- libcore_orig/fmt/mod.rs 2017-06-22 16:51:20.055891975 +0800
+++ libcore/fmt/mod.rs 2017-06-22 16:51:09.831744196 +0800
--- libcore_orig/fmt/mod.rs 2017-11-11 10:43:11.866148987 +0800
+++ libcore/fmt/mod.rs 2017-11-11 10:40:42.210064028 +0800
@@ -15,12 +15,14 @@
use cell::{UnsafeCell, Cell, RefCell, Ref, RefMut};
use marker::PhantomData;
Expand All @@ -24,26 +31,27 @@ diff -rub libcore_orig/fmt/mod.rs libcore/fmt/mod.rs
mod float;
mod num;
mod builders;
@@ -1172,6 +1174,7 @@
@@ -1205,6 +1207,7 @@
/// Takes the formatted parts and applies the padding.
/// Assumes that the caller already has rendered the parts with required precision,
/// so that `self.precision` can be ignored.
+ #[cfg(not(disable_float))]
fn pad_formatted_parts(&mut self, formatted: &flt2dec::Formatted) -> Result {
if let Some(mut width) = self.width {
// for the sign-aware zero padding, we render the sign first and
@@ -1211,6 +1214,7 @@
@@ -1244,6 +1247,7 @@
}
}

+ #[cfg(not(disable_float))]
fn write_formatted_parts(&mut self, formatted: &flt2dec::Formatted) -> Result {
fn write_bytes(buf: &mut Write, s: &[u8]) -> Result {
buf.write_str(unsafe { str::from_utf8_unchecked(s) })
Only in libcore/fmt: mod.rs.orig
diff -rub libcore_orig/intrinsics.rs libcore/intrinsics.rs
--- libcore_orig/intrinsics.rs 2017-06-22 16:51:20.215894290 +0800
+++ libcore/intrinsics.rs 2017-06-22 16:51:09.831744196 +0800
@@ -1080,7 +1080,10 @@
--- libcore_orig/intrinsics.rs 2017-11-11 10:43:12.062168001 +0800
+++ libcore/intrinsics.rs 2017-11-11 10:40:42.214064504 +0800
@@ -1081,7 +1081,10 @@
/// The stabilized version of this intrinsic is
/// [`std::ptr::write_volatile`](../../std/ptr/fn.write_volatile.html).
pub fn volatile_store<T>(dst: *mut T, val: T);
Expand All @@ -54,7 +62,7 @@ diff -rub libcore_orig/intrinsics.rs libcore/intrinsics.rs
/// Returns the square root of an `f32`
pub fn sqrtf32(x: f32) -> f32;
/// Returns the square root of an `f64`
@@ -1197,8 +1200,9 @@
@@ -1198,8 +1201,9 @@
/// Float remainder that allows optimizations based on algebraic rules.
/// May assume inputs are finite.
pub fn frem_fast<T>(a: T, b: T) -> T;
Expand All @@ -67,28 +75,30 @@ diff -rub libcore_orig/intrinsics.rs libcore/intrinsics.rs

Only in libcore/: intrinsics.rs.orig
diff -rub libcore_orig/iter/traits.rs libcore/iter/traits.rs
--- libcore_orig/iter/traits.rs 2017-06-22 16:51:20.255894869 +0800
+++ libcore/iter/traits.rs 2017-06-22 16:51:09.831744196 +0800
@@ -700,6 +700,7 @@
--- libcore_orig/iter/traits.rs 2017-11-11 10:43:12.110172653 +0800
+++ libcore/iter/traits.rs 2017-11-11 10:40:42.214064504 +0800
@@ -764,6 +764,7 @@
);
}

+#[cfg(not(disable_float))]
macro_rules! float_sum_product {
($($a:ident)*) => ($(
#[stable(feature = "iter_arith_traits", since = "1.12.0")]
@@ -733,6 +734,7 @@
@@ -797,6 +798,7 @@
}

integer_sum_product! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
+#[cfg(not(disable_float))]
float_sum_product! { f32 f64 }

/// An iterator adapter that produces output as long as the underlying
Only in libcore/iter: traits.rs.orig
Only in libcore/iter: traits.rs.rej
diff -rub libcore_orig/lib.rs libcore/lib.rs
--- libcore_orig/lib.rs 2017-06-22 16:51:20.003891223 +0800
+++ libcore/lib.rs 2017-06-22 16:51:09.831744196 +0800
@@ -126,7 +126,9 @@
--- libcore_orig/lib.rs 2017-11-11 10:43:11.790141612 +0800
+++ libcore/lib.rs 2017-11-11 10:40:42.214064504 +0800
@@ -140,7 +140,9 @@
#[path = "num/u64.rs"] pub mod u64;
#[path = "num/u128.rs"] pub mod u128;

Expand All @@ -98,9 +108,10 @@ diff -rub libcore_orig/lib.rs libcore/lib.rs
#[path = "num/f64.rs"] pub mod f64;

#[macro_use]
Only in libcore/: lib.rs.orig
diff -rub libcore_orig/num/flt2dec/decoder.rs libcore/num/flt2dec/decoder.rs
--- libcore_orig/num/flt2dec/decoder.rs 2017-06-22 16:51:20.187893885 +0800
+++ libcore/num/flt2dec/decoder.rs 2017-06-22 16:51:09.831744196 +0800
--- libcore_orig/num/flt2dec/decoder.rs 2017-11-11 10:43:12.026164512 +0800
+++ libcore/num/flt2dec/decoder.rs 2017-11-11 10:40:42.214064504 +0800
@@ -10,6 +10,7 @@

//! Decodes a floating-point value into individual parts and error ranges.
Expand All @@ -123,9 +134,9 @@ diff -rub libcore_orig/num/flt2dec/decoder.rs libcore/num/flt2dec/decoder.rs
fn min_pos_norm_value() -> Self { f64::MIN_POSITIVE }
}
diff -rub libcore_orig/num/mod.rs libcore/num/mod.rs
--- libcore_orig/num/mod.rs 2017-06-22 16:51:20.043891802 +0800
+++ libcore/num/mod.rs 2017-06-22 16:51:09.831744196 +0800
@@ -90,7 +90,9 @@
--- libcore_orig/num/mod.rs 2017-11-11 10:43:11.850147435 +0800
+++ libcore/num/mod.rs 2017-11-11 10:42:40.419034954 +0800
@@ -91,7 +91,9 @@
mod wrapping;

// All these modules are technically private and only exposed for coretests:
Expand All @@ -135,23 +146,23 @@ diff -rub libcore_orig/num/mod.rs libcore/num/mod.rs
pub mod dec2flt;
pub mod bignum;
pub mod diy_float;
@@ -2404,6 +2406,7 @@
@@ -2950,6 +2952,7 @@
#[unstable(feature = "core_float",
reason = "stable interface is via `impl f{32,64}` in later crates",
issue = "32110")]
+#[cfg(not(disable_float))]
pub trait Float: Sized {
/// Returns `true` if this value is NaN and false otherwise.
#[stable(feature = "core", since = "1.6.0")]
@@ -2714,6 +2717,7 @@
@@ -3394,6 +3397,7 @@
}

#[stable(feature = "rust1", since = "1.0.0")]
+#[cfg(not(disable_float))]
pub use num::dec2flt::ParseFloatError;

// Conversion traits for primitive integer and float types
@@ -2773,6 +2777,9 @@
@@ -3453,6 +3457,9 @@
// they fit in the significand, which is 24 bits in f32 and 53 bits in f64.
// Lossy float conversions are not implemented at this time.

Expand All @@ -161,16 +172,23 @@ diff -rub libcore_orig/num/mod.rs libcore/num/mod.rs
// Signed -> Float
impl_from! { i8, f32, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
impl_from! { i8, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
@@ -2789,3 +2796,4 @@
@@ -3469,6 +3476,7 @@

// Float -> Float
impl_from! { f32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
+}

static ASCII_LOWERCASE_MAP: [u8; 256] = [
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
Only in libcore/num: mod.rs.orig
Only in libcore/num: .mod.rs.orig.swp
Only in libcore/num: mod.rs.rej
Only in libcore/num: .mod.rs.rej.swp
Only in libcore/num: .mod.rs.swp
diff -rub libcore_orig/ops/arith.rs libcore/ops/arith.rs
--- libcore_orig/ops/arith.rs 2017-06-22 16:51:20.127893017 +0800
+++ libcore/ops/arith.rs 2017-06-22 16:51:09.831744196 +0800
@@ -116,7 +116,9 @@
--- libcore_orig/ops/arith.rs 2017-11-11 10:43:11.950157139 +0800
+++ libcore/ops/arith.rs 2017-11-11 10:40:42.218064980 +0800
@@ -101,7 +101,9 @@
)*)
}

Expand All @@ -181,7 +199,7 @@ diff -rub libcore_orig/ops/arith.rs libcore/ops/arith.rs

/// The subtraction operator `-`.
///
@@ -190,7 +192,9 @@
@@ -196,7 +198,9 @@
)*)
}

Expand All @@ -203,39 +221,39 @@ diff -rub libcore_orig/ops/arith.rs libcore/ops/arith.rs

/// The division operator `/`.
///
@@ -445,6 +451,7 @@
@@ -437,6 +443,7 @@

div_impl_integer! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }

+#[cfg(not(disable_float))]
macro_rules! div_impl_float {
($($t:ty)*) => ($(
#[stable(feature = "rust1", since = "1.0.0")]
@@ -459,6 +466,7 @@
@@ -451,6 +458,7 @@
)*)
}

+#[cfg(not(disable_float))]
div_impl_float! { f32 f64 }

/// The remainder operator `%`.
@@ -526,6 +534,7 @@
@@ -520,6 +528,7 @@
rem_impl_integer! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }


+#[cfg(not(disable_float))]
macro_rules! rem_impl_float {
($($t:ty)*) => ($(
#[stable(feature = "rust1", since = "1.0.0")]
@@ -540,6 +549,7 @@
@@ -534,6 +543,7 @@
)*)
}

+#[cfg(not(disable_float))]
rem_impl_float! { f32 f64 }

/// The unary negation operator `-`.
@@ -620,7 +630,9 @@
@@ -614,7 +624,9 @@
}

// neg_impl_unsigned! { usize u8 u16 u32 u64 }
Expand All @@ -246,7 +264,7 @@ diff -rub libcore_orig/ops/arith.rs libcore/ops/arith.rs

/// The addition assignment operator `+=`.
///
@@ -677,7 +689,9 @@
@@ -667,7 +679,9 @@
)+)
}

Expand All @@ -257,7 +275,7 @@ diff -rub libcore_orig/ops/arith.rs libcore/ops/arith.rs

/// The subtraction assignment operator `-=`.
///
@@ -734,7 +748,9 @@
@@ -720,7 +734,9 @@
)+)
}

Expand All @@ -268,7 +286,7 @@ diff -rub libcore_orig/ops/arith.rs libcore/ops/arith.rs

/// The multiplication assignment operator `*=`.
///
@@ -780,7 +796,9 @@
@@ -764,7 +780,9 @@
)+)
}

Expand All @@ -279,7 +297,7 @@ diff -rub libcore_orig/ops/arith.rs libcore/ops/arith.rs

/// The division assignment operator `/=`.
///
@@ -825,7 +843,9 @@
@@ -807,7 +825,9 @@
)+)
}

Expand All @@ -290,7 +308,7 @@ diff -rub libcore_orig/ops/arith.rs libcore/ops/arith.rs

/// The remainder assignment operator `%=`.
///
@@ -870,4 +890,6 @@
@@ -854,4 +874,6 @@
)+)
}

Expand Down

0 comments on commit 83677eb

Please sign in to comment.