| 1 |
Index: half/Cargo.toml |
| 2 |
=================================================================== |
| 3 |
--- half.orig/Cargo.toml |
| 4 |
+++ half/Cargo.toml |
| 5 |
@@ -90,13 +90,13 @@ optional = true |
| 6 |
default-features = false |
| 7 |
|
| 8 |
[dependencies.rand] |
| 9 |
-version = "0.9.0" |
| 10 |
+version = "0.10.0" |
| 11 |
features = ["thread_rng"] |
| 12 |
optional = true |
| 13 |
default-features = false |
| 14 |
|
| 15 |
[dependencies.rand_distr] |
| 16 |
-version = "0.5.0" |
| 17 |
+version = "0.6.0" |
| 18 |
optional = true |
| 19 |
default-features = false |
| 20 |
|
| 21 |
@@ -131,7 +131,7 @@ version = "1.0" |
| 22 |
version = "1.0" |
| 23 |
|
| 24 |
[dev-dependencies.rand] |
| 25 |
-version = "0.9.0" |
| 26 |
+version = "0.10.0" |
| 27 |
|
| 28 |
[target.'cfg(target_arch = "spirv")'.dependencies.crunchy] |
| 29 |
version = "0.2.2" |
| 30 |
Index: half/src/rand_distr.rs |
| 31 |
=================================================================== |
| 32 |
--- half.orig/src/rand_distr.rs |
| 33 |
+++ half/src/rand_distr.rs |
| 34 |
@@ -1,12 +1,12 @@ |
| 35 |
use crate::{bf16, f16}; |
| 36 |
|
| 37 |
-use rand::{distr::Distribution, Rng}; |
| 38 |
+use rand::{distr::Distribution, RngExt}; |
| 39 |
use rand_distr::uniform::UniformFloat; |
| 40 |
|
| 41 |
macro_rules! impl_distribution_via_f32 { |
| 42 |
($Ty:ty, $Distr:ty) => { |
| 43 |
impl Distribution<$Ty> for $Distr { |
| 44 |
- fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> $Ty { |
| 45 |
+ fn sample<R: RngExt + ?Sized>(&self, rng: &mut R) -> $Ty { |
| 46 |
<$Ty>::from_f32(<Self as Distribution<f32>>::sample(self, rng)) |
| 47 |
} |
| 48 |
} |
| 49 |
@@ -74,7 +74,7 @@ impl rand_distr::uniform::UniformSampler |
| 50 |
high.borrow().to_f32(), |
| 51 |
)?)) |
| 52 |
} |
| 53 |
- fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Self::X { |
| 54 |
+ fn sample<R: RngExt + ?Sized>(&self, rng: &mut R) -> Self::X { |
| 55 |
f16::from_f32(self.0.sample(rng)) |
| 56 |
} |
| 57 |
} |
| 58 |
@@ -108,7 +108,7 @@ impl rand_distr::uniform::UniformSampler |
| 59 |
high.borrow().to_f32(), |
| 60 |
)?)) |
| 61 |
} |
| 62 |
- fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Self::X { |
| 63 |
+ fn sample<R: RngExt + ?Sized>(&self, rng: &mut R) -> Self::X { |
| 64 |
bf16::from_f32(self.0.sample(rng)) |
| 65 |
} |
| 66 |
} |
| 67 |
@@ -118,7 +118,7 @@ mod tests { |
| 68 |
use super::*; |
| 69 |
|
| 70 |
#[allow(unused_imports)] |
| 71 |
- use rand::{rng, Rng}; |
| 72 |
+ use rand::{rng, RngExt}; |
| 73 |
use rand_distr::{StandardNormal, StandardUniform, Uniform}; |
| 74 |
|
| 75 |
#[test] |