Skip to content

Commit 90d306f

Browse files
committed
Avoid use of from_bits until it is available in lib core
Also don't use --tests flag with 1.22 compiler.
1 parent bac2448 commit 90d306f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ matrix:
1111
- rust: 1.22.0
1212
install:
1313
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
1516
- cargo test --package rand_core --no-default-features
1617
- cargo test --features serde1,log
1718
- rust: stable

src/distributions/float.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ macro_rules! float_impls {
9595
// The exponent is encoded using an offset-binary representation
9696
let exponent_bits: $u_scalar =
9797
(($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) }
99101
}
100102
}
101103

0 commit comments

Comments
 (0)