Skip to content

Commit fe34d17

Browse files
committed
Revert "Auto merge of #296 - vks:no_std, r=cuviper"
This reverts commit 8b5d4ac, reversing changes made to ef752e4.
1 parent 681bbf8 commit fe34d17

File tree

11 files changed

+80
-340
lines changed

11 files changed

+80
-340
lines changed

traits/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,3 @@ name = "num-traits"
1010
version = "0.1.38"
1111

1212
[dependencies]
13-
14-
[features]
15-
default = ["std"]
16-
std = []

traits/src/bounds.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use core::{usize, u8, u16, u32, u64};
2-
use core::{isize, i8, i16, i32, i64};
3-
use core::{f32, f64};
4-
use core::num::Wrapping;
1+
use std::{usize, u8, u16, u32, u64};
2+
use std::{isize, i8, i16, i32, i64};
3+
use std::{f32, f64};
4+
use std::num::Wrapping;
55

66
/// Numbers which have upper and lower bounds
77
pub trait Bounded {

traits/src/cast.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
use core::mem::size_of;
2-
use core::num::Wrapping;
1+
use std::mem::size_of;
2+
use std::num::Wrapping;
33

44
use identities::Zero;
55
use bounds::Bounded;
6-
use float::Float;
76

87
/// A generic trait for converting a value to a number.
98
pub trait ToPrimitive {
@@ -227,8 +226,8 @@ macro_rules! impl_to_primitive_float_to_float {
227226
// Make sure the value is in range for the cast.
228227
// NaN and +-inf are cast as they are.
229228
let n = $slf as f64;
230-
let max_value: $DstT = ::core::$DstT::MAX;
231-
if !Float::is_finite(n) || (-max_value as f64 <= n && n <= max_value as f64) {
229+
let max_value: $DstT = ::std::$DstT::MAX;
230+
if !n.is_finite() || (-max_value as f64 <= n && n <= max_value as f64) {
232231
Some($slf as $DstT)
233232
} else {
234233
None
@@ -455,8 +454,8 @@ impl<T: NumCast> NumCast for Wrapping<T> {
455454

456455
#[test]
457456
fn to_primitive_float() {
458-
use core::f32;
459-
use core::f64;
457+
use std::f32;
458+
use std::f64;
460459

461460
let f32_toolarge = 1e39f64;
462461
assert_eq!(f32_toolarge.to_f32(), None);

0 commit comments

Comments
 (0)