Use rand_core 0.10.0-rc-2#71
Conversation
| use rand_core::{ | ||
| le::{self}, | ||
| RngCore, | ||
| }; |
There was a problem hiding this comment.
This can be reformatted (delete ::{self}).
| #[inline] | ||
| fn from_rng(rng: &mut impl RngCore) -> Self { | ||
| fn from_rng<R>(rng: &mut R) -> Self | ||
| where | ||
| R: RngCore + ?Sized, | ||
| { | ||
| Hc128Rng(BlockRng::<Hc128Core>::from_rng(rng)) | ||
| } | ||
|
|
||
| #[inline] | ||
| fn try_from_rng<R: TryRngCore>(rng: &mut R) -> Result<Self, R::Error> { | ||
| fn try_from_rng<R>(rng: &mut R) -> Result<Self, R::Error> | ||
| where | ||
| R: TryRngCore + ?Sized, | ||
| { | ||
| BlockRng::<Hc128Core>::try_from_rng(rng).map(Hc128Rng) | ||
| } |
There was a problem hiding this comment.
The {try_}from_rng implementations can be deleted.
Addresses rust-random#71 (comment).
|
PR updated! |
dhardy
left a comment
There was a problem hiding this comment.
You can also delete the from_rng one-line implementations.
|
Also looks like the Isaac RNGs do need those try_from_rng / from_rng methods. |
Addresses rust-random#71 (comment)
PR updated. Thanks for the patience. I'm not sure if #[test]
fn test_isaac_construction() {
let seed = [
1, 0, 0, 0, 23, 0, 0, 0, 200, 1, 0, 0, 210, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
];
let mut rng1 = IsaacRng::from_seed(seed);
assert_eq!(rng1.next_u32(), 2869442790);
// do we need this?
let mut rng2 = IsaacRng::from_rng(&mut rng1);
assert_eq!(rng2.next_u32(), 3094074039);
} |
|
See the impl of |
|
The benchmarks are harder to update since |
|
Perhaps the benchmarks could initialize from a static seed rather than |
|
It also looks like the MSRV needs to be bumped from 1.63 to 1.85 |
|
I updated the MSRV in #73. |
|
@allan2 can you rebase/merge to pick up the MSRV change? |
Addresses rust-random#71 (comment).
This reverts commit 01ec28a.
Done |
| <<<<<<< HEAD | ||
| <<<<<<< HEAD | ||
| <<<<<<< HEAD |
|
Looks like it's just the benchmarks that need updated now. Can the (this PR is blocking updating one of my dependencies, so I'm very excited to see it land) |
|
Yes, it's just benchmarks. I can fix those in a new PR. |
|
@dhardy would you mind cutting some prereleases of these? I specifically need |
This bumps
rand_coreto 0.10.0-rc-2 (2025-10-31).clippyandfmtare clean.