aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src
diff options
context:
space:
mode:
authorCristian Carlesso <[email protected]>2017-04-30 12:51:23 +0100
committerCristian Carlesso <[email protected]>2017-04-30 12:51:23 +0100
commite617cba56763674330ce286598776bc18f59598b (patch)
tree41081ac41025775f516a37ecba2ea6e1815ef42e /ctr-std/src
parentMerge pull request #29 from FenrirWolf/condvar_patch (diff)
downloadctru-rs-e617cba56763674330ce286598776bc18f59598b.tar.xz
ctru-rs-e617cba56763674330ce286598776bc18f59598b.zip
Make ctru-rs compile again
Diffstat (limited to 'ctr-std/src')
-rw-r--r--ctr-std/src/collections/hash/table.rs2
-rw-r--r--ctr-std/src/f32.rs34
-rw-r--r--ctr-std/src/f64.rs30
-rw-r--r--ctr-std/src/lib.rs3
-rw-r--r--ctr-std/src/num.rs4
5 files changed, 4 insertions, 69 deletions
diff --git a/ctr-std/src/collections/hash/table.rs b/ctr-std/src/collections/hash/table.rs
index 4fd4abf..ddf975e 100644
--- a/ctr-std/src/collections/hash/table.rs
+++ b/ctr-std/src/collections/hash/table.rs
@@ -975,7 +975,7 @@ impl<'a, K, V> Iterator for Drain<'a, K, V> {
fn next(&mut self) -> Option<(SafeHash, K, V)> {
self.iter.next().map(|bucket| {
unsafe {
- (**self.table).size -= 1;
+ (*self.table.as_mut_ptr()).size -= 1;
let (k, v) = ptr::read(bucket.pair);
(SafeHash { hash: ptr::replace(bucket.hash, EMPTY_BUCKET) }, k, v)
}
diff --git a/ctr-std/src/f32.rs b/ctr-std/src/f32.rs
index 7a676c0..f793909 100644
--- a/ctr-std/src/f32.rs
+++ b/ctr-std/src/f32.rs
@@ -242,40 +242,6 @@ impl f32 {
#[inline]
pub fn classify(self) -> FpCategory { num::Float::classify(self) }
- /// Returns the mantissa, base 2 exponent, and sign as integers, respectively.
- /// The original number can be recovered by `sign * mantissa * 2 ^ exponent`.
- /// The floating point encoding is documented in the [Reference][floating-point].
- ///
- /// ```
- /// #![feature(float_extras)]
- ///
- /// use std::f32;
- ///
- /// let num = 2.0f32;
- ///
- /// // (8388608, -22, 1)
- /// let (mantissa, exponent, sign) = num.integer_decode();
- /// let sign_f = sign as f32;
- /// let mantissa_f = mantissa as f32;
- /// let exponent_f = num.powf(exponent as f32);
- ///
- /// // 1 * 8388608 * 2^(-22) == 2
- /// let abs_difference = (sign_f * mantissa_f * exponent_f - num).abs();
- ///
- /// assert!(abs_difference <= f32::EPSILON);
- /// ```
- /// [floating-point]: ../reference.html#machine-types
- #[unstable(feature = "float_extras", reason = "signature is undecided",
- issue = "27752")]
- #[rustc_deprecated(since = "1.11.0",
- reason = "never really came to fruition and easily \
- implementable outside the standard library")]
- #[inline]
- #[allow(deprecated)]
- pub fn integer_decode(self) -> (u64, i16, i8) {
- num::Float::integer_decode(self)
- }
-
/// Returns the largest integer less than or equal to a number.
///
/// ```
diff --git a/ctr-std/src/f64.rs b/ctr-std/src/f64.rs
index 67a1c30..55b85cd 100644
--- a/ctr-std/src/f64.rs
+++ b/ctr-std/src/f64.rs
@@ -186,36 +186,6 @@ impl f64 {
#[inline]
pub fn classify(self) -> FpCategory { num::Float::classify(self) }
- /// Returns the mantissa, base 2 exponent, and sign as integers, respectively.
- /// The original number can be recovered by `sign * mantissa * 2 ^ exponent`.
- /// The floating point encoding is documented in the [Reference][floating-point].
- ///
- /// ```
- /// #![feature(float_extras)]
- ///
- /// let num = 2.0f64;
- ///
- /// // (8388608, -22, 1)
- /// let (mantissa, exponent, sign) = num.integer_decode();
- /// let sign_f = sign as f64;
- /// let mantissa_f = mantissa as f64;
- /// let exponent_f = num.powf(exponent as f64);
- ///
- /// // 1 * 8388608 * 2^(-22) == 2
- /// let abs_difference = (sign_f * mantissa_f * exponent_f - num).abs();
- ///
- /// assert!(abs_difference < 1e-10);
- /// ```
- /// [floating-point]: ../reference.html#machine-types
- #[unstable(feature = "float_extras", reason = "signature is undecided",
- issue = "27752")]
- #[rustc_deprecated(since = "1.11.0",
- reason = "never really came to fruition and easily \
- implementable outside the standard library")]
- #[inline]
- #[allow(deprecated)]
- pub fn integer_decode(self) -> (u64, i16, i8) { num::Float::integer_decode(self) }
-
/// Returns the largest integer less than or equal to a number.
///
/// ```
diff --git a/ctr-std/src/lib.rs b/ctr-std/src/lib.rs
index 3724cc4..7a520b8 100644
--- a/ctr-std/src/lib.rs
+++ b/ctr-std/src/lib.rs
@@ -4,8 +4,8 @@
#![feature(cfg_target_has_atomic)]
#![feature(cfg_target_thread_local)]
#![feature(collections)]
-#![feature(collections_bound)]
#![feature(collections_range)]
+#![feature(core_float)]
#![feature(const_fn)]
#![feature(compiler_builtins_lib)]
#![feature(core_intrinsics)]
@@ -44,6 +44,7 @@
#![allow(non_camel_case_types, dead_code, unused_features)]
#![no_std]
+
#![stable(feature = "rust1", since = "1.0.0")]
#[prelude_import]
diff --git a/ctr-std/src/num.rs b/ctr-std/src/num.rs
index d1c2fc3..b7618ac 100644
--- a/ctr-std/src/num.rs
+++ b/ctr-std/src/num.rs
@@ -17,10 +17,8 @@
#![allow(missing_docs)]
#[stable(feature = "rust1", since = "1.0.0")]
-#[allow(deprecated)]
-pub use core::num::{Zero, One};
-#[stable(feature = "rust1", since = "1.0.0")]
pub use core::num::{FpCategory, ParseIntError, ParseFloatError, TryFromIntError};
+
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::num::Wrapping;