File tree 5 files changed +11
-7
lines changed
5 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ matrix:
11
11
- rust : 1.22.0
12
12
install :
13
13
script :
14
- - cargo test --tests --no-default-features
14
+ # TODO: use --tests instead of --lib on more recent compiler
15
+ - cargo test --lib --no-default-features
15
16
- cargo test --package rand_core --no-default-features
16
17
- cargo test --features serde1,log
17
18
- rust : stable
Original file line number Diff line number Diff line change @@ -95,7 +95,9 @@ macro_rules! float_impls {
95
95
// The exponent is encoded using an offset-binary representation
96
96
let exponent_bits: $u_scalar =
97
97
( ( $exponent_bias + exponent) as $u_scalar) << $fraction_bits;
98
- $ty:: from_bits( self | exponent_bits)
98
+ // TODO: use from_bits when min compiler > 1.25 (see #545)
99
+ // $ty::from_bits(self | exponent_bits)
100
+ unsafe { mem:: transmute( self | exponent_bits) }
99
101
}
100
102
}
101
103
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ impl<T> Distribution<Wrapping<T>> for Standard where Standard: Distribution<T> {
180
180
mod tests {
181
181
use { Rng , RngCore , Standard } ;
182
182
use distributions:: Alphanumeric ;
183
- #[ cfg( all( not( feature="std" ) , feature="alloc" ) ) ] use alloc:: String ;
183
+ #[ cfg( all( not( feature="std" ) , feature="alloc" ) ) ] use alloc:: string :: String ;
184
184
185
185
#[ test]
186
186
fn test_misc ( ) {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use ::core::cmp::PartialOrd;
15
15
use :: { Error , ErrorKind } ;
16
16
17
17
// Note that this whole module is only imported if feature="alloc" is enabled.
18
- #[ cfg( not( feature="std" ) ) ] use alloc:: Vec ;
18
+ #[ cfg( not( feature="std" ) ) ] use alloc:: vec :: Vec ;
19
19
20
20
/// A distribution using weighted sampling to pick a discretely selected item.
21
21
///
Original file line number Diff line number Diff line change 15
15
#[ cfg( feature="alloc" ) ] use core:: ops:: Index ;
16
16
17
17
#[ cfg( feature="std" ) ] use std:: vec;
18
- #[ cfg( all( feature="alloc" , not( feature="std" ) ) ) ] use alloc:: { vec, Vec } ;
18
+ #[ cfg( all( feature="alloc" , not( feature="std" ) ) ) ] use alloc:: vec;
19
+ #[ cfg( all( feature="alloc" , not( feature="std" ) ) ) ] use alloc:: vec:: Vec ;
19
20
// BTreeMap is not as fast in tests, but better than nothing.
20
21
#[ cfg( feature="std" ) ] use std:: collections:: HashMap ;
21
- #[ cfg( all( feature="alloc" , not( feature="std" ) ) ) ] use alloc:: btree_map :: BTreeMap ;
22
+ #[ cfg( all( feature="alloc" , not( feature="std" ) ) ) ] use alloc:: collections :: BTreeMap ;
22
23
23
24
24
25
use super :: Rng ;
@@ -599,7 +600,7 @@ mod test {
599
600
#[ cfg( feature = "alloc" ) ] use { Rng , SeedableRng } ;
600
601
#[ cfg( feature = "alloc" ) ] use prng:: XorShiftRng ;
601
602
#[ cfg( all( feature="alloc" , not( feature="std" ) ) ) ]
602
- use alloc:: Vec ;
603
+ use alloc:: vec :: Vec ;
603
604
604
605
#[ test]
605
606
fn test_slice_choose ( ) {
You can’t perform that action at this time.
0 commit comments