Skip to content

Commit

Permalink
Fix tests related to no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
sanxiyn committed May 3, 2016
1 parent 24d8613 commit 8ff14bf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/librand/distributions/exponential.rs
Expand Up @@ -10,6 +10,7 @@

//! The exponential distribution.

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

use {Rng, Rand};
Expand Down
1 change: 1 addition & 0 deletions src/librand/distributions/gamma.rs
Expand Up @@ -13,6 +13,7 @@
use self::GammaRepr::*;
use self::ChiSquaredRepr::*;

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

use {Rng, Open01};
Expand Down
2 changes: 2 additions & 0 deletions src/librand/distributions/mod.rs
Expand Up @@ -17,7 +17,9 @@
//! internally. The `IndependentSample` trait is for generating values
//! that do not need to record state.

#[cfg(not(test))] // only necessary for no_std
use core::num::Float;

use core::marker::PhantomData;

use {Rng, Rand};
Expand Down
1 change: 1 addition & 0 deletions src/librand/distributions/normal.rs
Expand Up @@ -10,6 +10,7 @@

//! The normal and derived distributions.

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

use {Rng, Rand, Open01};
Expand Down
2 changes: 1 addition & 1 deletion src/librand/lib.rs
Expand Up @@ -28,13 +28,13 @@
#![unstable(feature = "rand",
reason = "use `rand` from crates.io",
issue = "27703")]
#![feature(core_float)]
#![feature(core_intrinsics)]
#![feature(staged_api)]
#![feature(step_by)]
#![feature(custom_attribute)]
#![allow(unused_attributes)]

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

#![allow(deprecated)]
Expand Down

0 comments on commit 8ff14bf

Please sign in to comment.