Skip to content

Commit 6ede0f8

Browse files
committed
Fix tests related to no_std
1 parent e4f534c commit 6ede0f8

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

src/librand/distributions/exponential.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! The exponential distribution.
1212
13+
#[cfg(not(test))] // only necessary for no_std
1314
use FloatMath;
1415

1516
use {Rng, Rand};

src/librand/distributions/gamma.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use self::GammaRepr::*;
1414
use self::ChiSquaredRepr::*;
1515

16+
#[cfg(not(test))] // only necessary for no_std
1617
use FloatMath;
1718

1819
use {Rng, Open01};

src/librand/distributions/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
//! internally. The `IndependentSample` trait is for generating values
1818
//! that do not need to record state.
1919
20+
#[cfg(not(test))] // only necessary for no_std
2021
use core::num::Float;
22+
2123
use core::marker::PhantomData;
2224

2325
use {Rng, Rand};

src/librand/distributions/normal.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! The normal and derived distributions.
1212
13+
#[cfg(not(test))] // only necessary for no_std
1314
use FloatMath;
1415

1516
use {Rng, Rand, Open01};

src/librand/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
#![unstable(feature = "rand",
2929
reason = "use `rand` from crates.io",
3030
issue = "27703")]
31-
#![feature(core_float)]
3231
#![feature(core_intrinsics)]
3332
#![feature(staged_api)]
3433
#![feature(step_by)]
3534
#![feature(custom_attribute)]
3635
#![allow(unused_attributes)]
3736

37+
#![cfg_attr(not(test), feature(core_float))] // only necessary for no_std
3838
#![cfg_attr(test, feature(test, rand))]
3939

4040
#![allow(deprecated)]

0 commit comments

Comments
 (0)