111111
112112#[ cfg( feature = "std" ) ]
113113use std:: time:: Duration ;
114+ #[ cfg( all( not( feature = "std" ) , rust_1_25) ) ]
115+ use core:: time:: Duration ;
114116
115117use Rng ;
116118use distributions:: Distribution ;
@@ -833,14 +835,14 @@ uniform_float_impl! { f64x8, u64x8, f64, u64, 64 - 52 }
833835///
834836/// [`UniformSampler`]: trait.UniformSampler.html
835837/// [`Uniform`]: struct.Uniform.html
836- #[ cfg( feature = "std" ) ]
838+ #[ cfg( any ( feature = "std" , rust_1_25 ) ) ]
837839#[ derive( Clone , Copy , Debug ) ]
838840pub struct UniformDuration {
839841 mode : UniformDurationMode ,
840842 offset : u32 ,
841843}
842844
843- #[ cfg( feature = "std" ) ]
845+ #[ cfg( any ( feature = "std" , rust_1_25 ) ) ]
844846#[ derive( Debug , Copy , Clone ) ]
845847enum UniformDurationMode {
846848 Small {
@@ -857,12 +859,12 @@ enum UniformDurationMode {
857859 }
858860}
859861
860- #[ cfg( feature = "std" ) ]
862+ #[ cfg( any ( feature = "std" , rust_1_25 ) ) ]
861863impl SampleUniform for Duration {
862864 type Sampler = UniformDuration ;
863865}
864866
865- #[ cfg( feature = "std" ) ]
867+ #[ cfg( any ( feature = "std" , rust_1_25 ) ) ]
866868impl UniformSampler for UniformDuration {
867869 type X = Duration ;
868870
@@ -1206,9 +1208,12 @@ mod tests {
12061208
12071209
12081210 #[ test]
1209- #[ cfg( feature = "std" ) ]
1211+ #[ cfg( any ( feature = "std" , rust_1_25 ) ) ]
12101212 fn test_durations ( ) {
1213+ #[ cfg( feature = "std" ) ]
12111214 use std:: time:: Duration ;
1215+ #[ cfg( all( not( feature = "std" ) , rust_1_25) ) ]
1216+ use core:: time:: Duration ;
12121217
12131218 let mut rng = :: test:: rng ( 253 ) ;
12141219
0 commit comments